3

Like in the cucumber tests, there are color-coded outputs... how do I do that?

NullVoxPopuli
  • 61,906
  • 73
  • 206
  • 352
  • 2
    possible duplicate of [Colorized Ruby output](http://stackoverflow.com/questions/1489183/colorized-ruby-output) – Jörg W Mittag Jun 24 '10 at 19:12
  • you're asking about color output to a TTY-style screen, right? The usual output for Rails is web output. To colorize that, use CSS. – Larry K Jun 24 '10 at 21:10

3 Answers3

2

I'm not sure this is from any gem I have, but doing thig will result in purple output.

puts "\e[0;35m this is a purple text \e[0m\n"
Nuno Gonçalves
  • 6,202
  • 7
  • 46
  • 66
2

Do you mean in the context of irb? If so, I'd suggest Wirble to colourize your output.

Govan
  • 913
  • 1
  • 6
  • 7
0
puts "\e[0;31m your text here \e[0m\n"
Tunaki
  • 132,869
  • 46
  • 340
  • 423