summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColby Swandale <colby@taplaboratories.com>2016-11-23 23:56:52 +1100
committerColby Swandale <colby@taplaboratories.com>2016-11-23 23:56:52 +1100
commit6a38b0daf34fdeec5e9f7a40303b61794625c315 (patch)
tree961407e2cd2ddce3093fce796aabe6dbd7a32646
parent9a13439bdc044a085ee6a129ee072f4863c11973 (diff)
downloadbundler-6a38b0daf34fdeec5e9f7a40303b61794625c315.tar.gz
dont build defintion with Gemfile.lock (if present) when using inline gemfile
-rw-r--r--lib/bundler/inline.rb2
-rw-r--r--lib/bundler/installer.rb2
-rw-r--r--spec/runtime/inline_spec.rb33
3 files changed, 35 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..8cd918f770 100644
--- a/spec/runtime/inline_spec.rb
+++ b/spec/runtime/inline_spec.rb
@@ -193,4 +193,37 @@ 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
+
+ gemfile <<-G
+ GEM
+ remote: https://rubygems.org/
+ specs:
+ rake (11.3.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rake
+
+ BUNDLED WITH
+ 1.13.6
+ G
+
+ script <<-RUBY
+ gemfile do
+ source "https://rubygems.org"
+ gem "whirly"
+ end
+ RUBY
+
+ expect(err).to be_empty
+ expet(existstatus).to be_zero if existstatus
+ end
end