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.
683 684 685 686 687 688 689 690 691 692 693 694 695 |
# File 'lib/rubygems/user_interaction.rb', line 683 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
697 698 699 700 701 |
# File 'lib/rubygems/user_interaction.rb', line 697 def close super @ins.close @outs.close end |
#download_reporter(*args) ⇒ Object
:nodoc:
703 704 705 |
# File 'lib/rubygems/user_interaction.rb', line 703 def download_reporter(*args) # :nodoc: SilentDownloadReporter.new(@outs, *args) end |
#progress_reporter(*args) ⇒ Object
:nodoc:
707 708 709 |
# File 'lib/rubygems/user_interaction.rb', line 707 def progress_reporter(*args) # :nodoc: SilentProgressReporter.new(@outs, *args) end |