lib: document ProgressReport usage
This commit is contained in:
parent
9f9e1fdab7
commit
38c4da2deb
1 changed files with 11 additions and 0 deletions
|
@ -15,6 +15,17 @@ def rake_print(*args)
|
|||
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
|
||||
def initialize(total)
|
||||
@start = Time.zone.now
|
||||
|
|
Loading…
Reference in a new issue