May 07, 2007 at 17:49 Tags Ruby

irb(main):001:0> some_object.

irb -r irb/completion

irb is the interactive Ruby shell - an incredibly useful tool during development. Lisp folks are proud of the REPL (Read-Evaluate-Print Loop) - well, irb is REPL for Ruby. What turns irb into an even more useful instrument, however, is tab completion. First, it makes coding quicker by completing known symbols (kind of an Intellisense, if you'd like). Second, and more importantly, it allows you to quickly see which methods are implemented for objects, by typing:And pressing TAB twice, irb will list all the methods. For some reason, however, irb doesn't come with tab completion out of the box. To set it up, you can create a batch file called irbb.bat, for instance, which calls:And call that instead of irb. A simpler method, IMHO, is directly edit the irb.bat file in the Ruby installation bin/ directory toirb/completion. P.S: I describe Windows solutions. It should be very similar for Linux.