[ruby/irb] Add an option to suppress code_around_binding
(https://github.com/ruby/irb/pull/444) for debug.gem's `irb` command
This commit is contained in:
parent
cb4c89e08e
commit
d8202a52a5
@ -924,10 +924,10 @@ class Binding
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# See IRB@IRB+Usage for more information.
|
# See IRB@IRB+Usage for more information.
|
||||||
def irb
|
def irb(show_code: true)
|
||||||
IRB.setup(source_location[0], argv: [])
|
IRB.setup(source_location[0], argv: [])
|
||||||
workspace = IRB::WorkSpace.new(self)
|
workspace = IRB::WorkSpace.new(self)
|
||||||
STDOUT.print(workspace.code_around_binding)
|
STDOUT.print(workspace.code_around_binding) if show_code
|
||||||
binding_irb = IRB::Irb.new(workspace)
|
binding_irb = IRB::Irb.new(workspace)
|
||||||
binding_irb.context.irb_path = File.expand_path(source_location[0])
|
binding_irb.context.irb_path = File.expand_path(source_location[0])
|
||||||
binding_irb.run(IRB.conf)
|
binding_irb.run(IRB.conf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user