views:

797

answers:

2

hi is there a ruby modul for colorize strings in a linux terminal?

+5  A: 

ehm ok google was my friend :)

http://term-ansicolor.rubyforge.org/

gustavgans
+1  A: 

I prefer the Rainbow gem since it also supports Windows if win32console gem has been installed.

You can use it like this:

puts "some " + "red".color(:red) + " and " + "blue on yellow".color(:blue).background(:yellow)
Andy