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

#alert, #alert_error, #alert_warning, #ask, #ask_for_password, #ask_for_password_on_unix, #ask_for_password_on_windows, #ask_yes_no, #choose_from_list, #debug, #say, #terminate_interaction, #tty?

Constructor Details

#initializeSilentUI

Returns a new instance of SilentUI.



540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/rubygems/user_interaction.rb', line 540

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



554
555
556
# File 'lib/rubygems/user_interaction.rb', line 554

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

#progress_reporter(*args) ⇒ Object



558
559
560
# File 'lib/rubygems/user_interaction.rb', line 558

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