summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2015-10-17 16:14:33 +0900
committerHomu <homu@barosl.com>2015-10-17 16:14:33 +0900
commit1bb7e41bd002294564c6e7de29cd9667df51c1ee (patch)
treefe02b8ed55155f126d0517eca3a91ef50971dd60
parent73576e1c0db09f056f6569b14301c633cc79c815 (diff)
parent9dc6f5bf87589df2f26ac8ff625848aac829a12a (diff)
downloadbundler-1bb7e41bd002294564c6e7de29cd9667df51c1ee.tar.gz
Auto merge of #4061 - bundler:seg-dir-no-gemspec, r=indirect
[Index] Handle when comparing against an index with no gemspec Closes #4004.
-rw-r--r--lib/bundler/index.rb2
-rw-r--r--spec/install/gemfile/path_spec.rb18
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index d3753f0c66..f71849a87c 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -133,7 +133,7 @@ module Bundler
def ==(other)
all? do |spec|
other_spec = other[spec].first
- (spec.dependencies & other_spec.dependencies).empty? && spec.source == other_spec.source
+ other_spec && (spec.dependencies & other_spec.dependencies).empty? && spec.source == other_spec.source
end
end
diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb
index 74f068116e..86179350d9 100644
--- a/spec/install/gemfile/path_spec.rb
+++ b/spec/install/gemfile/path_spec.rb
@@ -341,6 +341,24 @@ describe "bundle install with explicit source paths" do
should_be_installed "foo 1.0"
end
+ it "works when the path does not have a gemspec but there is a lockfile" do
+ lockfile <<-L
+ PATH
+ remote: vendor/bar
+ specs:
+
+ GEM
+ remote: http://rubygems.org
+ L
+
+ in_app_root { FileUtils.mkdir_p("vendor/bar") }
+
+ install_gemfile <<-G
+ gem "bar", "1.0.0", path: "vendor/bar", require: "bar/nyard"
+ G
+ expect(exitstatus).to eq(0) if exitstatus
+ end
+
it "installs executable stubs" do
build_lib "foo" do |s|
s.executables = ["foo"]