Class: Byebug::StepCommand

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

Overview

Implements the step functionality.

Allows the user the continue execution until the next instruction, possibily in a different frame. Use step to step into method calls or blocks.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, #match

Methods included from StringFunctions

#camelize, #prettify

Methods included from FileFunctions

#get_line, #get_lines, #n_lines, #normalize

Methods included from ParseFunctions

#get_int, #parse_steps, #syntax_valid?

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



66
67
68
69
70
71
72
# File 'lib/byebug/commands/stepping.rb', line 66

def description
  prettify <<-EOD
    s[tep][ nnn]

    Steps (into methods) once or nnn times.
  EOD
end

.namesObject



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

def names
  %w(step)
end

Instance Method Details

#executeObject



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

def execute
  steps, err = parse_steps(@match[1], 'Steps')
  return errmsg(err) unless steps

  @state.context.step_into(steps, @state.frame)
  @state.proceed
end

#regexpObject



49
50
51
# File 'lib/byebug/commands/stepping.rb', line 49

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