byebug, next into application code only

2019-07-20 03:05发布

问题:

When I press n (or type next) in a Rails app, very often I get into a gem's methods that I'm not interested in, and I have to press n lots of times just to continue execution.

Is there a way, beside filling my code with byebug calls, to just stay in my app's frames? Any tips?

回答1:

I use c n to continue to a particular line n. Byebug will run at full-speed, then stop at the line you gave it. That means that gems or not, they won't be noticed by you as they'll be processed at high-speed.

The built-in help says:

(byebug) help continue
c[ont[inue]][ nnn]

Run until program ends, hits a breakpoint or reaches line nun