mikowitz / color

A simple, flexible gem that provides an open-ended API to print colored and styled output in a terminal.

This URL has Read+Write access

commit  cb99fa8a33197bc2c9b16f6838694f4001438696
tree    093bca0eea9e34b6f9515e03782d0c57d328fdde
parent  e16f3d23a6583b646379e55f9607ee2ee7aa7c9c
color /
name age message
file .document Tue Oct 13 22:31:57 -0700 2009 Initial commit to color. [mikowitz]
file .gitignore Loading commit data...
file LICENSE Tue Oct 13 22:31:57 -0700 2009 Initial commit to color. [mikowitz]
file README.rdoc
file Rakefile
file VERSION
directory lib/
directory spec/
README.rdoc

color

current version : 0.1.1

github.com/mikowitz/color

Description

A simple, flexible gem that provides an open-ended API to print colored and styled output in a terminal.

Installation

Install the gemcutter gem

  ~$ gem install gemcutter

Add gemcutter.org to your gem remote sources

  ~$ gem tumble

Download and install this gem

  ~$ gem install mikowitz-color

Usage examples

To include this gem in a project

  require 'mikowitz-color'

The following are all methods that Color understands, and should give you an idea of what is possible.

  Color.blue("this will be printed as blue text")
  Color.on_red("this will be printed on a red background")
  Color.bold("this will be bold")
  Color.underline_blue_on_yellow("this will be underlined blue text on a yellow background")

The order of elements in the method name is also unimportant. For example

  Color.bold_underline_blue_on_yellow("This should be formatted the same as the line below")

will look the same as

  Color.on_yellow_bold_blue_underline("This should be formatted the same as the line above")

Check out "spec/term_test.rb" and `rake proof` if you don’t believe me.

Copyright

Copyright © 2009 Michael Berkowitz. See LICENSE for details.