ruby execution

S

Sumanta Das

can i execute ruby program step by step?
like c language.....pressing F7... i can debug my program.
is there any way to do the same?
thanx
 
P

Phillip Gawlowski

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sumanta Das wrote:
| can i execute ruby program step by step?
| like c language.....pressing F7... i can debug my program.

That is not a feature of C, but the IDE you are using.

| is there any way to do the same?

Yes, actually.

gem install ruby-debug

Here's a quick screencast introducing ruby-debug.

If you have ever used it, it is similar to gdb.

- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan

~ How many boards would the Mongols hoard if the Mongol hordes got bored?
-- Calvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgDDicACgkQbtAgaoJTgL8icQCfYfcQhjrlfWNlRv87P0KVSv9z
xPAAn1nDRy7QYoq9aug8jSI0kFJ4KEqJ
=mq/p
-----END PGP SIGNATURE-----
 
T

Tim Hunter

Sumanta said:
can i execute ruby program step by step?
like c language.....pressing F7... i can debug my program.
is there any way to do the same?
thanx

ruby -r debug mypgm.rb

Type h at the prompt for help.
 
V

Victor Reyes

[Note: parts of this message were removed to make it a legal post.]

But, is there a way to "debug" just within a particular method? That way one
can skip the rest of the code, which we know "works" fine.

Thanks

Victor
 
V

Victor Reyes

[Note: parts of this message were removed to make it a legal post.]

I followed the link. Thanks for the info!
 
M

Michael Brooks

Jim said:
Sorry for the side track, but how good/complete is the Linux version of
this IDE (for anyone who knows)?


Thanks.

Hello Jim:

I can't speak to the Linux version because I've only tried (and
purchased) the Windows version which is very good. I'm coming from
Delphi so something like this IDE really eases the shock. The only
significant thing missing compared to Delphi is a GUI builder but I can
understand why because there are so many GUI choices for Ruby (I'm
partial to wxRuby).

Might I suggest you download the 20 day trial of the Linux version of
Arachno Ruby and try it out. There support is good too... I had some
really stupid questions during the trial and they politely answered all
of them.

Michael
 
J

Jim Cochrane

Hello Jim:

I can't speak to the Linux version because I've only tried (and
purchased) the Windows version which is very good. I'm coming from
Delphi so something like this IDE really eases the shock. The only
significant thing missing compared to Delphi is a GUI builder but I can
understand why because there are so many GUI choices for Ruby (I'm
partial to wxRuby).

Might I suggest you download the 20 day trial of the Linux version of
Arachno Ruby and try it out. There support is good too... I had some
really stupid questions during the trial and they politely answered all
of them.

Thanks, Michael, for the suggestion. I'll consider checking out the
trial version when I've "gotten back into Ruby learning mode". (I
started studying Ruby over a year ago, got sidetracked by a Perl job,
and want to get back into learning Ruby, hopefully soon.)


--
 
T

Tom Cloyd

Victor said:
But, is there a way to "debug" just within a particular method? That way one
can skip the rest of the code, which we know "works" fine.
[snip]

Sure. Having recently learned the wonders of ruby-debug, I can tell you
this: you can set a breakpoint in the method, then step through it from
that point on, examining variables (and doing a lot of other useful
things) to your hearts content. When ready, you can resume regular
execution. Very nicely set up, I think you'll find. And...it's all
command line stuff.

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 & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
T

Tom Cloyd

Jim said:
Thanks, Michael, for the suggestion. I'll consider checking out the
trial version when I've "gotten back into Ruby learning mode". (I
started studying Ruby over a year ago, got sidetracked by a Perl job,
and want to get back into learning Ruby, hopefully soon.)
Consider also trying the "community" (free) version - which is full
featured - of the Aptana Studio ide - it's a full spectrum Ajax-Rails
etc. development environment, which encompasses ruby and ruby debugging
etc. It's also java, so it's big (but also obviously cross-platform). I
have been using it off and on for some time, and it's very nice.
Excellent support from the developers, too - very good forums. Still in
development, but definitely far along and quite impressive.

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 & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

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
474,291
Messages
2,571,455
Members
48,132
Latest member
KatlynC08

Latest Threads

Top