diff options
author | Bundlerbot <bot@bundler.io> | 2018-12-13 20:20:00 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2018-12-13 20:20:00 +0000 |
commit | 0ab0dc7ea999743ccab128f5ab582be834de427a (patch) | |
tree | 3a70f6f69fa87909ac54cac8de70a808e60fe08a | |
parent | a845a0d56c5f68999b0dfd87c95d5c456dacdc57 (diff) | |
parent | ecaefcbaa64d4d43a3c0886231a1a8d853f1bcba (diff) | |
download | bundler-0ab0dc7ea999743ccab128f5ab582be834de427a.tar.gz |
Merge #6828
6828: Added quiet flag to inline bundler r=colby-swandale a=ipepe
Thanks so much for the contribution!
To make reviewing this PR a bit easier, please fill out answers to the following questions.
### What was the end-user problem that led to this PR?
I'm using inline bundler on my CI minitest file. I wanted to make it quiet so output is clean and meaningful.
### What was your diagnosis of the problem?
Bundler inline's gemfile method only accepted :ui option.
### What is your fix for the problem, implemented in this PR?
I added quiet option flag to gemfile method.
### Why did you choose this fix out of the possible options?
I chose this fix because it looked simple and clean.
Co-authored-by: Patryk PtasiĆski <github@ipepe.pl>
-rw-r--r-- | lib/bundler/inline.rb | 1 | ||||
-rw-r--r-- | spec/runtime/inline_spec.rb | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index 9d25f3261a..93355c9460 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -36,6 +36,7 @@ def gemfile(install = false, options = {}, &gemfile) opts = options.dup ui = opts.delete(:ui) { Bundler::UI::Shell.new } + ui.level = "silent" if opts.delete(:quiet) raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty? old_root = Bundler.method(:root) diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 18ca246199..09493e0cbf 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -112,6 +112,19 @@ RSpec.describe "bundler/inline#gemfile" do expect(exitstatus).to be_zero if exitstatus end + it "has an option for quiet installation" do + script <<-RUBY, :artifice => "endpoint" + require 'bundler' + + gemfile(true, :quiet => true) do + source "https://notaserver.com" + gem "activesupport", :require => true + end + RUBY + + expect(out).to be_empty + end + it "raises an exception if passed unknown arguments" do script <<-RUBY gemfile(true, :arglebargle => true) do |