class Byebug::SkipCommand

Allows the user to continue execution until the next breakpoint, as long as it is different from the current one

Attributes

file_line[W]
file_path[W]
previous_autolist[R]

Public Class Methods

description() click to toggle source
# File lib/byebug/commands/skip.rb, line 40
    def self.description
      <<-DESCRIPTION
        sk[ip]

        #{short_description}
      DESCRIPTION
    end
file_line() click to toggle source
# File lib/byebug/commands/skip.rb, line 17
def file_line
  @file_line ||= 0
end
file_path() click to toggle source
# File lib/byebug/commands/skip.rb, line 21
def file_path
  @file_path ||= ""
end
regexp() click to toggle source
# File lib/byebug/commands/skip.rb, line 36
def self.regexp
  /^\s* sk(?:ip)? \s*$/x
end
restore_autolist() click to toggle source
# File lib/byebug/commands/skip.rb, line 30
def restore_autolist
  ListCommand.always_run = @previous_autolist
  @previous_autolist = nil
end
setup_autolist(value) click to toggle source
# File lib/byebug/commands/skip.rb, line 25
def setup_autolist(value)
  @previous_autolist = ListCommand.always_run
  ListCommand.always_run = value
end
short_description() click to toggle source
# File lib/byebug/commands/skip.rb, line 48
def self.short_description
  "Runs until the next breakpoint as long as it is different from the current one"
end

Public Instance Methods

auto_run() click to toggle source
# File lib/byebug/commands/skip.rb, line 69
def auto_run
  return false unless self.class.always_run == 2

  keep_execution ? processor.proceed! : reset_attributes
  true
end
execute() click to toggle source
# File lib/byebug/commands/skip.rb, line 76
def execute
  return if auto_run

  initialize_attributes
  processor.proceed!
  Byebug.stop if Byebug.stoppable?
end
initialize_attributes() click to toggle source
# File lib/byebug/commands/skip.rb, line 52
def initialize_attributes
  self.class.always_run = 2
  self.class.setup_autolist(0)
  self.class.file_path = frame.file
  self.class.file_line = frame.line
end
keep_execution() click to toggle source
# File lib/byebug/commands/skip.rb, line 59
def keep_execution
  [self.class.file_path, self.class.file_line] == [frame.file, frame.line]
end
reset_attributes() click to toggle source
# File lib/byebug/commands/skip.rb, line 63
def reset_attributes
  self.class.always_run = 0
  ListCommand.new(processor).execute if self.class.previous_autolist == 1
  self.class.restore_autolist
end