Class: Byebug::NextCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/stepping.rb

Overview

Implements byebug “next” command.

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, #print_subcmds, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.help(cmd) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/byebug/commands/stepping.rb', line 41

def help(cmd)
  %{
    n[ext][+-]?[ nnn]\tstep over once or nnn times,
    \t\t'+' forces to move to another line.
    \t\t'-' is the opposite of '+' and disables the force_stepping setting.
  }
end

.help_commandObject



37
38
39
# File 'lib/byebug/commands/stepping.rb', line 37

def help_command
  'next'
end

Instance Method Details

#executeObject



29
30
31
32
33
34
# File 'lib/byebug/commands/stepping.rb', line 29

def execute
  steps, force = parse_stepping_args("Next", @match)
  return unless steps
  @state.context.step_over steps, @state.frame_pos, force
  @state.proceed
end

#regexpObject



23
24
25
26
27
# File 'lib/byebug/commands/stepping.rb', line 23

def regexp
  /^\s* n(?:ext)?
    ([+-])?(?:\s+(\S+))?
    \s*$/x
end