Module: RubyCritic::Colorize

Instance Method Summary collapse

Instance Method Details

#colorize(text, color_code) ⇒ Object


5
6
7
# File 'lib/rubycritic/colorize.rb', line 5

def colorize(text, color_code)
  "\e[#{color_code}m#{text}\e[0m"
end

#green(text) ⇒ Object


13
14
15
# File 'lib/rubycritic/colorize.rb', line 13

def green(text)
  colorize(text, 32)
end

#red(text) ⇒ Object


9
10
11
# File 'lib/rubycritic/colorize.rb', line 9

def red(text)
  colorize(text, 31)
end