Bitboxer

Fighting bits since 1988

Progressbar in Ruby Console Scripts

Yesterday I needed a little progress bar for a small ruby terminal script. Something like this:

Progress

Sadly I could not find one, so I had to write it myself. You can install it with:

1
gem install simple_progressbar

The progressbar can’t do very much at the moment. If you want to add more features, feel free to fork it.
A small example for the gem:

1
2
3
4
5
6
7
8
require 'simple_progressbar

SimpleProgressbar.new.show("Installing stuff") do
  (0..10).each {|i|
    progress i*10
    sleep(1)
  }
end

Comments