paul / progress_bar

A Ruby terminal progress_bar
Do What The F*ck You Want To Public License
623 stars 49 forks source link

NaN exception when initializing with 0 and incrementing #20

Closed nicolasblanco closed 10 years ago

nicolasblanco commented 11 years ago
[3] pry(main)> bar = ProgressBar.new(0)
=> #>,
   @key=nil,
   @menu=nil,
   @multi_indent=true,
   @output=#>,
   @page_at=nil,
   @prompt=nil,
   @question=nil,
   @wrap_at=nil>,
 @last_write=1970-01-01 01:00:00 +0100,
 @max=0,
 @meters=[:bar, :counter, :percentage, :elapsed, :eta, :rate],
 @start=2013-07-15 10:49:26 +0200>
[4] pry(main)> bar.increment!
FloatDomainError: NaN
from /Users/nicolas/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/progress_bar-1.0.0/lib/progress_bar.rb:98:in `ceil'
paul commented 10 years ago

Fixed in v1.0.2