RAA - ansicolor/1.0.2

ansicolor / 1.0.2

Short description: ansicolor
Category: Library/Term
Status: stable
Created: 2002-07-27 01:49:05 GMT
Last update: 2005-11-12 18:28:14 GMT
Owner: Florian Frank (Projects of this owner)
Homepage: http://term-ansicolor.rubyforge.org
Download: http://rubyforge.org/frs/download.php/7042/term-ansicolor-1.0.2.tgz
License: GPL
Dependency:
None
Description:

Small Ruby library that colors strings using ANSI escape sequences. It's possible to use constants:

include Term::ANSIColor
print red, bold, "red bold", reset, "\n"

Or unary functions:

include Term::ANSIColor
print red(bold("red bold")), "\n"

Blockforms do also autoreset at the block's end:

include Term::ANSIColor
print red { bold { "red bold" } }, "\n"

It's also possible to use this module as Mixin for classes of objects that respond to :to_str, e. g. String.

class String
include Term::ANSIColor
end
print "red bold".red.bold, "\n"

Versions: [1.0.3 (2007-10-05)] [1.0.2 (2005-11-12)] [1.0.1 (2005-09-05)] [1.0.0 (2005-04-15)] [0.0.4 (2004-10-02)] [0.0.3 (2003-10-19)]

Edit this project (for project owner)

back to RAA top