Class: Gem::StreamUI::VerboseProgressReporter
- Inherits:
-
Object
- Object
- Gem::StreamUI::VerboseProgressReporter
- Includes:
- DefaultUserInteraction
- Defined in:
- lib/rubygems/user_interaction.rb
Overview
A progress reporter that prints out messages about the current progress.
Instance Attribute Summary (collapse)
-
- (Object) count
readonly
Returns the value of attribute count.
Instance Method Summary (collapse)
-
- (Object) done
Prints out the terminal message.
-
- (VerboseProgressReporter) initialize(out_stream, size, initial_message, terminal_message = 'complete')
constructor
A new instance of VerboseProgressReporter.
-
- (Object) updated(message)
Prints out the position relative to the total and the message.
Methods included from DefaultUserInteraction
ui, #ui, #ui=, ui=, use_ui, #use_ui
Constructor Details
- (VerboseProgressReporter) initialize(out_stream, size, initial_message, terminal_message = 'complete')
A new instance of VerboseProgressReporter
389 390 391 392 393 394 395 396 397 |
# File 'lib/rubygems/user_interaction.rb', line 389 def initialize(out_stream, size, , = 'complete') @out = out_stream @total = size @count = 0 @terminal_message = @out.puts end |
Instance Attribute Details
- (Object) count (readonly)
Returns the value of attribute count
387 388 389 |
# File 'lib/rubygems/user_interaction.rb', line 387 def count @count end |
Instance Method Details
- (Object) done
Prints out the terminal message.
410 411 412 |
# File 'lib/rubygems/user_interaction.rb', line 410 def done @out.puts @terminal_message end |
- (Object) updated(message)
Prints out the position relative to the total and the message.
402 403 404 405 |
# File 'lib/rubygems/user_interaction.rb', line 402 def updated() @count += 1 @out.puts "#{@count}/#{@total}: #{}" end |