ku1ik / rainbow

Ruby gem for colorizing printed text on ANSI terminals
MIT License
813 stars 68 forks source link

NullPresenter doesn't handle X11 color names #34

Closed michaeljpetter closed 8 years ago

michaeljpetter commented 8 years ago

When an X11 color name method is used, e.g.:

puts Rainbow('something').orange

and the NullPresenter is used, e.g., by redirecting output to /dev/null, then an exception is raised because the NullPresenter doesn't define the X11 color name methods in the same way as the standard presenter.

A work-around is to not use the X11 name methods, but only use the color method, e.g.:

puts Rainbow('something').color(:orange)

but it seems the NullPresenter should handle this.