[ruby/irb] Add disable_irb command to disable debug of binding.irb
(https://github.com/ruby/irb/pull/898) * Add disable_irb command to disable debug of binding.irb * disable_irb doesn't override Kernel.exit Kernel.exit call is removed because disable_irb does not override Kernel.exit and workaround to https://bugs.ruby-lang.org/issues/18234 is not needed. https://github.com/ruby/irb/commit/29901e4f21
This commit is contained in:
parent
83618f2cfa
commit
3822ca9884
@ -196,7 +196,12 @@ module IRB # :nodoc:
|
|||||||
:irb_history, :History, "command/history",
|
:irb_history, :History, "command/history",
|
||||||
[:history, NO_OVERRIDE],
|
[:history, NO_OVERRIDE],
|
||||||
[:hist, NO_OVERRIDE],
|
[:hist, NO_OVERRIDE],
|
||||||
]
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
:irb_disable_irb, :DisableIrb, "command/disable_irb",
|
||||||
|
[:disable_irb, NO_OVERRIDE],
|
||||||
|
],
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
19
lib/irb/command/disable_irb.rb
Normal file
19
lib/irb/command/disable_irb.rb
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module IRB
|
||||||
|
# :stopdoc:
|
||||||
|
|
||||||
|
module Command
|
||||||
|
class DisableIrb < Base
|
||||||
|
category "IRB"
|
||||||
|
description "Disable binding.irb."
|
||||||
|
|
||||||
|
def execute(*)
|
||||||
|
::Binding.define_method(:irb) {}
|
||||||
|
IRB.irb_exit
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# :startdoc:
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user