Class: Byebug::StepCommand

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

Overview

Implements byebug “step” 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



74
75
76
77
78
79
80
# File 'lib/byebug/commands/stepping.rb', line 74

def help(cmd)
  %{
    s[tep][+-]?[ nnn]\tstep (into methods) 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



70
71
72
# File 'lib/byebug/commands/stepping.rb', line 70

def help_command
  'step'
end

Instance Method Details

#executeObject



62
63
64
65
66
67
# File 'lib/byebug/commands/stepping.rb', line 62

def execute
  steps, force = parse_stepping_args("Step", @match)
  return unless steps
  @state.context.step steps, force
  @state.proceed
end

#regexpObject



56
57
58
59
60
# File 'lib/byebug/commands/stepping.rb', line 56

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