Some common nice and shiny ansi escape sequences and html format tags for the daily grind in the shell and browser.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Build Status Code Climate


Shiny extends the ruby core string class with two methods, ansi and html. These two are proxy methods to provide a bunch of color and text formating methods. Over ansi there are the commen known ansi escape sequences available, bold, blink, underline and the whole colorful format things. The method html serves the same but in the html way, it makes the standart w3c color names available and also a few other formats like overline, underline, blink etc.


$ gem install shiny


First require it:

require 'shiny'

Some ansi color examples:

puts "magenta".ansi.magenta
puts "bold blue"
puts "yellow on cyan".ansi.yellow.on_cyan
puts "bright blue on green".ansi.bright_blue.on_green
puts "red on bright blue"

Some other ansi effect examples:

puts "bold".ansi.bold
puts "oh! i'm blinking".ansi.blink
puts "nice and underlined".ansi.underline
puts "other side, please".ansi.negative

Some html color examples: (the html formats should be used in the browser ;)

"bold red"
"yellow on olive".html.yellow.on_olive
"blue on teal"

Some other html effect examples:

"oh! i'm blinking".html.blink
"nice and underlined".html.underline

Some terminal helper examples:

include Shiny::Helpers

say("green day?", :color => :green)
say("fail!", :type => :error)

log("for later") # default: logfile.log
log("there please", "myfile.log")

wrap("I'm not alone") # surrounded with the default: # char
wrap("Oh...", "*") # surrounded with the * char

Contributions are very welcome!

  1. Fork shiny
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Send me a pull-request for your topic branch
  5. That's it!


See LICENSE for details. alpha