Liminal Existence


irb is a wonderful tool; with a few tweaks and additions, though, it becomes essential. I spent too long getting by with just readline support, but today, finally, I added a few of the extensions that I’ve seen floating around on various ruby blogs. Now my tab completion and history run in overdrive, and the number of extra terminal windows I keep open has been reduced greatly. A quick summary of the features present:
  • Full readline support and tab completion
  • Copy-friendly prompt
  • Auto-indentation
  • Persistent history
  • Object#local_methods, to view methods unique to an object
  • Colourized output (via wirble)
  • Method finder. e.g., "hello".what?(5) #=> [:length, :size]
  • Colourized inline ri support (either Object#ri(*methods) or ri Object, works best with Ruby 1.8.5’s much improved ri
  • Output spooling, via more, less or most. e.g., less { puts really_long_string }
  • Simple regular expression helper (/an/.show_match("banana"))
  • Textmate and Vi launching
You can get my .irbrc here: ~lattice/.irbc.