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

Attributes

ins

Read

The input stream

Read

The output stream

Read

The error stream

Class Methods

Creates a new StreamUI wrapping in_stream for user input, out_stream for standard output, err_stream for error output. If usetty is true then special operations (like asking for passwords) will use the TTY commands to disable character echo.

Instance Methods
No documentation available

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

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

Display a warning on stderr. Will ask question if it is not nil.

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

Ask for a password. Does not echo response to terminal.

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.

Prints a formatted backtrace to the errors stream if backtraces are enabled.

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].

No documentation available

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

Return a download reporter object chosen from the current verbosity

Return a progress reporter object chosen from the current verbosity.

Display a statement.

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

Returns true if TTY methods should be used on this StreamUI.