JustAnsi
Simple and fast ANSI control code processing.
Description
JustAnsi provides a rich set of methods to generate ANSI control codes for attributes, colors, cursor movement and much more. It supports most control codes, all attributes, 3/4bit-, 8bit- and 24bit-colors.
hello = JustAnsi.decorate('Hello World!', :bold, :red)
JustAnsi.undecorate(hello)
JustAnsi.bbcode('[b]Hello [red]World[/fg]![/b]')
Help
📕 See the online help and have a look at the examples directory.
Run Examples
You can execute the examples by
ruby ./examples/bbcode.rb
Installation
You can install the gem in your system with
gem install just-ansi
or you can use Bundler to add JustAnsi to your own project:
bundle add just-ansi
After that you only need one line of code to have everything together
require 'just-ansi'