Module: ColorOutput

Defined in:
lib/i18n_tyml/color_output.rb

Instance Method Summary collapse

Instance Method Details

#blue(text) ⇒ Object



11
# File 'lib/i18n_tyml/color_output.rb', line 11

def blue(text); colour(text, "\e[34m"); end

#colour(text, colour_code) ⇒ Object

snatched from rspec source



3
4
5
# File 'lib/i18n_tyml/color_output.rb', line 3

def colour(text, colour_code)
  "#{colour_code}#{text}\e[0m"
end

#green(text) ⇒ Object



7
# File 'lib/i18n_tyml/color_output.rb', line 7

def green(text); colour(text, "\e[32m"); end

#magenta(text) ⇒ Object



9
# File 'lib/i18n_tyml/color_output.rb', line 9

def magenta(text); colour(text, "\e[35m"); end

#red(text) ⇒ Object



8
# File 'lib/i18n_tyml/color_output.rb', line 8

def red(text); colour(text, "\e[31m"); end

#yellow(text) ⇒ Object



10
# File 'lib/i18n_tyml/color_output.rb', line 10

def yellow(text); colour(text, "\e[33m"); end