Class: Byebug::Skipper::DownsCommand

Inherits:
Command
  • Object
show all
Includes:
Helpers::FrameHelper
Defined in:
lib/byebug/skipper/downs_command.rb

Overview

this class is partially copy/pasted from Byebug::DownCommand

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject



16
17
18
# File 'lib/byebug/skipper/downs_command.rb', line 16

def self.description
  short_description
end

.regexpObject



8
9
10
# File 'lib/byebug/skipper/downs_command.rb', line 8

def self.regexp
  /^ \s* downs \s* $/x
end

.short_descriptionObject



12
13
14
# File 'lib/byebug/skipper/downs_command.rb', line 12

def self.short_description
  "Same as `down` but skips garbage frames, e.g. from gems"
end

Instance Method Details

#executeObject



20
21
22
23
24
25
26
27
28
# File 'lib/byebug/skipper/downs_command.rb', line 20

def execute
  loop do
    break if out_of_bounds?(context.frame.pos - 1)
    jump_frames(-1)
    break if not Byebug::Skipper.skip?(context.location)
  end

  Byebug::ListCommand.new(processor).execute if Byebug::Setting[:autolist]
end