diff options
author | Patryk PtasiĆski <github@ipepe.pl> | 2018-12-05 11:09:05 +0100 |
---|---|---|
committer | Patryk Ptasinski <patryk@ipepe.pl> | 2018-12-13 14:44:33 +0100 |
commit | ecaefcbaa64d4d43a3c0886231a1a8d853f1bcba (patch) | |
tree | 80ddaa95ebc450d29e3e0de3e7a4c4ceee518b2c | |
parent | a578c4ee390fadb746252b4bd496f8ee6d90add4 (diff) | |
download | bundler-ecaefcbaa64d4d43a3c0886231a1a8d853f1bcba.tar.gz |
Added quiet flag to inline bundler
-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 |