Permalink
Browse files

Prioritize BUNDLE_PATH over GEM_PATH

  • Loading branch information...
1 parent 376eb6d commit c9a5f7b38dfb6d31043d238b53aea706fcc21ece Carl Lerche committed Feb 23, 2010
Showing with 14 additions and 1 deletion.
  1. +1 −1 lib/bundler/source.rb
  2. +13 −0 spec/runtime/setup_spec.rb
@@ -78,7 +78,7 @@ def specs
@specs ||= begin
index = Index.new
- Gem::SourceIndex.from_installed_gems.each do |name, spec|
+ Gem::SourceIndex.from_installed_gems.reverse_each do |name, spec|
@lukeredpath
lukeredpath Feb 25, 2010

This breaks compatibility with Ruby 1.8.6; if 1.8.6 support is not planned then it would be useful to know, otherwise I'd suggest changing this to reverse.each.

spec.source = self
index << spec
end
@@ -18,6 +18,19 @@
should_be_installed "activesupport 2.3.5"
end
+ it "prioritizes gems in BUNDLE_PATH over gems in GEM_HOME" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", "1.0.0"
+ G
+
+ build_gem "rack", :to_system => true do |s|
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
+ end
+
+ should_be_installed "rack 1.0.0"
+ end
+
describe "cripping rubygems" do
it "replaces #gem with an alternative that raises when appropriate" do
install_gemfile <<-G

0 comments on commit c9a5f7b

Please sign in to comment.