lib/byebug/commands/interrupt.rb in byebug-5.0.0 vs lib/byebug/commands/interrupt.rb in byebug-6.0.0
- old
+ new
@@ -4,25 +4,27 @@
#
# Interrupting execution of current thread.
#
class InterruptCommand < Command
self.allow_in_control = true
- self.allow_in_post_mortem = false
- def regexp
- /^\s*i(?:nterrupt)?\s*$/
+ def self.regexp
+ /^\s*int(?:errupt)?\s*$/
end
- def execute
- context = Byebug.thread_context(Thread.main)
- context.interrupt
- end
-
- def description
+ def self.description
<<-EOD
- i[nterrupt]
+ int[errupt]
- Interrupts the program.
+ #{short_description}
EOD
+ end
+
+ def self.short_description
+ 'Interrupts the program'
+ end
+
+ def execute
+ Byebug.thread_context(Thread.main).interrupt
end
end
end