Skip to content

Instantly share code, notes, and snippets.

@bluerabbit
Created February 27, 2013 03:59
Show Gist options
  • Select an option

  • Save bluerabbit/5044943 to your computer and use it in GitHub Desktop.

Select an option

Save bluerabbit/5044943 to your computer and use it in GitHub Desktop.
rubyで標準出力に色付けるやつ
class String
def colorize(color_code); "\e[#{color_code}m#{self}\e[0m"; end
def red; colorize(31); end
def yellow; colorize(33); end
def pink; colorize(35); end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment