mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 11:03:58 +02:00

(https://github.com/ruby/irb/pull/868)
* Fix exit! command warning and method behavior
* Remove arg(0) from Kernel.exit and Kernel.exit!
372bc59bf5
22 lines
346 B
Ruby
22 lines
346 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "nop"
|
|
|
|
module IRB
|
|
# :stopdoc:
|
|
|
|
module ExtendCommand
|
|
class ForceExit < Nop
|
|
category "IRB"
|
|
description "Exit the current process."
|
|
|
|
def execute(*)
|
|
throw :IRB_EXIT, true
|
|
rescue UncaughtThrowError
|
|
Kernel.exit!
|
|
end
|
|
end
|
|
end
|
|
|
|
# :startdoc:
|
|
end
|