Class: Byebug::InterruptCommand

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

Overview

Interrupting execution of current thread.

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



23
24
25
# File 'lib/byebug/commands/interrupt.rb', line 23

def description
  %(i|nterrupt        Interrupts the program.)
end

.namesObject



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

def names
  %w(interrupt)
end

Instance Method Details

#executeObject



13
14
15
16
# File 'lib/byebug/commands/interrupt.rb', line 13

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

#regexpObject



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

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