module ColorizedText

Colorizes text with ASCII colors.

Usage:

include ColorizedText

puts green "OK"          # => green output
puts bold "Running...    # => bold output
puts bold green "OK!!!"  # => bold green output

Public Instance Methods

colorize(text, code) click to toggle source

Colorize text using ASCII color code

# File lib/colorized_text.rb, line 10
def colorize(text, code)
  "\033[#{code}m#{text}\033[0m"
end