user263147
user263147

Reputation: 61

Make pry to skip rails and other gems code

I want to use pry-debugger gem for understanding others people code (rails mostly).
Usually I call binding.pry, then skip-ing repeatedly and watching code it outputs.
Is there a way to make pry skip rails(and other gems) code and show me only local code in rails app directory?
I`ve tried something like this:

while(_dir_ =~ /.rvm/) do step end
while(_dir_ =~ /.rvm/) do _pry_.eval('step') end
_pry_.eval "while(_dir_ =~ /.rvm/) do _pry_.eval('step') end"

But it didn`t work.

Upvotes: 2

Views: 322

Answers (1)

Tom Kadwill
Tom Kadwill

Reputation: 1478

You can't skip Rails code using pry, by default. One way to get around this is to use add breakpoints to jump through different points in your application code.

pry-debugger has a number of break options, eg:

break app/models/user.rb:15    Break at line 15 in user.rb.
break 14                       Break at line 14 in the current file.

Hope this helps!

Upvotes: 1

Related Questions