lib: document ProgressReport usage

This commit is contained in:
Pierre de La Morinerie 2021-07-20 16:01:06 +02:00
parent 9f9e1fdab7
commit 38c4da2deb

View file

@ -15,6 +15,17 @@ def rake_print(*args)
end end
end end
# Display progress of a long-running Rake task.
#
# Usage:
#
# ```
# progress = ProgressReport.new(100)
# (0..100).times do
# progress.inc
# end
# progress.finish
# ````
class ProgressReport class ProgressReport
def initialize(total) def initialize(total)
@start = Time.zone.now @start = Time.zone.now