Stepping Through Ruby

M

Mike Stephens

In VBA you can step through the code and at any point examine all the
state. Is there any similar facility for Ruby?
 
T

Tom Cloyd

Ben said:
There is a debugger for ruby which you use through the shell. There's a
pretty good run through of it over at railscasts.com:

http://railscasts.com/episodes/54-debugging-with-ruby-debug

Take a look.

Ben
and...unfortunately, the gem version of it - ruby-debug, which is much
more usable than the built in version, doesn't work with 1.9. Sigh.

t.

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< (e-mail address removed) >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
J

John Wells

In VBA you can step through the code and at any point examine all the
state. Is there any similar facility for Ruby?

In addition to ruby-debug, Netbeans, RubyMine and Eclipse (via Aptana)
all provide this capability.

John
 
M

Michal Suchanek

2009/6/18 John Wells said:
In addition to ruby-debug, Netbeans, RubyMine and Eclipse (via Aptana)
all provide this capability.

Perhaps I should install one of those and try them out?

But seriously, I have not really longed for this feature recently.

I sometimes use gdb for C code because it's harder to add debugging
output there with all the recompilation and stuff. However, I have
observed that machine instructions are apparently small enough that
the principle of uncertainty known from the quantum theory applies. By
observing your code with a debugger you may cause it to behave
differently than how it behaves otherwise. These cases are quite rare
but the more insidious are the resulting problems.

In theory you write tests for your code and if fitting multiple pieces
together fails you write more tests that cover more cases, perhaps
ones that were uninteresting previously but became some sort of
turning points when multiple pieces of code interact.

As you might not see because I haven't published my code I have not
written the tests so I ended up writing ad-hoc tests for cases that
fail and debug those which is somewhat harder after the fact. Having
the tests ready would certainly make it easier to understand how
things fail, probably even more so than having a debugger.

Thanks

Michal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top