Hammertime: Ruby Interactive Error Console
Hammertime (GitHub repo) is a new interactive error console for Ruby by Avdi Grimm, modelled after those found in the Squeak/Smalltalk and LISP environments. It fills some of the same roles as ruby-debug, except in a less intrusive and more Ruby-esque fashion. Be warned though.. currently it's for Ruby 1.8.x only.
Installation is via RubyGems (
gem install hammertime) and the library is activated in your app with
require 'hammertime'. That's it; you're good to go. Once activated, any exception raised in your app will result in a Hammertime prompt appearing where you can choose from a number of options, including:
- Continue (process the exception normally)
- Ignore (proceed without raising an exception)
- Permit by type (don't ask about future errors of this type)
- Permit by line (don't ask about future errors raised from this point)
- Backtrace (show the call stack leading up to the error)
- Debug (start a debugger)
- Console (start an IRB session)
For more info, a walkthrough of a basic debugging process using Hammertime is shown in Avdi's Hammertime blog post. I get a feeling that if this is refined with the extra features Avdi's planning (such as making retries easier from the console and, perhaps, support for exceptions raised in native code) and Ruby 1.9 support is added, Hammertime could become a standard debugging tool in any good Rubyist's toolbox.