Class: Byebug::InterruptCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/interrupt.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



20
21
22
# File 'lib/byebug/commands/interrupt.rb', line 20

def description
  %{i|nterrupt\t interrupt the program}
end

.namesObject



16
17
18
# File 'lib/byebug/commands/interrupt.rb', line 16

def names
  %w(interrupt)
end

Instance Method Details

#executeObject



10
11
12
13
# File 'lib/byebug/commands/interrupt.rb', line 10

def execute
  context = Byebug.thread_context(Thread.main)
  context.interrupt
end

#regexpObject



6
7
8
# File 'lib/byebug/commands/interrupt.rb', line 6

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