class PryByebug::Processor
def run(initial = true, &block)
def run(initial = true, &block) return_value = nil command = catch(:breakout_nav) do # Throws from PryByebug::Commands return_value = yield {} # Nothing thrown == no navigational command end times = (command[:times] || 1).to_i # Command argument times = 1 if times <= 0 if [:step, :next, :finish].include? command[:action] @pry = command[:pry] # Pry instance to resume after stepping Byebug.start unless Byebug.started? if initial # Movement when on the initial binding.pry line will have a frame # inside Byebug. If we step normally, it'll stop inside this # Processor. So jump out and stop at the above frame, then step/next # from our callback. @delayed[command[:action]] = times step_out 2 elsif :next == command[:action] step_over times elsif :step == command[:action] step_into times elsif :finish == command[:action] step_out end else stop end return_value end