aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/definition.rb3
-rw-r--r--lib/bundler/index.rb8
-rw-r--r--spec/install/path_spec.rb31
3 files changed, 42 insertions, 0 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index e2ba51cf..195bcee2 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -203,6 +203,9 @@ module Bundler
s.source = @sources.find { |src| s.source == src }
next if s.source.nil? || @unlock[:sources].include?(s.name)
+ # If the spec is from a path source and it doesn't exist anymore
+ # then we just unlock it.
+ next if s.source.instance_of?(Source::Path) && s.source.specs[s].empty?
converged << s
end
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index e615cf40..99621335 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -1,5 +1,7 @@
module Bundler
class Index
+ include Enumerable
+
def self.build
i = new
yield i
@@ -79,6 +81,12 @@ module Bundler
self
end
+ def ==(o)
+ all? do |s|
+ s2 = o[s].first and (s.dependencies & s2.dependencies).empty?
+ end
+ end
+
private
def search_by_spec(spec)
diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb
index fc630e64..e6908e98 100644
--- a/spec/install/path_spec.rb
+++ b/spec/install/path_spec.rb
@@ -171,4 +171,35 @@ describe "bundle install with explicit source paths" do
bundle "exec foo"
out.should == "1.0"
end
+
+ describe "when the gem version in the path is updated" do
+ before :each do
+ build_lib "foo", "1.0", :path => lib_path("foo") do |s|
+ s.add_dependency "bar"
+ end
+ build_lib "bar", "1.0", :path => lib_path("foo/bar")
+
+ install_gemfile <<-G
+ gem "foo", :path => "#{lib_path('foo')}"
+ G
+ end
+
+ it "unlocks all gems when the top level gem is updated" do
+ build_lib "foo", "2.0", :path => lib_path("foo") do |s|
+ s.add_dependency "bar"
+ end
+
+ bundle "install"
+
+ should_be_installed "foo 2.0", "bar 1.0"
+ end
+
+ it "unlocks all gems when a child dependency gem is updated" do
+ build_lib "bar", "2.0", :path => lib_path("foo/bar")
+
+ bundle "install"
+
+ should_be_installed "foo 1.0", "bar 2.0"
+ end
+ end
end