diff options
author | The Bundler Bot <bot@bundler.io> | 2017-01-17 02:32:06 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-01-17 02:32:06 +0000 |
commit | 4be855932695fc1fbff677687e7e54102982083d (patch) | |
tree | 007cf721aff42b07895ca7dd3c5a9843e9212ed0 | |
parent | 6fff128e07cc847483fad573300160d226cd2a35 (diff) | |
parent | 6fd5a43d0b5f79a15768ae6a6838363068908073 (diff) | |
download | bundler-4be855932695fc1fbff677687e7e54102982083d.tar.gz |
Auto merge of #5328 - bundler:seg-inline-empty-bundle-gemfile, r=indirect
[Inline] Support running when BUNDLE_GEMFILE=""
Closes #5079
-rw-r--r-- | lib/bundler.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/check.rb | 2 | ||||
-rw-r--r-- | lib/bundler/inline.rb | 2 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | spec/runtime/inline_spec.rb | 18 |
5 files changed, 22 insertions, 4 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 9b96075ca9..d483752441 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -135,7 +135,7 @@ module Bundler @locked_gems ||= if defined?(@definition) && @definition definition.locked_gems - elsif Bundler.default_lockfile.exist? + elsif Bundler.default_lockfile.file? lock = Bundler.read_file(Bundler.default_lockfile) LockfileParser.new(lock) end diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb index 3f504ff621..057a7e5695 100644 --- a/lib/bundler/cli/check.rb +++ b/lib/bundler/cli/check.rb @@ -28,7 +28,7 @@ module Bundler not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" } Bundler.ui.warn "Install missing gems with `bundle install`" exit 1 - elsif !Bundler.default_lockfile.exist? && Bundler.settings[:frozen] + elsif !Bundler.default_lockfile.file? && Bundler.settings[:frozen] Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present" exit 1 else diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index c0f5bd0e4f..4d3791bfb2 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -39,7 +39,7 @@ def gemfile(install = false, options = {}, &gemfile) def Bundler.root Bundler::SharedHelpers.pwd.expand_path end - ENV["BUNDLE_GEMFILE"] ||= "Gemfile" + ENV["BUNDLE_GEMFILE"] = "Gemfile" Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins? builder = Bundler::Dsl.new diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 46131ea8f6..4aa337a073 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"] && !options[:inline] + if !options["update"] && !options[:inline] && Bundler.default_lockfile.file? 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 cd706c1e51..573de4af54 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -232,4 +232,22 @@ RSpec.describe "bundler/inline#gemfile" do expect(err).to be_empty expect(exitstatus).to be_zero if exitstatus end + + it "installs inline gems when BUNDLE_GEMFILE is set to an empty string" do + ENV["BUNDLE_GEMFILE"] = "" + + 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 |