0.01
Low commit activity in last 3 years
No release in over a year
Add color-coded app and environment information to the Rails console prompt.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

ConsoleColor

ConsoleColor adds the color-coded application name and environment to your Rails console prompt.

By default, the prompt is green in development, red in production, and yellow elsewhere. Alternatively, you can specify a custom color in an initializer (using the bash colorization codes):

ConsoleColor::COLORS['production'] = "\e[35m"  # pink

Note that one can set the CONSOLE_COLOR_ENV var to override the Rails environment:

$ CONSOLE_COLOR_ENV=staging RAILS_ENV=production rails console
app_name:staging>Rails.env
=> "production"

This way you can set your staging Rails env to production to mimic that configuration but have your prompt reflect that you're using on the staging server.

Installation

Add this line to your application's Gemfile:

gem 'console_color'

And then execute:

$ bundle

Or install it yourself as:

$ gem install console_color

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

© Joey Aghion

LICENSE