Skip to content

davidh-raybeam/eachbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eachbar

A small library wrapping ruby-progressbar, adding an each_with_progress method to all enumerable objects that renders a progress bar.

I've found this to be useful primarily when writing one-off scripts.

Installation

git clone https://github.com/davidh-raybeam/eachbar.git
cd eachbar
rake build
gem install pkg/eachbar-1.0.0.gem

Usage

$ irb -reachbar
> [*1..100].each_with_progress { sleep 1 }

Enumerables that know their own lengths (like Arrays) will display a percentage and an ETA. Enumerables that do not know their lengths (like Ranges) will display only elapsed time and the number of items completed.

Any options passed to each_with_progress will be used to initialize the ProgressBar. See the ProgressBar docs for more info.

About

A small library wrapping https://github.com/jfelchner/ruby-progressbar, adding an each_with_progress method to all enumerable objects that renders a progress bar.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages