diff options
author | Sutou Kouhei <kou@clear-code.com> | 2022-09-13 09:57:42 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-05-25 21:51:15 +0000 |
commit | d83f32c34b1d0e4dd49dd1f0af1b665c022b2872 (patch) | |
tree | 3a50d7b0c5d292251513e6dd0df157bed39d0562 /test/rubygems/test_gem.rb | |
parent | e87f6c899e55f4d9452ce4d75cf2a725ae736aff (diff) |
[rubygems/rubygems] Load plugin immediately
We can install RubyGems plugin by "gem install XXX". The installed
plugin is used from the NEXT "gem ...".
For example, "gem install gem-src kaminari" doesn't use gem-src plugin
for kaminari. "gem install gem-src && gem install kaminari" uses
gem-src plugin for kaminari.
How about loading a plugin immediately when the plugin is installed?
If this proposal is implemented, "gem install gem-src kaminari" works
like "gem install gem-src && gem install kaminari".
https://github.com/rubygems/rubygems/commit/4917d96f4c
Diffstat (limited to 'test/rubygems/test_gem.rb')
-rw-r--r-- | test/rubygems/test_gem.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 126aad2602..6d36a8bb62 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1449,6 +1449,8 @@ class TestGem < Gem::TestCase def test_load_plugins plugin_path = File.join "lib", "rubygems_plugin.rb" + foo1_plugin_path = nil + foo2_plugin_path = nil Dir.chdir @tempdir do FileUtils.mkdir_p "lib" File.open plugin_path, "w" do |fp| @@ -1458,17 +1460,22 @@ class TestGem < Gem::TestCase foo1 = util_spec "foo", "1" do |s| s.files << plugin_path end + foo1_plugin_path = File.join(foo1.gem_dir, plugin_path) install_gem foo1 foo2 = util_spec "foo", "2" do |s| s.files << plugin_path end + foo2_plugin_path = File.join(foo2.gem_dir, plugin_path) install_gem foo2 end Gem::Specification.reset + PLUGINS_LOADED.clear + $LOADED_FEATURES.delete(foo1_plugin_path) + $LOADED_FEATURES.delete(foo2_plugin_path) gem "foo" |