The WIRB gem syntax highlights Ruby objects. Works best as your default REPL inspector (see usage section below), but does not require IRB.
Supported Rubies: 2.7, 2.6, 2.5, 2.4
Older Rubies, should work: 2.3, 2.2, 2.1, 2.0, rubinius
Ancient Rubies (1.9, 1.8): Please use WIRB 1.0
- Syntax highlighting for inspected Ruby objects
- No monkey patches anywhere
- Support for generic objects, especially enumerators, and nested generic objects
- Supports common standard library objects, like
- Color schemas customizable via YAML
Install the gem with:
$ gem install wirb
Or add it to your Gemfile:
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
require 'wirb' .
Another way would be to use Irbtools, which activate WIRB automatically.
WIRB comes with a pretty printing utility (similar to awesome_print):
require 'wirb/wp' wp some_object
These are the bundled color schemas. You can load one with
:colorless(only uses :bright, :underline and :inverse effect)
:ultra(by @venantius, matches the colorscheme from Ultra over in Clojure-land)
Usage with Rails
If you run into problems using WIRB with Rails, try the solution in this issue.
- Gem that allows you to configure views for specific objects: hirb
- WIRB is part of: Irbtools
- More about terminal colors: Paint
Copyright (c) 2011-2019 Jan Lelis https://janlelis.com see COPYING for details.