Class: Debugger::InterruptCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug-ide/commands/control.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, file_filter_supported?, #find, inherited, #initialize, load_commands, #match, method_missing, options, unescape_incoming

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object


122
123
124
125
126
# File 'lib/ruby-debug-ide/commands/control.rb', line 122

def help(cmd)
  %{
    i[nterrupt]\tinterrupt the program
  }
end

.help_commandObject


118
119
120
# File 'lib/ruby-debug-ide/commands/control.rb', line 118

def help_command
  'interrupt'
end

Instance Method Details

#executeObject


110
111
112
113
114
115
# File 'lib/ruby-debug-ide/commands/control.rb', line 110

def execute
  unless Debugger.interrupt_last
    context = Debugger.thread_context(Thread.main)
    context.interrupt
  end
end

#regexpObject


106
107
108
# File 'lib/ruby-debug-ide/commands/control.rb', line 106

def regexp
  /^\s*i(?:nterrupt)?\s*$/
end