Class: Byebug::Skipper::FinishsCommand

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

Overview

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject



16
17
18
19
20
21
22
# File 'lib/byebug/skipper/finishs_command.rb', line 16

def self.description
  <<~TXT
    finishs | fins

    #{short_description}
  TXT
end

.regexpObject



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

def self.regexp
  /^ \s* fin(?:ish)?s \s* $/x
end

.short_descriptionObject



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

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

Instance Method Details

#executeObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/byebug/skipper/finishs_command.rb', line 24

def execute
  frame = context.frame

  loop do
    frame = Byebug::Frame.new(context, frame.pos + 1)
    next if frame.c_frame?
    break if out_of_bounds?(frame.pos)
    break if not Byebug::Skipper.skip?("#{frame.file}:#{frame.line}")
  end

  context.step_out(frame.pos, false)
  context.frame = 0
  processor.proceed!
end