class String

Extends the String class

Public Instance Methods

colorize(color_code) click to toggle source

Wraps the ansi standard color code around a string

# File script/run_tests.rb, line 23
def colorize(color_code)
  "\e[#{color_code}m#{self}\e[0m"
end
green() click to toggle source

Prints green text

# File script/run_tests.rb, line 35
def green
  colorize(32)
end
light_colorize(color_code) click to toggle source

Wraps the ansi standard color code 1 around a string

# File script/run_tests.rb, line 27
def light_colorize(color_code)
  "\e[1;#{color_code}m#{self}\e[0m"
end
red() click to toggle source

Prints red text

# File script/run_tests.rb, line 31
def red
  colorize(31)
end