Module | ANSI::Code |
In: |
lib/ansi/code.rb
|
ANSI Codes
Ansi::Code module makes it very easy to use ANSI codes. These are esspecially nice for beautifying shell output.
Ansi::Code.red + "Hello" + Ansi::Code.blue + "World" => "\e[31mHello\e[34mWorld" Ansi::Code.red{ "Hello" } + Ansi::Code.blue{ "World" } => "\e[31mHello\e[0m\e[34mWorld\e[0m"
IMPORTANT! Do not mixin Ansi::Code, instead use {ANSI::Mixin}.
See {ANSI::Code::CHART} for list of all supported codes.
Like move but returns to original positon after yielding the block.