summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/cli.rb3
-rw-r--r--lib/bundler/ui.rb13
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index ae40f7fd80..3314db0cc5 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -89,6 +89,8 @@ module Bundler
"Don't remove stale gems from the cache."
method_option "no-cache", :type => :boolean, :banner =>
"Don't update the existing gem cache."
+ method_option "quiet", :type => :boolean, :banner =>
+ "Only output warnings and errors."
def install(path = nil)
opts = options.dup
opts[:without] ||= []
@@ -99,6 +101,7 @@ module Bundler
Bundler.settings[:path] = path if path
Bundler.settings[:disable_shared_gems] = '1' if options["disable-shared-gems"] || path
Bundler.settings.without = opts[:without]
+ Bundler.ui.be_quiet! if opts[:quiet]
Installer.install(Bundler.root, Bundler.definition, opts)
cache if Bundler.root.join("vendor/cache").exist?
diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb
index 7742b9b353..df2199d7f5 100644
--- a/lib/bundler/ui.rb
+++ b/lib/bundler/ui.rb
@@ -15,18 +15,19 @@ module Bundler
class Shell < UI
def initialize(shell)
@shell = shell
+ @quiet = false
end
def debug(msg)
- @shell.say(msg) if ENV['DEBUG']
+ @shell.say(msg) if ENV['DEBUG'] && !@quiet
end
def info(msg)
- @shell.say(msg)
+ @shell.say(msg) if !@quiet
end
def confirm(msg)
- @shell.say(msg, :green)
+ @shell.say(msg, :green) if !@quiet
end
def warn(msg)
@@ -36,6 +37,10 @@ module Bundler
def error(msg)
@shell.say(msg, :red)
end
+
+ def be_quiet!
+ @quiet = true
+ end
end
class RGProxy < Gem::SilentUI
@@ -52,4 +57,4 @@ module Bundler
end
end
end
-end \ No newline at end of file
+end