[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:
Takashi Kokubun 2022-11-17 16:47:49 -08:00 коммит произвёл git
Родитель cb4c89e08e
Коммит d8202a52a5
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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)