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.
- 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 the gem with:
$ gem install wirb
Or add it to your Gemfile:
gem 'wirb'
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.
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.
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)
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 [email protected]