Wavy Interactive Ruby

Wirb colorizes your inspected Ruby objects. It is based on Wirble, but only provides and improves result highlighting. It also provides a colorization engine abstraction layer and offers flexible schemas using yaml. Wirb is part of the irbtools suite.

Install

Install the gem with:

gem install wirb

Usage

Add to your ~/.irbrc

require 'rubygems' unless defined? Gem
require 'wirb'
Wirb.start

Features

Colors

To only tweak some colors, take a look at the Wirb.schema hash. To use a custom schema, inspect the yaml files in the data/wirb/ directory. You can create your own schema and load it using Wirb.load_schema(path_to_yaml_file). Alternatively, you can use one of the bundled ones by passing a symbol instead of a path.

Colorizer

Wirb supports multiple colorization engines. Available engines can be found in lib/wirb/colorizer/*. Some of them require external gems as dependencies (e.g. HighLine). The current default engine is Paint. You can change the colorizer using:

Wirb.load_colorizer :Paint # or :HighLine or whatever

Be careful, though! You also need to select a color schema that supports your colorizer (Schemas define supported colorizers using the :colorizer key). Load a schema with:

Wirb.load_schema! :classic_paint # make sure your colorizer is paint

You can automatically use the first colorizer of the schema by using the non-exclamation mark version:

Wirb.load_schema :classic_paint # will fail if paint is not installed

Color schemas wanted! You've got a good looking alternative color schema? Please fork and add it to data/wirb/* :)

Colorizers wanted! Your favorite terminal colors gem is not supported yet? Please fork and add it to lib/wirb/colorizer/* :D

Bundled schemas

The following schemas are bundled (load with Wirb.load_schema :name and make sure the used colorizer is available).

Wirb0

Paint

wp

You can colorize any object with wp (wavy_print):

require 'wirb/wp'
wp some_object

Also see

Todo

Credits

Contributions by and thanks to:

Influenced by code from and thanks to:

J-_-L