0.0
The project is in a healthy, maintained state
A simple gem to colorize your console output
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

PrettyConsole

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

Use

puts_in_< color >

PrettyConsole.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 >

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

prints the following with standard system font $${\color{green} =====&gt;\space Some\space wording\space&lt;=====}$$

print_in_< color >

PrettyConsole.print_in_<color>('x')

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

say_with_color_background

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

announce_task

desc 'your task'
task your_task: :environment do |task|
  PrettyConsole.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