This post originated from an RSS feed registered with Ruby Buzz
by Jan Lelis.
Original Post: irbtools / Release the power of irb!
Feed Title: rbJ*_*L.net
Feed URL: http://feeds.feedburner.com/rbJL
Feed Description: Hi, I am a fan of Ruby and like to explore it and the world around ;).
So I started this blog, where I am publishing code snippets, tutorials for beginners as well as general thoughts about Ruby, the web or programming in general.
Equipped with some tools discussed at the germany.rb user group meetup, I’ve played around with my ~/.irbrc and put together a little meta gem for some useful irb tools.
Features
Colorized by wirble and put out as comment by irb_rocket
Nice IRB prompt and IRB’s auto indention (still simple, but still far better than none)
To use it, put the following in your ~/.irbrc file (this file is loaded everytime you start an irb):
require 'rubygems' # only needed in 1.8
require 'irbtools'
If it does not exists, just create a new one.
It’s is possible to modify, which libraries get loaded:
# no require 'irbtools'
require 'irbtools/configure'
# edit the Irbtools.libs array
Irbtools.init
You could also just read and copy the irbtools/configure.rb and irbtools.rb source files, tweak them and use them directly as .irbrc ;)
By the way
Sometimes, you need a clean IRB without all the .irbrc libraries. In such a case, just start irb with the -f option and it will suppress loading the .irbrc.