# File lib/puppet/util/colors.rb, line 102 def colorize(color, str) case Puppet[:color] when true, :ansi, "ansi", "yes" if console_has_color? console_color(color, str) else str end when :html, "html" html_color(color, str) else str end end
# File lib/puppet/util/colors.rb, line 117 def console_color(color, str) Colormap[color][:console] + str.gsub(RESET[:console], Colormap[color][:console]) + RESET[:console] end
# File lib/puppet/util/colors.rb, line 87 def console_has_color? false end
# File lib/puppet/util/colors.rb, line 123 def html_color(color, str) span = '<span style="%s">' % Colormap[color][:html] "#{span}%s</span>" % str.gsub(/<span .*?<\/span>/, "</span>\\0#{span}") end