In Files

  • rubygems/test_case.rb
  • rubygems/user_interaction.rb

Class/Module Index [+]

Quicksearch

Gem::DefaultUserInteraction

When rubygems/test_case is required the default user interaction is a MockGemUi.

Module that defines the default UserInteraction. Any class including this module will have access to the ui method that returns the default UI.

Public Class Methods

ui() click to toggle source

Return the default UI.

 
               # File rubygems/user_interaction.rb, line 22
def self.ui
  @ui ||= Gem::ConsoleUI.new
end
            
ui=(new_ui) click to toggle source

Set the default UI. If the default UI is never explicitly set, a simple console based UserInteraction will be used automatically.

 
               # File rubygems/user_interaction.rb, line 30
def self.ui=(new_ui)
  @ui = new_ui
end
            
use_ui(new_ui) click to toggle source

Use new_ui for the duration of block.

 
               # File rubygems/user_interaction.rb, line 37
def self.use_ui(new_ui)
  old_ui = @ui
  @ui = new_ui
  yield
ensure
  @ui = old_ui
end
            

Public Instance Methods

ui() click to toggle source

See ::ui

 
               # File rubygems/user_interaction.rb, line 48
def ui
  Gem::DefaultUserInteraction.ui
end
            
ui=(new_ui) click to toggle source

See ::ui=

 
               # File rubygems/user_interaction.rb, line 55
def ui=(new_ui)
  Gem::DefaultUserInteraction.ui = new_ui
end
            
use_ui(new_ui, &block) click to toggle source

See ::use_ui

 
               # File rubygems/user_interaction.rb, line 62
def use_ui(new_ui, &block)
  Gem::DefaultUserInteraction.use_ui(new_ui, &block)
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus