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, #match

Methods included from StringFunctions

#camelize, #prettify

Methods included from FileFunctions

#get_line, #get_lines, #n_lines, #normalize

Methods included from ParseFunctions

#get_int, #parse_steps, #syntax_valid?

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject


25
26
27
28
29
# File 'lib/byebug/commands/interrupt.rb', line 25

def description
  prettify <<-EOD
    i[nterrupt]  Interrupts the program.
  EOD
end

.namesObject


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

def names
  %w(interrupt)
end

Instance Method Details

#executeObject


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

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

#regexpObject


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

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