Module: PuppetDB::Util
- Defined in:
- lib/puppetdb/util.rb
Class Method Summary collapse
Class Method Details
.color(code) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/puppetdb/util.rb', line 3 def self.color(code) colors = {:red => "[31m", :green => "[32m", :yellow => "[33m", :cyan => "[36m", :bold => "[1m", :reset => "[0m"} return colors[code] || "" end |
.colorize(code, msg) ⇒ Object
14 15 16 |
# File 'lib/puppetdb/util.rb', line 14 def self.colorize(code, msg) "%s%s%s" % [ color(code), msg, color(:reset) ] end |