[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby execution

Sumanta Das

4/14/2008 7:39:00 AM

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
--
Posted via http://www.ruby-....

11 Answers

Phillip Gawlowski

4/14/2008 7:56:00 AM

0

-----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....

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

Tim Hunter

4/14/2008 11:32:00 AM

0

Sumanta Das wrote:
> 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.

--
RMagick: http://rmagick.ruby...
RMagick 2: http://rmagick.ruby...rmagick2.html

Victor Reyes

4/14/2008 1:51:00 PM

0

[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

On Mon, Apr 14, 2008 at 7:31 AM, Tim Hunter <TimHunter@nc.rr.com> wrote:

> Sumanta Das wrote:
>
> > 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.
>
> --
> RMagick: http://rmagick.ruby...
> RMagick 2: http://rmagick.ruby...rmagick2.html
>
>

Tim Hunter

4/14/2008 2:03:00 PM

0

Victor Reyes wrote:
> 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

That appears to be a feature of the ruby-debug library. A quick Google
"ruby-debug" found this page:
http://www.datanoise.com/articles/2006/7/12/tutorial-on-....
--
Posted via http://www.ruby-....

Victor Reyes

4/14/2008 6:09:00 PM

0

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

I followed the link. Thanks for the info!

On Mon, Apr 14, 2008 at 10:02 AM, Tim Hunter <rmagick@gmail.com> wrote:

> Victor Reyes wrote:
> > 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
>
> That appears to be a feature of the ruby-debug library. A quick Google
> "ruby-debug" found this page:
> http://www.datanoise.com/articles/2006/7/12/tutorial-on-....
> --
> Posted via http://www.ruby-....
>
>

Michael Brooks

4/15/2008 2:09:00 AM

0

Sumanta Das wrote:
> 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

Hello Sumanta:

In addition to the other good suggestions made by others, you may want
to consider purchasing a ruby specific IDE that supports debugging such
as Arachno Ruby:

http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_...

Michael

Jim Cochrane

4/15/2008 2:20:00 AM

0

On 2008-04-15, Michael Brooks <michael.brooks@shaw.ca> wrote:
> Sumanta Das wrote:
>> 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
>
> Hello Sumanta:
>
> In addition to the other good suggestions made by others, you may want
> to consider purchasing a ruby specific IDE that supports debugging such
> as Arachno Ruby:
>
> http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_...
>
> Michael

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


Thanks.

--

Michael Brooks

4/15/2008 4:02:00 AM

0

Jim Cochrane wrote:
> On 2008-04-15, Michael Brooks <michael.brooks@shaw.ca> wrote:
>> Sumanta Das wrote:
>>> 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
>> Hello Sumanta:
>>
>> In addition to the other good suggestions made by others, you may want
>> to consider purchasing a ruby specific IDE that supports debugging such
>> as Arachno Ruby:
>>
>> http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_...
>>
>> Michael
>
> 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

Jim Cochrane

4/16/2008 10:34:00 PM

0

On 2008-04-15, Michael Brooks <michael.brooks@shaw.ca> wrote:
> Jim Cochrane wrote:
>> On 2008-04-15, Michael Brooks <michael.brooks@shaw.ca> wrote:
>>> Sumanta Das wrote:
>>>> 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
>>> Hello Sumanta:
>>>
>>> In addition to the other good suggestions made by others, you may want
>>> to consider purchasing a ruby specific IDE that supports debugging such
>>> as Arachno Ruby:
>>>
>>> http://www.ruby-ide.com/ruby/ruby_ide_and_ruby_...
>>>
>>> Michael
>>
>> 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.

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.)


--

Tom Cloyd

4/17/2008 1:51:00 AM

0

Victor Reyes wrote:
> 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
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~