ruby-changes:56028
From: Yusuke <ko1@a...>
Date: Thu, 6 Jun 2019 15:26:57 +0900 (JST)
Subject: [ruby-changes:56028] Yusuke Endoh: 861b50d81d (trunk): lib/rubygems.rb: Stop "Leaked file descriptor" warning
https://git.ruby-lang.org/ruby.git/commit/?id=861b50d81d From 861b50d81d9ed5f57b78c87b2e2f24f718db31dd Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Thu, 6 Jun 2019 15:25:18 +0900 Subject: lib/rubygems.rb: Stop "Leaked file descriptor" warning Bundler.setup changes Gem::DefaultUserInteraction.ui and does not close it. This change makes sure that it is closed. diff --git a/lib/rubygems.rb b/lib/rubygems.rb index c013e4b..3508a1f 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -1208,7 +1208,13 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L1208 require 'rubygems/user_interaction' Gem::DefaultUserInteraction.use_ui(ui) do require "bundler" - @gemdeps = Bundler.setup + begin + @gemdeps = Bundler.setup + ensure + if Gem::DefaultUserInteraction.ui.is_a?(Gem::SilentUI) + Gem::DefaultUserInteraction.ui.close + end + end Bundler.ui = nil @gemdeps.requested_specs.map(&:to_spec).sort_by(&:name) end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/