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.

Thanks for reply.

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

Bye

Hi,

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.

Hi,

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.

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.

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

I read article about REPL, i understood.

But what your cross over tool lines says…?

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.

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

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