From d8202a52a5fedd2209248b030ea6c41382f5f3e2 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 17 Nov 2022 16:47:49 -0800 Subject: [PATCH] [ruby/irb] Add an option to suppress code_around_binding (https://github.com/ruby/irb/pull/444) for debug.gem's `irb` command --- lib/irb.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/irb.rb b/lib/irb.rb index ab5702c9f2..1c38960cc0 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -924,10 +924,10 @@ class Binding # # # See IRB@IRB+Usage for more information. - def irb + def irb(show_code: true) IRB.setup(source_location[0], argv: []) 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.context.irb_path = File.expand_path(source_location[0]) binding_irb.run(IRB.conf)