UserInteraction allows RubyGems to interact with the user through standard methods that can be replaced with more-specific UI methods for different displays.

Since UserInteraction dispatches to a concrete UI class you may need to reference other classes for specific behavior such as Gem::ConsoleUI or Gem::SilentUI.

Example:

class X
  include Gem::UserInteraction

  def get_answer
    n = ask("What is the meaning of life?")
  end
end
Instance Methods

Displays an alert statement. Asks a question if given.

Displays an error statement to the error output location. Asks a question if given.

Displays a warning statement to the warning output location. Asks a question if given.

Asks a question and returns the answer.

Asks for a password with a prompt

Asks a yes or no question. Returns true for yes, false for no.

Asks the user to answer question with an answer from the given list.

Displays the given statement on the standard output (or equivalent).

Terminates the RubyGems process with the given exit_code

Calls say with msg or the results of the block if really_verbose is true.