Monday, December 08, 2008

color-block 0.2.0 released

Several weeks ago I made color-block available on github. This is a small library to colorize ruby output. Specifically I wanted to colorize my rake output. In some rake tasks, I didn't have access to the details of the task. So I couldn't add color to each string. Instead color-block allows me to colorize an entire block of code.

Several friends have tested color-block on Windows, Linux and Apple Mac.

require 'color-block'
include ColorBlock

color( :blue ) { "everything in this block is blue!" }

color( :white, :blue ) do
puts "now everything is white on blue!"
color( :green, :black ) { "nesting is supported" }

color( :white, :black, :bold ) { "third parameter to specify :bold or :dim" }

No comments: