Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

ripl plugin to colorize errors

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gemspec
Octocat-spinner-32 CHANGELOG.rdoc
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 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.