Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
ripl plugin to colorize errors
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/ripl
.gemspec
CHANGELOG.rdoc
LICENSE.txt
README.rdoc
Rakefile
deps.rip

README.rdoc

Description

This ripl plugin allows you to color errors in the console.

Install

Install the gem with:

sudo gem install ripl-color_error

Usage

Add to your ~/.riplrc

require 'ripl/color_error'

By default this plugin uses red. But say you want to configure it to blue:

# after the above require
Ripl.config[:color_error] = :blue

While in the console you can change colors as desired:

$ ripl
>> Ripl.config[:color_error] = :blue
=> :blue

# To turn off coloring
>> Ripl.config[:color_error] = false

# If you know your ansi escape codes
>> Ripl.config[:color_error] = '34;1'
=> '34;1'

# See available predefined colors
>> Ripl::ColorError::COLORS

To explore ansi escape codes, see here. With the correct code you can bold, underline, add a background color …

Something went wrong with that request. Please try again.