class Byebug::SkipCommand - byebug-11.0.1 Documentation

# 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 41
        def self.description
          <<-DESCRIPTION
            sk[ip]

            #{short_description}
          DESCRIPTION
        end

file_line() click to toggle source

    # File lib/byebug/commands/skip.rb, line 18
    def file_line
      @file_line ||= 0
    end

file_path() click to toggle source

    # File lib/byebug/commands/skip.rb, line 22
    def file_path
      @file_path ||= ""
    end

regexp() click to toggle source

    # File lib/byebug/commands/skip.rb, line 37
    def self.regexp
      /^\s* sk(?:ip)? \s*$/x
    end

restore_autolist() click to toggle source

    # File lib/byebug/commands/skip.rb, line 31
    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 26
    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 49
    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 70
    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 77
    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 53
    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 60
    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 64
    def reset_attributes
      self.class.always_run = 0
      ListCommand.new(processor).execute if self.class.previous_autolist == 1
      self.class.restore_autolist
    end