Module: RubyCritic::Colorize

Instance Method Summary collapse

Instance Method Details

#colorize(text, color_code) ⇒ Object


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

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

#green(text) ⇒ Object


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

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

#red(text) ⇒ Object


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

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