Class: LibGems::SilentUI
- Defined in:
- lib/libgems/user_interaction.rb
Overview
SilentUI is a UI choice that is absolutely silent.
Instance Attribute Summary
Attributes inherited from StreamUI
Instance Method Summary collapse
-
#initialize ⇒ SilentUI
constructor
A new instance of SilentUI.
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, #download_reporter, #progress_reporter, #say, #terminate_interaction
Constructor Details
#initialize ⇒ SilentUI
Returns a new instance of SilentUI.
511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
# File 'lib/libgems/user_interaction.rb', line 511 def initialize reader, writer = nil, nil begin reader = File.open('/dev/null', 'r') writer = File.open('/dev/null', 'w') rescue Errno::ENOENT => e reader = File.open('nul', 'r') writer = File.open('nul', 'w') end super reader, writer, writer end |