Module: Kernel

Defined in:
lib/byebug.rb

Instance Method Summary collapse

Instance Method Details

#byebug(steps = 1) ⇒ Object Also known as: breakpoint

Enters byebug after steps line events occur.

Before entering byebug startup, the init script is read. Setting steps to 0 will cause a break in byebug’s subroutine and not wait for a line event to occur. You will have to go “up 1” in order to be back to your debugged program from byebug. Setting steps to 0 could be useful if you want to stop right after the last statement in some scope, because the next step will take you out of some scope.



259
260
261
262
263
264
265
266
267
# File 'lib/byebug.rb', line 259

def byebug(steps = 1)
  Byebug.start
  Byebug.run_init_script(StringIO.new)
  if 0 == steps
    Byebug.context.step_out
  else
    Byebug.context.step_into steps
  end
end