Class: Gem::StreamUI

Class | Gem::StreamUI
In: | lib/rubygems/user_interaction.rb
Parent: | Object

Gem::StreamUI implements a simple stream based user interface.

### Methods

alert alert_error alert_warning ask ask_yes_no choose_from_list debug new progress_reporter say terminate_interaction

### Classes and Modules

Class Gem::StreamUI::SilentProgressReporter
Class Gem::StreamUI::SimpleProgressReporter
Class Gem::StreamUI::VerboseProgressReporter

### Attributes

errs | [R] |
ins | [R] |
outs | [R] |

### Public Class methods

new(in_stream, out_stream, err_stream=STDERR)

### Public Instance methods

alert(statement, question=nil)

Display an informational alert. Will ask `question` if it is not nil.

alert_error(statement, question=nil)

Display an error message in a location expected to get error messages. Will ask `question` if it is not nil.

alert_warning(statement, question=nil)

Display a warning in a location expected to get error messages. Will ask `question` if it is not nil.

ask(question)

Ask a question. Returns an answer if connected to a tty, nil otherwise.

ask_yes_no(question, default=nil)

Ask a question. Returns a true for yes, false for no. If not connected to a tty, raises an exception if default is nil, otherwise returns default.

choose_from_list(question, list)

Choose from a list of options. `question` is a prompt displayed above the list. `list` is a list of option strings. Returns the pair [option_name, option_index].

debug(statement)

Display a debug message on the same location as error messages.

progress_reporter(*args)

Return a progress reporter object chosen from the current verbosity.

say(statement="")

Display a statement.

terminate_interaction(status = 0)

Terminate the application with exit code `status`, running any exit handlers that might have been defined.

[Validate]