Skip to content

Instantly share code, notes, and snippets.

@blacktm
Created November 25, 2013 04:25
A Ruby class extension to color shell output.
class String
def colorize(c); "\e[#{c}m#{self}\e[0m" end
def error; colorize("1;31") end
def bold; colorize("1") end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment