class String

monkey patch in some color effects string methods

Public Instance Methods

camel_case() click to toggle source
# File lib/puppet-repl.rb, line 20
def camel_case
  return self if self !~ /_/ && self =~ /[A-Z]+.*/
  split('_').map(&:capitalize).join
end
cyan() click to toggle source
# File lib/puppet-repl.rb, line 14
def cyan;           "\033[36m#{self}\033[0m" end
fatal() click to toggle source
# File lib/puppet-repl.rb, line 17
def fatal;          red                      end
green() click to toggle source
# File lib/puppet-repl.rb, line 13
def green;          "\033[32m#{self}\033[0m" end
info() click to toggle source
# File lib/puppet-repl.rb, line 18
def info;           green                    end
red() click to toggle source
# File lib/puppet-repl.rb, line 12
def red;            "\033[31m#{self}\033[0m" end
warning() click to toggle source
# File lib/puppet-repl.rb, line 16
def warning;        yellow                   end
yellow() click to toggle source
# File lib/puppet-repl.rb, line 15
def yellow;         "\033[33m#{self}\033[0m" end