Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ggonnella/ruby_progress_bar
a simple progress bar to give some feedback in console based ruby scripts
https://github.com/ggonnella/ruby_progress_bar
Last synced: 6 days ago
JSON representation
a simple progress bar to give some feedback in console based ruby scripts
- Host: GitHub
- URL: https://github.com/ggonnella/ruby_progress_bar
- Owner: ggonnella
- License: mit
- Created: 2009-06-03T11:51:36.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2009-06-03T12:22:38.000Z (over 15 years ago)
- Last Synced: 2024-11-16T02:08:47.065Z (2 months ago)
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: MIT-LICENSE
Awesome Lists containing this project
README
If you have a console based ruby script which takes some time to execute and
you can calculate which portion of the execution is ready at a certain time, you
may use this library to give some feedback.It will be applied for example to this very simple script:
100.times do
sleep 0.1 # let's pretend I'm doing something :)
endUsing ruby_progress_bar it becomes:
require "progress_bar.rb"
# you must know the number of iterations to initialize the counter
# in this case it's easy, it is 100:
bar = ProgressBar.new(100) # this outputs the scala and opens the bar
100.times do
sleep 0.1 # let's pretend I'm doing something :)
bar.next # this will print a dot every 1/50 of the iterations
end
bar.close # this closes the bar and prints a time benchmark=LICENSE
This library is MIT-Licensed.