Which one is best for debugging (Pry or Ruby Debug)?

Hi all

I study and understand both the gem , now i am confuse which is one
best.

Let me know which one is best for debugging ?
Is either Pry or Ruby Debug ?
Also explain advantage of your selected gem ?

Thanks

Regards
Fahim Babar Patel

As far as I understood the differences ruby debug just sends you to irb,
while pry sends you to the pry console which has syntax highlight, code
completion and other sugar. But I am not aware of the differences in how
to
use them because I use neither.

Also as far as I know ruby debug doesn’t work with ruby 1.9, bit pry
does.
Am 12.10.2012 12:22 schrieb “Fahim P.” [email protected]:

Thanks for reply.

Still can u tell me which one is best for debuging…

Bye

On Friday, October 12, 2012 8:49:23 PM UTC+5:30, Jordon B. wrote:

all of what IRB does with some enhancements such as tab completion,

Nothing beats throwing binding.pry in the middle of everything and
figuring out what’s going on from a “live” server, such as times when
something is going wrong in a model or controller or a decorator I
will throw a binding.pry in there and visit the page and follow the
tracks all the way down the line until I run into that line that is
causing the problem and then test what fixes it, write a test and fix
the code with the edit command and go on about my day.

As we use binding.pry , but we use same debugger in ruby debugger.
And as per my knowledge debugger do same thing as binding.pry.If not
than
explain ?

Hi,

On Fri, Oct 12, 2012 at 5:22 AM, Fahim P. [email protected] wrote:

Let me know which one is best for debugging ?

Pry is a cross-over REPL (IMO) that replaces IRB and not Ruby
Debugger. I say it’s cross-over because it supports some of what Ruby
Debugger does with addons and sometimes even built and also supports
all of what IRB does with some enhancements such as tab completion,
code spacing and syntax highlighting as well as supporting an easy way
to tap into an object with an REPL easily. There are also other
things like the ability to show the source of a class, a method and
source around where you are (if you are in a method.)

Is either Pry or Ruby Debug ?

It’s too much to compare Pry to Ruby Debugger because nothing can
replace Ruby Debugger in some cases but if you were throw Pry against
IRB for pure Ruby code it’s going to be Pry all the way IMNSHO.

Nothing beats throwing binding.pry in the middle of everything and
figuring out what’s going on from a “live” server, such as times when
something is going wrong in a model or controller or a decorator I
will throw a binding.pry in there and visit the page and follow the
tracks all the way down the line until I run into that line that is
causing the problem and then test what fixes it, write a test and fix
the code with the edit command and go on about my day.

Also explain advantage of your selected gem ?

That’s something you have to figure out for yourself but I listed some
above.

On Friday, 12 October 2012 10:33:05 UTC-5, Fahim P. wrote:

As we use binding.pry , but we use same debugger in ruby debugger.
And as per my knowledge debugger do same thing as binding.pry.If not than
explain ?

They do. But there is a distinction in that one’s only goal is to
debug,
the other is a cross-over tool who is stuck between deciding on if it’s
a
REPL or a debugger. By nature it has debugging tools but by theory it’s
just a more advanced way to test concepts without needing to jump in and
out of the terminal (unless you use VI or other) to test ideas.

Most at #pry will probably not deny that Pry is a Debugger just as they
will most probably not deny that Pry is a REPL which makes it a tranny
(I
had to) cross-over tool. I remember Banister working hard to bring more
debugging tools into Pry but I haven’t talked to him for a while so I
don’t
know if that’s still the case.

So to address your question, I prefer Pry 90% of the time, I test all my
concept code in Pry before writing it so I can work out pieces of the
idea
and make sure they are as bug free as possible without full testing, I
also
use it to debug pieces of code. So hopefully this explains what I mean.

On Friday, October 12, 2012 9:18:57 PM UTC+5:30, Jordon B. wrote:

REPL or a debugger. By nature it has debugging tools but by theory it’s
concept code in Pry before writing it so I can work out pieces of the idea
and make sure they are as bug free as possible without full testing, I also
use it to debug pieces of code. So hopefully this explains what I mean.

Thanks thanks lot for reply…
i will use pry now.
But one question raised when u used this lines, which as follows :-

  1. Pry is a REPL
  2. cross-over tool

What this lines means.

Regards
Fahim Babar Patel

On Friday, 12 October 2012 10:55:58 UTC-5, Fahim P. wrote:

  1. Pry is a REPL
  2. cross-over tool
    What this lines means.

1.) Read-eval-print loop, 2.) Stolen from car marketing (though I have
no
idea if it originates there), basically a cross-over was a mix between
an
SUV/Minivan and a car. In this case Pry is the cross-over it’s a mix
between an REPL and debugger.

Did u have any knowledge related to any deployment tool.

I read article about REPL, i understood.

But what your cross over tool lines says…?

On 12 October 2012 16:48, Jordon B. [email protected] wrote:

just a more advanced way to test concepts without needing to jump in and out
and make sure they are as bug free as possible without full testing, I also
use it to debug pieces of code. So hopefully this explains what I mean.

Jordan, thanks for all the info on pry, I have been contemplating
giving it a go and your posts have encouraged me to get on with it.

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs