Object
A progress reporter that prints out messages about the current progress.
# File rubygems/user_interaction.rb, line 490 def initialize(out_stream, *args) @out = out_stream @progress = 0 end
# File rubygems/user_interaction.rb, line 516 def done @progress = 100 if @units == '%' update_display(true, true) end
# File rubygems/user_interaction.rb, line 495 def fetch(file_name, total_bytes) @file_name = file_name @total_bytes = total_bytes.to_i @units = @total_bytes.zero? ? 'B' : '%' update_display(false) end
# File rubygems/user_interaction.rb, line 503 def update(bytes) new_progress = if @units == 'B' then bytes else ((bytes.to_f * 100) / total_bytes.to_f).ceil end return if new_progress == @progress @progress = new_progress update_display end
This page was generated for Ruby 2.0.0
Ruby-doc.org is a service of James Britt and Neurogami, a software development company in Scottsdale, AZ.
Generated with Ruby-doc Rdoc Generator 0.26.0.