Module: Gem::Resolver::Molinillo::UI
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb |
Overview
Conveys information about the resolution process to a user.
Instance Attribute Summary
-
#debug? ⇒ Boolean
readonly
Whether or not debug messages should be printed.
Instance Method Summary
-
#after_resolution ⇒ void
Called after resolution ends (either successfully or with an error).
-
#before_resolution ⇒ void
Called before resolution begins.
-
#debug(depth = 0) ⇒ void
readonly
Conveys debug information to the user.
-
#indicate_progress ⇒ void
Called roughly every #progress_rate, this method should convey progress to the user.
-
#output ⇒ IO
The
IO
object that should be used to print output. -
#progress_rate ⇒ Float
How often progress should be conveyed to the user via #indicate_progress, in seconds.
Instance Attribute Details
#debug? ⇒ Boolean
(readonly)
Whether or not debug messages should be printed. By default, whether or not the MOLINILLO_DEBUG
environment variable is set.
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb', line 60
def debug? @debug_mode ||= ENV['MOLINILLO_DEBUG'] end
Instance Method Details
#after_resolution ⇒ void
This method returns an undefined value.
Called after resolution ends (either successfully or with an error). By default, prints a newline.
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb', line 39
def after_resolution output.puts end
#before_resolution ⇒ void
This method returns an undefined value.
Called before resolution begins.
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb', line 31
def before_resolution output.print 'Resolving dependencies...' end
#debug(depth = 0) ⇒ void
(readonly)
This method returns an undefined value.
Conveys debug information to the user.
#indicate_progress ⇒ void
This method returns an undefined value.
Called roughly every #progress_rate, this method should convey progress to the user.
#output ⇒ IO
The IO
object that should be used to print output. STDOUT
, by default.
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb', line 8
def output STDOUT end
#progress_rate ⇒ Float
How often progress should be conveyed to the user via #indicate_progress, in seconds. A third of a second, by default.
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb', line 24
def progress_rate 0.33 end