summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-06-09 21:25:55 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-06-09 21:25:55 -0500
commitf5bd5b57a938070586b20e8a01567698324ae936 (patch)
tree6efa47acc8810b2683d971840378b719e61bda1c
parent64edbb8e0f8cd2b73cefba36755d8c32c774ab0c (diff)
downloadbundler-seg-inline-git-auto-install.tar.gz
[Inline] Installs quietly from git if necessary when the install option is not setseg-inline-git-auto-install
-rw-r--r--lib/bundler/inline.rb2
-rw-r--r--spec/runtime/inline_spec.rb18
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index b6bddda5dd..219086956b 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -51,7 +51,7 @@ def gemfile(install = false, options = {}, &gemfile)
missing_specs = proc do
begin
!definition.missing_specs.empty?
- rescue Bundler::GemNotFound
+ rescue Bundler::GemNotFound, Bundler::GitError
definition.instance_variable_set(:@index, nil)
true
end
diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb
index 870a3ffd57..c815ccbbd3 100644
--- a/spec/runtime/inline_spec.rb
+++ b/spec/runtime/inline_spec.rb
@@ -155,4 +155,22 @@ describe "bundler/inline#gemfile" do
expect(err).to be_empty
expect(exitstatus).to be_zero if exitstatus
end
+
+ it "installs quietly from git if necessary when the install option is not set" do
+ build_git "foo", "1.0.0"
+ baz_ref = build_git("baz", "2.0.0").ref_for("HEAD")
+ script <<-RUBY
+ gemfile do
+ gem "foo", :git => #{lib_path("foo-1.0.0").to_s.dump}
+ gem "baz", :git => #{lib_path("baz-2.0.0").to_s.dump}, :ref => #{baz_ref.dump}
+ end
+
+ puts FOO
+ puts BAZ
+ RUBY
+
+ expect(out).to eq("1.0.0\n2.0.0")
+ expect(err).to be_empty
+ expect(exitstatus).to be_zero if exitstatus
+ end
end