diff options
author | Bundlerbot <bot@bundler.io> | 2019-04-24 09:26:29 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-04-24 09:26:29 +0000 |
commit | 6f11812e8f7db34d0b94adbbe6803ed38bf8b151 (patch) | |
tree | b82e8744ed69ebd1f309d55202c5f20b6f0d941f | |
parent | 5c26795f26b72e1a2faddd12448b19602aae8399 (diff) | |
parent | 2c75b6d63efb93dfd448058bd16170cc21284dea (diff) | |
download | bundler-6f11812e8f7db34d0b94adbbe6803ed38bf8b151.tar.gz |
Merge #7124
7124: Skip platform warnings in inline mode r=indirect a=deivid-rodriguez
Fixes #6822.
### What was the end-user problem that led to this PR?
The problem was that inline mode prints platform warnings recommending to run `bundle lock` commands.
### What was your diagnosis of the problem?
My diagnosis was that the platform is always missing in the lock file since there's no lock file here.
### What is your fix for the problem, implemented in this PR?
My fix is to skip platform warnings in this case.
### Why did you choose this fix out of the possible options?
I chose this fix because it's simple.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | lib/bundler/inline.rb | 2 | ||||
-rw-r--r-- | spec/runtime/inline_spec.rb | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index fed31ba4e3..317bf892ab 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 - Bundler.settings.temporary(:inline => true) do + Bundler.settings.temporary(:inline => true, :disable_platform_warnings => true) do installer = Bundler::Installer.install(Bundler.root, definition, :system => true) installer.post_install_messages.each do |name, message| Bundler.ui.info "Post-install message from #{name}:\n#{message}" diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index d837425414..d53c3d1c15 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -290,4 +290,17 @@ RSpec.describe "bundler/inline#gemfile" do expect(last_command).to be_success expect(out).to eq "1.0.0" end + + it "skips platform warnings" do + simulate_platform "ruby" + + script <<-RUBY + gemfile(true) do + source "file://#{gem_repo1}" + gem "rack", platform: :jruby + end + RUBY + + expect(err).to be_empty + end end |