Skip to content

Commit

Permalink
Also load plugins from RUBYLIB
Browse files Browse the repository at this point in the history
  • Loading branch information
djmarcin committed Sep 4, 2020
1 parent aecc90b commit d5c54cf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions bundler/lib/bundler/installer.rb
Expand Up @@ -243,6 +243,7 @@ def load_plugins
end
end.flatten
Bundler.rubygems.load_plugin_files(path_plugin_files)
Bundler.rubygems.load_env_plugins
end

def ensure_specs_are_compatible!
Expand Down
4 changes: 4 additions & 0 deletions bundler/lib/bundler/rubygems_integration.rb
Expand Up @@ -227,6 +227,10 @@ def load_plugin_files(files)
Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
end

def load_env_plugins
Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
end

def ui=(obj)
Gem::DefaultUserInteraction.ui = obj
end
Expand Down
10 changes: 10 additions & 0 deletions bundler/spec/commands/install_spec.rb
Expand Up @@ -432,6 +432,16 @@
gem 'foo'
G
end

it "loads env plugins" do
plugin_msg = "hello from an env plugin!"
create_file "plugins/rubygems_plugin.rb", "puts '#{plugin_msg}'"
install_gemfile <<-G, :env => { "RUBYLIB" => bundled_app("plugins/").to_s }
source "#{file_uri_for(gem_repo1)}"
gem 'foo'
G
expect(last_command.stdboth).to include(plugin_msg)
end
end

describe "Ruby version in Gemfile.lock" do
Expand Down

0 comments on commit d5c54cf

Please sign in to comment.