Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1543 from carlhuda/1500_fix_rubygems_plugins

1500 fix rubygems plugins
  • Loading branch information...
commit 3431d6df36a10a6c17c879c5e732a3974faf90f4 2 parents c6cd06b + 7ab2fa4
Andre Arko authored
View
4 lib/bundler/cli.rb
@@ -214,7 +214,7 @@ def install
Bundler::Fetcher.disable_endpoint = opts["full-index"]
# rubygems plugins sometimes hook into the gem install process
- Gem.load_plugins if Gem.respond_to?(:load_plugins)
+ Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
Installer.install(Bundler.root, Bundler.definition, opts)
Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !options["no-cache"]
@@ -267,7 +267,7 @@ def update(*gems)
opts = {"update" => true, "local" => options[:local]}
# rubygems plugins sometimes hook into the gem install process
- Gem.load_plugins if Gem.respond_to?(:load_plugins)
+ Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
Installer.install Bundler.root, Bundler.definition, opts
Bundler.load.cache if Bundler.root.join("vendor/cache").exist?
View
13 spec/realworld/edgecases_spec.rb
@@ -34,4 +34,17 @@
out.should include("activemodel (3.0.5)")
end
+ # https://github.com/carlhuda/bundler/issues/1500
+ it "does not fail install because of gem plugins" do
+ realworld_system_gems("open_gem --version 1.4.2", "rake --version 0.9.2")
+ gemfile <<-G
+ source :rubygems
+
+ gem 'rack', '1.0.0'
+ G
+
+ bundle "install --path vendor/bundle", :expect_err => true
+ err.should_not include("Could not find rake")
+ err.should be_empty
+ end
end
View
24 spec/support/helpers.rb
@@ -232,6 +232,30 @@ def system_gems(*gems)
end
end
+ def realworld_system_gems(*gems)
+ gems = gems.flatten
+
+ FileUtils.rm_rf(system_gem_path)
+ FileUtils.mkdir_p(system_gem_path)
+
+ Gem.clear_paths
+
+ gem_home, gem_path, path = ENV['GEM_HOME'], ENV['GEM_PATH'], ENV['PATH']
+ ENV['GEM_HOME'], ENV['GEM_PATH'] = system_gem_path.to_s, system_gem_path.to_s
+
+ gems.each do |gem|
+ gem_command :install, "--no-rdoc --no-ri #{gem}"
+ end
+ if block_given?
+ begin
+ yield
+ ensure
+ ENV['GEM_HOME'], ENV['GEM_PATH'] = gem_home, gem_path
+ ENV['PATH'] = path
+ end
+ end
+ end
+
def cache_gems(*gems)
gems = gems.flatten
Please sign in to comment.
Something went wrong with that request. Please try again.