Module: Gem::DefaultUserInteraction
Overview
When rubygems/test_case is required the default user interaction is a MockGemUi.
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 | This code is based directly on the Text gem implementation Returns a value representing the “cost” of transforming str1 into str2. |
#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