ANSI 1.3.0 has been released.
The ANSI project is a collection of ANSI escape code related libraries
enabling ANSI code based colorization and stylization of output. It is
very nice for beautifying shell output.
This release cleans up the Code module. It adds support for x-term 256
color codes. Also, the Diff class is now awesome, making use of an LCS
algorithm. But the most important difference with this release is that
the String core extensions are in their own file, core.rb. If you want
to use them you will need to require ansi
or ansi/core
.
Changes:
- Clean-up Code module.
- Utilize common chart for Code methods.
- Constants now have their own module.
- Move core methods to
ansi/core.rb
.
- Add XTerm 256 color code support.
- Improved Diff class with LCS algorithm.
Looks nice. I will test it in the coming days.
I am using Florian’s ANSIColour so far.
http://flori.github.com/term-ansicolor/
While it is also very nice, it kind of has become a little bit messy the
way I use it, so I am looking for another way out of my messy code (all
my projects that give colourized feedback to the shell use it so far).
puts “red bold”.red.bold
Felt very natural for me.
Just checked and found a missing Link.
https://github.com/rubyworks/ansi/download
^^^ Does not work.
Can be found on:
http://rubyworks.github.com/ansi/#
Using just:
GitHub - rubyworks/ansi: Set of ANSI Code based classes and modules for Ruby
Works, I suppose, at least you can then click on the “download” button.
EDIT: I also have a problem to get it to run.
require ‘ansi/code’
=> true
include ANSI::Code
=> Object
red + “Hello” + blue + “World”
NoMethodError: undefined method +' for nil:NilClass from /Programs/Ruby/1.8.7p334/lib/ruby/site_ruby/1.8/ansi/code.rb:158:in
method_missing’
from (irb):15
str = ANSI::Code.red + “Hello” + ANSI::Code.blue + “World”
NoMethodError: undefined method +' for nil:NilClass from /Programs/Ruby/1.8.7p334/lib/ruby/site_ruby/1.8/ansi/code.rb:158:in
method_missing’
from (irb):18
ANSI::Code.red
=> nil
I don’t know why this happens right now. Perhaps it interferes with
some other class I may be using?
ANSI::Code.red returns nil.
I will look into this tomorrow (after I slept) more closely, good night
for today!
Marc H. wrote in post #1008520:
Just checked and found a missing Link.
https://github.com/rubyworks/ansi/download
^^^ Does not work.
https://github.com/rubyworks/ansi/downloads
Missing a “s” on the URL.
–
Luis L.