RAA - ansicolor

ansicolor / 1.0.5

Short description: Display ANSI color sequences in your console
Category: Library/Term
Status: stable
Created: 2002-07-27 01:49:05 GMT
Last update: 2010-03-12 00:39:34 GMT
Owner: Florian Frank (Projects of this owner)
Homepage: http://flori.github.com/term-ansicolor
Download: http://www.ping.de/~flori/term-ansicolor-1.0.5.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.5 (2010-03-12)] [1.0.4 (2009-07-23)] [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