Permalink
Browse files

Fix a bug with source pinning and dependencies

  • Loading branch information...
1 parent eec57fb commit ecec2af4691ff3690995d659bdabc04d87c35368 Carlhuda committed Feb 4, 2010
Showing with 24 additions and 2 deletions.
  1. +6 −2 lib/bundler/installer.rb
  2. +18 −0 spec/install/path_spec.rb
View
@@ -112,7 +112,11 @@ def ambiguous?(dep)
def index
@index ||= begin
- index = local_index
+ index = Index.new
+
+ if File.directory?("#{root}/vendor/cache")
+ index = cache_source.specs.merge(index).freeze
+ end
sources.each do |source|
i = source.specs
@@ -121,7 +125,7 @@ def index
Bundler.ui.debug "Done."
end
- index
+ Index.from_installed_gems.merge(index)
end
end
View
@@ -42,6 +42,24 @@
out.should == 'WIN OVERRIDE'
end
+ it "works" do
+ build_gem "foo", "1.0.0", :to_system => true do |s|
+ s.write "lib/foo.rb", "puts 'FAIL'"
+ end
+
+ build_lib "omg", "1.0", :path => lib_path("omg") do |s|
+ s.add_dependency "foo"
+ end
+
+ build_lib "foo", "1.0.0", :path => lib_path("omg/foo")
+
+ install_gemfile <<-G
+ gem "omg", :path => "#{lib_path('omg')}"
+ G
+
+ should_be_installed "foo 1.0"
+ end
+
describe "when locked" do
it "keeps source pinning" do
build_lib "foo", "1.0", :path => lib_path('foo')

0 comments on commit ecec2af

Please sign in to comment.