Skip to content

Commit

Permalink
Merge pull request #17945 from Homebrew/debrew-irb-fix
Browse files Browse the repository at this point in the history
debrew/irb: fix errors under Ruby 3.3
  • Loading branch information
Bo98 authored Aug 3, 2024
2 parents 19f837f + 53a547d commit 4dcd308
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions Library/Homebrew/debrew/irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,18 @@

module IRB
def self.start_within(binding)
old_stdout_sync = $stdout.sync
$stdout.sync = true

unless @setup_done
setup(nil, argv: [])
@setup_done = true
end

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

0 comments on commit 4dcd308

Please sign in to comment.