deivid-rodriguez/pry-byebug

Question on invoking pry debugging commands manually via method

alexevanczuk opened this issue · 0 comments

Hi --
I frequently want to do something where I have a method that when called, breaks me out of my pry and runs a number of commands. For example, if I know that the next series of calls are skippable, I might have a method:

def skip_calls
  next 5
  step 2
  next 8
  step 1
  next
end

However, this doesn't work, since the next command and others only exist when the pry console is open. I've tried using something like:

PryByebug::ContinueCommand.new(target: binding).process

But this doesn't seem to work (it needs a lot of additional context when initializing the parent pry command.

I've also tried _pry_.eval('next'), but when I call a method that references _pry_, it says _pry_ does not exist. Is there a recommended way to accomplish this?

Thanks!
Alex