Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #6828
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bundlerbot and ipepe committed Dec 13, 2018
2 parents a845a0d + ecaefcb commit 0ab0dc7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/bundler/inline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions spec/runtime/inline_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@ def confirm(msg, newline = nil)
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
Expand Down

0 comments on commit 0ab0dc7

Please sign in to comment.