debrew/irb: fix errors under Ruby 3.3

This commit is contained in:
Bo Anderson 2024-08-03 01:16:58 +01:00
parent 6cfa08333c
commit 53a547d446
No known key found for this signature in database

View File

@ -5,6 +5,9 @@ require "irb"
module IRB
def self.start_within(binding)
old_stdout_sync = $stdout.sync
$stdout.sync = true
unless @setup_done
setup(nil, argv: [])
@setup_done = true
@ -12,21 +15,8 @@ module IRB
workspace = WorkSpace.new(binding)
irb = Irb.new(workspace)
@CONF[:IRB_RC]&.call(irb.context)
@CONF[:MAIN_CONTEXT] = irb.context
prev_trap = trap("SIGINT") do
irb.signal_handle
end
begin
catch(:IRB_EXIT) do
irb.eval_input
end
ensure
trap("SIGINT", prev_trap)
irb_at_exit
end
irb.run(conf)
ensure
$stdout.sync = old_stdout_sync
end
end