Class: Gem::SilentUI

Inherits:
StreamUI show all
Defined in:
lib/rubygems/user_interaction.rb

Overview

SilentUI is a UI choice that is absolutely silent.

Instance Attribute Summary

Attributes inherited from StreamUI

#errs, #ins, #outs

Instance Method Summary collapse

Methods inherited from StreamUI

#_gets_noecho, #alert, #alert_error, #alert_warning, #ask, #ask_for_password, #ask_yes_no, #backtrace, #choose_from_list, #debug, #say, #terminate_interaction, #tty?

Constructor Details

#initializeSilentUI

The SilentUI has no arguments as it does not use any stream.



672
673
674
675
676
677
678
679
680
681
682
683
684
# File 'lib/rubygems/user_interaction.rb', line 672

def initialize
  reader, writer = nil, nil

  begin
    reader = File.open('/dev/null', 'r')
    writer = File.open('/dev/null', 'w')
  rescue Errno::ENOENT
    reader = File.open('nul', 'r')
    writer = File.open('nul', 'w')
  end

  super reader, writer, writer, false
end

Instance Method Details

#download_reporter(*args) ⇒ Object

:nodoc:



686
687
688
# File 'lib/rubygems/user_interaction.rb', line 686

def download_reporter(*args) # :nodoc:
  SilentDownloadReporter.new(@outs, *args)
end

#progress_reporter(*args) ⇒ Object

:nodoc:



690
691
692
# File 'lib/rubygems/user_interaction.rb', line 690

def progress_reporter(*args) # :nodoc:
  SilentProgressReporter.new(@outs, *args)
end