Skip to content
This repository

Colorizes Ruby inspects / Don't use an irb without wirb!

tree: 9c99bf67ea

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG.rdoc
Octocat-spinner-32 COPYING
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 wirb.gemspec
README.rdoc

Wavy Interactive Ruby

Wirb colorizes your inspected Ruby objects. It is based on Wirble, but only provides result highlighting.

It fixes some displaying bugs and extends the original tokenizer.

Install

Install the gem with:

gem install wirb

Usage

Add to your ~/.irbrc

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

Improvements and fixed Wirble bugs

  • Basic support for regexes (Wirble displayed them as keywords)

  • Support for generic objects, especially sets and enumerators

  • Fixes some symbol bugs (e.g. :+, :*, …)

  • Does not change the inspect value (e.g. ranges with 4 instead of 3 dots)

  • Comes with tests

  • Can be used without irb

Customize

The color schema can be changed with:

Wirb.schema = { :comma => :purple, ... }

Wirb color schemas are (almost) compatible with those from the original Wirble, but there are many extensions. Take a look at wirb/schema.rb or </tt>Wirb.schema</tt> for a list of available token descriptions. See wirb/colors.rb or Wirb::COLORS for the available colors.

Color schemas wanted! You've got a good looking alternative color schema? Please post it on the wiki, it may be bundled with a next version ;)

wp

You can colorize any object with wp (wavy_print):

require 'wirb/wp'
wp some_object
wp some_object, :light_red

Also see

Credits

Copyright © 2011 Jan Lelis <rbjl.net>, see COPYING for details.

Contains code from (and thanks to)

  • Copyright (C) 2006-2009 Paul Duncan <pabs@pablotron.org>

J-_-L

Something went wrong with that request. Please try again.