PrettyConsole

PrettyConsole adds colors to your console using the bash colorization codes.

Usage

puts_in_< color >

self.puts_in_green('Some wording')

prints the following with standard system font $$\color{green Some\space wording}$$

Colors

where 'green' is a < color > that might be replaced with the following colors :

  • red,
  • green (as used)
  • yellow
  • blue
  • purple
  • cyan
  • heavy_white
  • and green

say_in_< color >

self.say_in_<color>('Some wording')

prints the following with standard system font $$\color{green =====>\space Some\space wording\space<=====}$$

self.print_in_<color>('x')

prints the following with standard system font $$\color{greenx}$$

say_with_color_background

self.say_with_<color>_background('Some wording')

announce_task

desc 'your task'
task your_task: :environment do |task|
  self.announce_task(task or string) do
    ...your task code
  end
end
  • prints a colored header with the task name and a footer
  • it displays the time elapased inside the block

Installation

Add this line to your application's Gemfile:

gem 'pretty_console'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pretty_console

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

© Etienne Weil

LICENSE