Class: Gem::StreamUI::SimpleProgressReporter
- Inherits:
-
Object
- Object
- Gem::StreamUI::SimpleProgressReporter
- Includes:
- DefaultUserInteraction
- Defined in:
- lib/build-tool/GUI.rb
Overview
A basic dotted progress reporter.
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Instance Method Summary collapse
-
#done ⇒ Object
Prints out the terminal message.
-
#initialize(out_stream, size, initial_message, terminal_message = "complete") ⇒ SimpleProgressReporter
constructor
A new instance of SimpleProgressReporter.
-
#updated(message) ⇒ Object
Prints out a dot and ignores
message
.
Methods included from DefaultUserInteraction
ui, #ui, ui=, #ui=, use_ui, #use_ui
Constructor Details
#initialize(out_stream, size, initial_message, terminal_message = "complete") ⇒ SimpleProgressReporter
Returns a new instance of SimpleProgressReporter.
277 278 279 280 281 282 283 284 285 |
# File 'lib/build-tool/GUI.rb', line 277 def initialize(out_stream, size, , = "complete") @out = out_stream @total = size @count = 0 @terminal_message = @out.puts end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
275 276 277 |
# File 'lib/build-tool/GUI.rb', line 275 def count @count end |
Instance Method Details
#done ⇒ Object
Prints out the terminal message.
299 300 301 |
# File 'lib/build-tool/GUI.rb', line 299 def done @out.puts "\n#{@terminal_message}" end |
#updated(message) ⇒ Object
Prints out a dot and ignores message
.
290 291 292 293 294 |
# File 'lib/build-tool/GUI.rb', line 290 def updated() @count += 1 @out.print "." @out.flush end |