[ANN] breakpoint.rb

Moin!

Breakpoint.rb is a small library that lets you set breakpoints by calling a method. When executed, a breakpoint causes an interactive ruby session to be spawned with the current context. This makes it especially useful for debugging because Ruby has powerful built-in capabilities for exploring object environments. (Kernel#caller, Object#inspect, Object#respond_to?, Kernel#local_variables, Object#instance_variables and so on.)

There's also support for overriding return values and for an assert() method that automatically sets a breakpoint in case an unexpected situation occurs.

I wrote this because I constantly found myself placing calls to p() in my code when debugging -- I think that this library is a good replacement for doing that which is the reason of me releasing it.

The code and documentation (including a sample session) is available from the following URL:

http://cb.wardust.net/codepaste/view/paste/54

You'll need to have Binding.of_caller available. It can be obtained at this location:

http://noegnud.sourceforge.net/flgr/binding_of_caller.rb

This should be easier to use than the debug.rb that comes with Ruby, but debug.rb is more powerful overall. (It has stepping capabilities, for example.)

I'm currently overloading IRB.start -- If anybody knows of a better way to spawn an irb session with a custom binding: I'd love to hear about it.

Regards,
Florian Gross

That url is 404. Anyone got a copy of this file before it went AWOL?

···

On Sep 4, 2004, at 10:50 AM, Florian Gross wrote:

You'll need to have Binding.of_caller available. It can be obtained at this location:
http://noegnud.sourceforge.net/flgr/binding_of_caller.rb

You can find both it and breakpoint.rb in this post:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/110881

Alex

···

On Thu, 2004-09-23 at 16:48, Gavin Kistner wrote:

On Sep 4, 2004, at 10:50 AM, Florian Gross wrote:
> You'll need to have Binding.of_caller available. It can be obtained at
> this location:
> http://noegnud.sourceforge.net/flgr/binding_of_caller.rb

That url is 404. Anyone got a copy of this file before it went AWOL?