Project

wirb

No release in over 3 years
WIRB adds syntax highlighting for inspected Ruby objects - from core and default gems
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
~> 1.6
>= 0
~> 13.2
~> 3.13

Runtime

>= 0.9, < 4.0
 Project Readme

WIRB Interactive Ruby version

The WIRB gem adds syntax highlighting to inspected Ruby objects. It covers core Ruby classes/modules and most of standard library. Works best as your default REPL inspector, but also works without IRB.

Supports Ruby 3.x and 4.0.

Please note that WIRB also works well for Ruby 1 and Ruby 2 - just install the latest WIRB version possible to install.

Features

  • Syntax highlighting for inspected Ruby objects
  • Support for generic objects, especially enumerators, and nested generic objects
  • Supports common standard library objects
  • Color schemas customizable via YAML

Install

Install the gem with:

$ gem install wirb

Or add it to your Gemfile:

gem 'wirb'

Usage

To start IRB with WIRB activated for one session, do:

$ irb -r wirb --inspect wirb

To activate WIRB permanently, you can add this to the ~/.irbrc file:

require 'wirb'
Wirb.start

Another way would be to use Irbtools, which activates WIRB automatically.

Kernel#wp

WIRB comes with a pretty printing utility:

require 'wirb/wp'
wp some_object

Other than similar tools like pp or awesome_print, it will not change the format the highlighted objects by adding whitespace, but only adds colors.

Bundled Schemas

These are the bundled color schemas. You can load one with Wirb.load_schema(:name)

  • :classic (default)
  • :colorless (only uses :bright, :underline and :inverse effect)
  • :ultra (by @venantius, matches the colorscheme from Ultra over in Clojure-land)

Also See

Credits

Copyright (c) 2011-2025 Jan Lelis https://janlelis.com see COPYING for details.

First tokenizer version was based on the wirble gem: Copyright (C) 2006-2009 Paul Duncan pabs@pablotron.org

All contributors