Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Hammertime: Ruby Interactive Error Console

By Peter Cooper / January 20, 2010

stophammertime.png 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.

[job] Snapizzi is currently looking for a Ruby and Rails developer to join their team. Alternatively, check out one of the other 11 jobs on our Ruby jobs board!

Comments

  1. Avdi Grimm says:

    Hey, thanks for the coverage! I just want to say that as a side project I don't have a lot of time to work on Hammertime; but I will make an effort to roll in any improvements that people send me. So please, fork it, hack away on it, and send patches/pull requests!

  2. Rails Developer says:

    Thanks for the advise, I overcome this interactive error.

Other Posts to Enjoy

Twitter Mentions