We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Here is an example of using ANSI via Bezel.
require 'bezel' ANSI_VERSION = '1.2.6' class ColorfulString include lib('ansi', ANSI_VERSION) COLORS = [:red, :yellow, :green, :blue, :magenta] def initialize(string) @string = string reset_colors end def to_s s = "" @string.split(//).each do |c| s << ANSI::Code.send(next_color) + c; end s << ANSI::Code::CLEAR reset_colors return s end def next_color color = @colors.shift @colors << color color end def reset_colors @colors = COLORS.dup end end
ANSI was made Bezel-ready by adding lib/ansi.bezel.
lib/ansi.bezel
module ANSI; end import 'ansi/code' import 'ansi/bbcode' import 'ansi/columns' import 'ansi/diff' import 'ansi/logger' import 'ansi/mixin' import 'ansi/progressbar' import 'ansi/string' import 'ansi/table' import 'ansi/terminal'