jfelchner/ruby-progressbar — pull request #43 by flori (2013-05-02 10:11:49+00:00)
Title: Provide with progress bar in enumerables

Now this

(1..10000).with_progress_bar(format: '%t: |%w>%i| (%c/%C) %e').to_a

displays a progress bar with a total of 10,000 without having to
manually increment the progress. Passing options like :format is still
possible as shown in the example. Accessing the progress bar instance is
possible via the thread local variable progress_bar, where
progress_bar.skip can be used to skip incrementation of the progress and
continue with the next iteration.

The module containing with_progress_bar is mixed into Enumerable and all
Enumerable containing modules, when

require 'progress_bar/with_progress_bar'

is called. It can also be mixed into other classes, that support the
#each method protocol.