diff --git a/lib/bundler.rb b/lib/bundler.rb index 4176d3a8b4d..59878c03ea2 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -90,7 +90,7 @@ def configure end def ui - @ui ||= UI.new + @ui ||= UI::Silent.new end # Returns absolute path of where gems are installed on the filesystem. diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb index 19495121dda..af325afba86 100644 --- a/lib/bundler/ui.rb +++ b/lib/bundler/ui.rb @@ -1,45 +1,7 @@ module Bundler - class UI + module UI autoload :RGProxy, 'bundler/ui/rg_proxy' autoload :Shell, 'bundler/ui/shell' - - 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 + autoload :Silent, 'bundler/ui/silent' end end diff --git a/lib/bundler/ui/rg_proxy.rb b/lib/bundler/ui/rg_proxy.rb index 669b8f59f02..33c6a4129fb 100644 --- a/lib/bundler/ui/rg_proxy.rb +++ b/lib/bundler/ui/rg_proxy.rb @@ -2,7 +2,7 @@ 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 8b0d56fca21..0f0e161fea2 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 00000000000..3dec380ab38 --- /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