module Vamp::Colorize

Public Class Methods

colorize(color, text) click to toggle source
# File lib/vamp/colorize.rb, line 25
def colorize(color, text)
  color = Colorize::Colors.const_get(color.to_s.upcase)
  color ? colorful_text(color, text) : text
rescue
  text
end
method_missing(symbol, *args) click to toggle source
Calls superclass method
# File lib/vamp/colorize.rb, line 32
def method_missing(symbol, *args)
  color = Colorize::Colors.const_get(color.to_s.upcase)
  return colorful_text(color, *args) if color
  super
rescue
  super
end

Private Class Methods

colorful_text(color, text) click to toggle source
# File lib/vamp/colorize.rb, line 42
def colorful_text(color, text)
  "\e[#{color}m#{text}\e[0;0m"
end