jfelchner/ruby-progressbar — pull request #24 by cgunther (2012-09-28 20:53:27+00:00)
Title: Fix ZeroDivisionError when total is zero

When calculating the `percentage_completed`, if the local `total` is zero, a `ZeroDivisionError` is raised.

This checks for a 0 `total` and returns `DEFAULT_TOTAL` instead.

I ran into this via Fuubar and RSpec. Running a spec file that had no examples (so 0 of 0 completed), the `ZeroDivisionError` was raised.