summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2016-11-25 16:18:53 +0000
committerThe Bundler Bot <bot@bundler.io>2016-11-25 16:18:53 +0000
commitc300b59a7095557a00fde76fa29aa8490b628445 (patch)
tree06dcca2cde8d1db3857ded9b794b533f48f2ddbe
parent5ee2d70284a384fc973ebb57d2fc02c890cd29da (diff)
parent45de8a7b5b7440247afaecda53e03eae5ff3c5d7 (diff)
downloadbundler-c300b59a7095557a00fde76fa29aa8490b628445.tar.gz
Auto merge of #5203 - colby-swandale:inline-gemfile-lock-clash, r=segiddins
Dont build defintion with Gemfile.lock (if present) when resolving gems via inline gemfile This fixes #5117 I am passing an option to `Installer` to not build a definition when resolving gems via inline gemfile. Also, i notice: `Bundler.default_lockfile.exist? && !options["update"]...`. Is "update" suppose to be a string? I ask because i noticed that other options are being passed as symbols, so I'm not which i'm suppose to be using. Thanks. PS. Hopefully i have the bundler terminology correct 😄
-rw-r--r--lib/bundler/inline.rb2
-rw-r--r--lib/bundler/installer.rb2
-rw-r--r--spec/runtime/inline_spec.rb37
3 files changed, 39 insertions, 2 deletions
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index dec3be3e98..c0f5bd0e4f 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -60,7 +60,7 @@ def gemfile(install = false, options = {}, &gemfile)
Bundler.ui = ui if install
if install || missing_specs.call
- installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
+ installer = Bundler::Installer.install(Bundler.root, definition, :system => true, :inline => true)
installer.post_install_messages.each do |name, message|
Bundler.ui.info "Post-install message from #{name}:\n#{message}"
end
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index c4892ff186..46131ea8f6 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -212,7 +212,7 @@ module Bundler
end
def resolve_if_need(options)
- if Bundler.default_lockfile.exist? && !options["update"]
+ if Bundler.default_lockfile.exist? && !options["update"] && !options[:inline]
local = Bundler.ui.silence do
begin
tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb
index 4d9a1f7fe4..3b08e50e64 100644
--- a/spec/runtime/inline_spec.rb
+++ b/spec/runtime/inline_spec.rb
@@ -193,4 +193,41 @@ describe "bundler/inline#gemfile" do
expect(err).to be_empty
expect(exitstatus).to be_zero if exitstatus
end
+
+ it "installs inline gems when a Gemfile.lock is present" do
+ gemfile <<-G
+ source "https://rubygems.org"
+ gem "rake"
+ G
+
+ lockfile <<-G
+ GEM
+ remote: https://rubygems.org/
+ specs:
+ rake (11.3.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rake
+
+ BUNDLED WITH
+ 1.13.6
+ G
+
+ in_app_root do
+ script <<-RUBY
+ gemfile do
+ source "file://#{gem_repo1}"
+ gem "rack"
+ end
+
+ puts RACK
+ RUBY
+ end
+
+ expect(err).to be_empty
+ expect(exitstatus).to be_zero if exitstatus
+ end
end