debrew/irb: fix errors under Ruby 3.3
This commit is contained in:
parent
6cfa08333c
commit
53a547d446
@ -5,6 +5,9 @@ require "irb"
|
|||||||
|
|
||||||
module IRB
|
module IRB
|
||||||
def self.start_within(binding)
|
def self.start_within(binding)
|
||||||
|
old_stdout_sync = $stdout.sync
|
||||||
|
$stdout.sync = true
|
||||||
|
|
||||||
unless @setup_done
|
unless @setup_done
|
||||||
setup(nil, argv: [])
|
setup(nil, argv: [])
|
||||||
@setup_done = true
|
@setup_done = true
|
||||||
@ -12,21 +15,8 @@ module IRB
|
|||||||
|
|
||||||
workspace = WorkSpace.new(binding)
|
workspace = WorkSpace.new(binding)
|
||||||
irb = Irb.new(workspace)
|
irb = Irb.new(workspace)
|
||||||
|
irb.run(conf)
|
||||||
@CONF[:IRB_RC]&.call(irb.context)
|
ensure
|
||||||
@CONF[:MAIN_CONTEXT] = irb.context
|
$stdout.sync = old_stdout_sync
|
||||||
|
|
||||||
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
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user