gitlabhq/lib/color.rb
Nihad Abbasov d62200cad4 clean-up code
* Remove trailing whitespace
  * Converts hard-tabs into two-space soft-tabs
  * Remove consecutive blank lines
2011-10-26 18:46:25 +05:00

30 lines
460 B
Ruby

module Color
def colorize(text, color_code)
"\033[#{color_code}#{text}\033[0m"
end
def red(text)
colorize(text, "31m")
end
def green(text)
colorize(text, "32m")
end
def yellow(text)
colorize(text, "93m")
end
def command(string)
`#{string}`
if $?.to_i > 0
puts red " == #{string} - FAIL"
puts red " == Error during configure"
exit
else
puts green " == #{string} - OK"
end
end
end