ruby-changes:68442
From: Nobuyoshi <ko1@a...>
Date: Thu, 14 Oct 2021 05:03:54 +0900 (JST)
Subject: [ruby-changes:68442] 3f0150f2fd (master): [rubygems/rubygems] Keep loaded features
https://git.ruby-lang.org/ruby.git/commit/?id=3f0150f2fd From 3f0150f2fd408421c4625976d0c88df27b6753d3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 13 Oct 2021 22:19:25 +0900 Subject: [rubygems/rubygems] Keep loaded features Now `$LOADED_FEATURES` list is being maintained by `setup` and `teardown` and, only libaries under the temporary directory will be removed. As `save_loaded_features` removes the rest libraries other than this test directory, ordinary libraries loaded from files under rubygems also removed, and often causes constant redefinition warnings. https://github.com/rubygems/rubygems/commit/9e1f92aafd --- test/rubygems/helper.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index 320f97e6c3..8014548b2c 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -826,13 +826,7 @@ class Gem::TestCase < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/helper.rb#L826 end def save_loaded_features - old_loaded_features = $LOADED_FEATURES.dup yield - ensure - prefix = File.dirname(__FILE__) + "/" - new_features = ($LOADED_FEATURES - old_loaded_features) - old_loaded_features.concat(new_features.select {|f| f.rindex(prefix, 0) }) - $LOADED_FEATURES.replace old_loaded_features end def new_default_spec(name, version, deps = nil, *files) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/