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, #require_io_console, #say, #terminate_interaction, #tty?

Methods included from Deprecate

deprecate, skip, skip=, skip_during

Constructor Details

#initializeSilentUI

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


631
632
633
634
635
636
637
638
# File 'lib/rubygems/user_interaction.rb', line 631

def initialize
  reader, writer = nil, nil

  reader = File.open(IO::NULL, 'r')
  writer = File.open(IO::NULL, 'w')

  super reader, writer, writer, false
end

Instance Method Details

#closeObject


640
641
642
643
644
# File 'lib/rubygems/user_interaction.rb', line 640

def close
  super
  @ins.close
  @outs.close
end

#download_reporter(*args) ⇒ Object

:nodoc:


646
647
648
# File 'lib/rubygems/user_interaction.rb', line 646

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

#progress_reporter(*args) ⇒ Object

:nodoc:


650
651
652
# File 'lib/rubygems/user_interaction.rb', line 650

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