colored output

This commit is contained in:
Christian Mehlmauer
2012-09-22 00:13:02 +02:00
parent 3845a35ef9
commit 56613fff8e
3 changed files with 52 additions and 45 deletions

View File

@@ -120,3 +120,10 @@ def banner()
puts
end
end
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def red(text); colorize(text, 31) end
def green(text); colorize(text, 32) end