Module: Gem::DefaultUserInteraction
Overview
Module that defines the default UserInteraction
. Any class including this module will have access to the .ui method that returns the default UI.
Class Attribute Summary
-
.ui
rw
Return the default UI.
-
.ui=(new_ui)
rw
Set the default UI.
Class Method Summary
-
.use_ui(new_ui)
Use
new_ui
for the duration ofblock
.
Instance Attribute Summary
-
#ui
rw
See .ui
-
#ui=(new_ui)
rw
See .ui=
Instance Method Summary
Text
- Included
#clean_text | Remove any non-printable characters and make the text suitable for printing. |
#format_text | Wraps |
#levenshtein_distance | Returns a value representing the “cost” of transforming str1 into str2 Vendored version of |
#truncate_text, #min3 |
Class Attribute Details
.ui (rw)
Return the default UI.
.ui=(new_ui) (rw)
Set the default UI. If the default UI is never explicitly set, a simple console based UserInteraction
will be used automatically.
# File 'lib/rubygems/user_interaction.rb', line 36
def self.ui=(new_ui) @ui = new_ui end
Class Method Details
.use_ui(new_ui)
Use new_ui
for the duration of block
.
# File 'lib/rubygems/user_interaction.rb', line 43
def self.use_ui(new_ui) old_ui = @ui @ui = new_ui yield ensure @ui = old_ui end
Instance Attribute Details
#ui (rw)
See .ui
#ui=(new_ui) (rw)
See .ui=
Instance Method Details
#use_ui(new_ui, &block)
See .use_ui