Class: Gem::SilentUI
- Defined in:
- lib/rubygems/user_interaction.rb
Overview
SilentUI is a UI choice that is absolutely silent.
Instance Attribute Summary
Attributes inherited from StreamUI
Instance Method Summary collapse
- #close ⇒ Object
-
#download_reporter(*args) ⇒ Object
:nodoc:.
-
#initialize ⇒ SilentUI
constructor
The SilentUI has no arguments as it does not use any stream.
-
#progress_reporter(*args) ⇒ Object
:nodoc:.
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
#initialize ⇒ SilentUI
The SilentUI has no arguments as it does not use any stream.
676 677 678 679 680 681 682 683 684 685 686 687 688 |
# File 'lib/rubygems/user_interaction.rb', line 676 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
#close ⇒ Object
690 691 692 693 694 |
# File 'lib/rubygems/user_interaction.rb', line 690 def close super @ins.close @outs.close end |
#download_reporter(*args) ⇒ Object
:nodoc:
696 697 698 |
# File 'lib/rubygems/user_interaction.rb', line 696 def download_reporter(*args) # :nodoc: SilentDownloadReporter.new(@outs, *args) end |
#progress_reporter(*args) ⇒ Object
:nodoc:
700 701 702 |
# File 'lib/rubygems/user_interaction.rb', line 700 def progress_reporter(*args) # :nodoc: SilentProgressReporter.new(@outs, *args) end |