dependency to active_support removed (1.minute => 60, ...)
This commit is contained in:
parent
2df5e2f0c7
commit
0007a8545c
1 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ class ProgressBar::Base
|
||||||
alias to_i i
|
alias to_i i
|
||||||
alias inc! increment!
|
alias inc! increment!
|
||||||
def done_rel() 100.0*i/max end
|
def done_rel() 100.0*i/max end
|
||||||
def done_dur() (Time.now-@start).seconds end
|
def done_dur() Time.now-@start end
|
||||||
|
|
||||||
def total_dur
|
def total_dur
|
||||||
done_dur * max / i
|
done_dur * max / i
|
||||||
|
@ -63,7 +63,7 @@ class ProgressBar::Console < ProgressBar::Base
|
||||||
|
|
||||||
def format_time t
|
def format_time t
|
||||||
if t.finite?
|
if t.finite?
|
||||||
sprintf "%02d:%02d:%02d", t/1.hour, t/1.minute % 1.hour, t % 1.minute
|
sprintf "%02d:%02d:%02d", t/3600, t/60 % 3600, t % 60
|
||||||
else
|
else
|
||||||
"--:--:--"
|
"--:--:--"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue