P O W !
Override your ‘puts’ for fun shell coloring.
Install (with gemcutter as sauce):
sudo gem install jamescook-pow
Usage:
require "pow"
Examples:
puts.yellow "Hello world in yellow"
puts.red "Hello world in red"
puts.red! "Hello world in red, but with boldness"
puts.red_ "Hello world in red, but with underscore"
puts.rainbow "Hello world, but more silly."
puts_ "Hello world, underscored."
puts! "Hello world, bold."
puts "Hello world, and I can highlight matches.", :match => "can"
puts "Hello world, and I can highlight matches with a specific color.", :match => "can", :match_color => :purple
p.red "Hello world, but less typing .. also red."
p! "Hello world, in bold"
p! "Mix and match", :color => :purple, :background => :black
You can also set defaults in your ~/.irbrc or wherever.
require 'pow'
Pow.defaults = {:bold => true} # Now any puts will default to bold
There’s a script included that you can pipe text into and output customized text:
cat README | ruby bin/ruby-pow --bold --background=purple