Wouldn't it be great if I can set breakpoints right from within TextMate? I've been thinking about this myself for sometime.
And now I'd like to introduce a new Ruby Debug Bundle.
Note that in order to use it you must have the latest version (0.4.1 or higher) of ruby-debug installed.
How to use it?
Let's say you want to debug your Rails application.
Start your application with the remote debugging enabled:
$ rdebug -sn ./script/server webrickConnect to the debugger (in new terminal):
$ rdebug -c Connected.In TextMate go to the line where you want to set a breakpoint and press ⇧⌘B and select Set Breakpoint at Current Line.
Open your browser and start using your application until you reach the breakpoint.
That's it.
Currently, these commands are available:
- Set Breakpoint at Current Line
- Delete All Breakpoints.
- Show Breakpoints - show all breakpoints as a tooltip.
- Interrupt - interrupt the last debugged thread or, if there is no one, the main thread.
- Quit - quit application.
Kent,
I’m finally getting to try it today. This is really cool and once again you do marvels!
The one thing I can suggest to improve the bundle would be to change the default shortcut (I’m trying cmd-option-shift-B) as I’m quite fond of cmd-shit-B to select the characters enclosed withing (), {} or [].
The link to the textmate bundle seems to be broken.
Great work on ruby-debug!
Thanks, fixed.
This a great bundle. Have you thought about getting it up on http://macromates.com/svn/Bundles/trunk/Bundles/? Many of us pull our bundles directly from there.
I can't get this to quite work with Rails 2.0.2. Setting breakpoints seems OK - but not showing or clearing them. Is this bundle supposed to be compatible with Rails 2.0.2??
I get the same results as AndyL.. Also, my startup script required me to run without the 'n' option: rdebug -s ./script/server
Same problem! Am able to do everything except getting the execution to stop at the breakpoint! Any ideas anyone?