Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ruby/irb] Add disable_irb command to disable debug of binding.irb
(ruby/irb#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. ruby/irb@29901e4f21
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |