Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## intro OK, so, with all this talk about GDB and Ruby working together, what about a way to directly insert a call to GDB directly INTO a running Ruby script? Well, with my little Inspector script, that is! ## inspector.rb in your system-wide lib directory (or in the path somewhere) [ruby] trap("INT") do system "gdb ruby #{Process.pid}" end ## just use this when you want to enable the functionality! [ruby] require 'inspector' if $DEBUG ## finally Just call this by pressing C+c anytime when the script is running to jump right into GDB. But, make sure -d is turned on (or you set $DEBUG to true, or just take off that requirement) in your script to actually include the inspector!
This paste will be private.
From the Design Piracy series on my blog: