Shoes has some built in dump commands (Shoes.debug), but are there other tools that can debug the code without injecting debug messages throughout? Something like gdb would be great.
+2
A:
Have you looked at the ruby-debug gem?
% sudo gem install ruby-debug
The rdebug executable gives you a similar interface to gdb (breakpoint setting, etc). You just simply execute your script with rdebug instead of ruby.
You can also do something like this to avoid manually setting breakpoints:
class Foo
require 'ruby-debug'
def some_method_somewhere
debugger # acts like a breakpoint is set at this point
end
end
Here's a tutorial on ruby-debug: http://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug
Brian Phillips
2008-09-15 15:25:59
How would you do this in Shoes? There's no terminal.
Peeja
2008-12-13 23:43:43
This is useful debugging info, but its not clear how to apply to Shoes.
jrhicks
2009-09-11 03:39:32
+3
A:
The shoes console. Press Alt+/ (or apple+/ on a mac) to see the stack trace of your application.
Drew Olson
2008-09-15 20:47:54
A:
Note that if you use Alt + / you'll have to run that "before" starting the app
rogerdpack
2009-02-27 18:27:44
A:
I was a bit confused about the Apple-/ (or Alt-/) bit mentioned here. What I ended up doing was running ./shoes with no arguments, which popped up the console, then started my app with *./shoes my_app.rb*.
greg
2009-10-25 21:41:02