summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-03-17 08:17:17 +0900
committerHomu <homu@barosl.com>2016-03-17 08:17:17 +0900
commite7e9df172773d1be79764b51bbaa65ed8bfd548d (patch)
tree28670752954150224ffdd8be3ffa0c94636231f3
parentdfdeb0f89e7e88fcdfd001da089f09af3a77d2b4 (diff)
parentb3a527f88551563aa4b4a945456afb807457b6a2 (diff)
downloadbundler-e7e9df172773d1be79764b51bbaa65ed8bfd548d.tar.gz
Auto merge of #4357 - asutoshpalai:master, r=segiddins
Checking out missing git repos (but not being installed) - Fixing #3981 Fixes #3981. As far as I investigated the problem is, being in `without` group, it is not marked in missing_spec and so it is not resolved while resolving specs at https://github.com/bundler/bundler/blob/master/lib/bundler/installer.rb#L183 and https://github.com/bundler/bundler/blob/master/lib/bundler/installer.rb#L195 but it is in the definition's index at https://github.com/bundler/bundler/blob/master/lib/bundler/definition.rb#L209 leading to https://github.com/bundler/bundler/blob/master/lib/bundler/source/git.rb#L150 where it checks for the presence of the folder at https://github.com/bundler/bundler/blob/master/lib/bundler/source/path.rb#L135 Possible solutions are : - add it to the list of missing_specs - check while building the index in Definition class and don't add it.
-rw-r--r--lib/bundler/definition.rb6
-rw-r--r--lib/bundler/installer.rb2
-rw-r--r--spec/install/git_spec.rb26
3 files changed, 33 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 3dcac64191..0ee27b3ae7 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -167,6 +167,12 @@ module Bundler
missing
end
+ def missing_dependencies
+ missing = []
+ resolve.materialize(current_dependencies, missing)
+ missing
+ end
+
def requested_specs
@requested_specs ||= begin
groups = requested_groups
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 509b7b0cba..fcf68928e4 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -185,7 +185,7 @@ module Bundler
local = Bundler.ui.silence do
begin
tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
- true unless tmpdef.new_platform? || tmpdef.missing_specs.any?
+ true unless tmpdef.new_platform? || tmpdef.missing_dependencies.any?
rescue BundlerError
end
end
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index f3a1983740..401da1b1d3 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -14,5 +14,31 @@ describe "bundle install" do
expect(out).to include("Using foo 1.0 from #{lib_path("foo")} (at master@#{revision_for(lib_path("foo"))[0..6]})")
should_be_installed "foo 1.0"
end
+
+ it "should check out git repos that are missing but not being installed" do
+ build_git "foo"
+
+ gemfile <<-G
+ gem "foo", :git => "file://#{lib_path("foo-1.0")}", :group => :development
+ G
+
+ lockfile <<-L
+ GIT
+ remote: file://#{lib_path("foo-1.0")}
+ specs:
+ foo (1.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ foo!
+ L
+
+ bundle "install --path=vendor/bundle --without development"
+
+ expect(out).to include("Bundle complete!")
+ expect(vendored_gems("bundler/gems/foo-1.0-#{revision_for(lib_path("foo-1.0"))[0..11]}")).to be_directory
+ end
end
end