The Interactive Ruby Shell (irb) and the Rails console are great for interacting and experimenting with your ruby application code, but sometimes it’s hard to visualize the output. Gabriel Horner has come to the rescue with Hirb: a ‘mini view framework’ for irb which is designed to improve the default output to make it more human-readable.
Hirb does this by formatting console output according to its type, and paging if there’s more than a screenful to display. For example, Hirb will automatically display ActiveRecord model instances in a non-wrapping, table-like view.
irb>> Tag.last
+—–+————————-+————-+
| id | created_at | description |
+—–+————————-+————-+
| 907 | 2009-03-06 21:10:41 UTC | blah |
+—–+————————-+————-+
1 row in set
There’s also a helper provided which displays a collection of arrays or hashes as a tree. Read More