summaryrefslogtreecommitdiff
path: root/lib/bundler/ui
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2014-01-09 06:06:49 -0800
committerAndre Arko <andre@arko.net>2014-01-09 06:11:15 -0800
commit5e38e2d75e6cf5a686c0c70bbecf012ad12b7068 (patch)
tree410dbecba2f75f83cb92d242c88d369f5f7e2c38 /lib/bundler/ui
parent7a647149df05acff2c3e6d3fe2c6e60725c74671 (diff)
downloadbundler-5e38e2d75e6cf5a686c0c70bbecf012ad12b7068.tar.gz
extract UI::Silent
Diffstat (limited to 'lib/bundler/ui')
-rw-r--r--lib/bundler/ui/rg_proxy.rb2
-rw-r--r--lib/bundler/ui/shell.rb6
-rw-r--r--lib/bundler/ui/silent.rb44
3 files changed, 47 insertions, 5 deletions
diff --git a/lib/bundler/ui/rg_proxy.rb b/lib/bundler/ui/rg_proxy.rb
index 669b8f59f0..33c6a4129f 100644
--- a/lib/bundler/ui/rg_proxy.rb
+++ b/lib/bundler/ui/rg_proxy.rb
@@ -2,7 +2,7 @@ require 'bundler/ui'
require 'rubygems/user_interaction'
module Bundler
- class UI
+ module UI
class RGProxy < ::Gem::SilentUI
def initialize(ui)
@ui = ui
diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb
index 8b0d56fca2..0f0e161fea 100644
--- a/lib/bundler/ui/shell.rb
+++ b/lib/bundler/ui/shell.rb
@@ -1,8 +1,6 @@
-require 'bundler/ui'
-
module Bundler
- class UI
- class Shell < UI
+ module UI
+ class Shell
LEVELS = %w(silent error warn confirm info debug)
attr_writer :shell
diff --git a/lib/bundler/ui/silent.rb b/lib/bundler/ui/silent.rb
new file mode 100644
index 0000000000..3dec380ab3
--- /dev/null
+++ b/lib/bundler/ui/silent.rb
@@ -0,0 +1,44 @@
+module Bundler
+ module UI
+ class Silent
+ def info(message, newline = nil)
+ end
+
+ def confirm(message, newline = nil)
+ end
+
+ def warn(message, newline = nil)
+ end
+
+ def error(message, newline = nil)
+ end
+
+ def debug(message, newline = nil)
+ end
+
+ def debug?
+ false
+ end
+
+ def quiet?
+ false
+ end
+
+ def ask(message)
+ end
+
+ def level=(name)
+ end
+
+ def level(name = nil)
+ end
+
+ def trace(message, newline = nil)
+ end
+
+ def silence
+ yield
+ end
+ end
+ end
+end \ No newline at end of file