Skip to content

Commit

Permalink
updated gitignore and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
leonid-shevtsov committed Dec 7, 2010
1 parent 069e88a commit 6f4513c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
doc/*
*.gem
34 changes: 34 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,40 @@ Ruby/ProgressBar is a text progress bar library for Ruby.

It can indicate progress with percentage, a progress bar, and estimated remaining time.

## Examples

Basic functionality:

% irb --simple-prompt -r progressbar
>> pbar = ProgressBar.new("test", 100)
=> (ProgressBar: 0/100)
>> 100.times {sleep(0.1); pbar.inc}; pbar.finish
test: 100% |oooooooooooooooooooooooooooooooooooooooo| Time: 00:00:10
=> nil

Set position directly:

>> pbar = ProgressBar.new("test", 100)
=> (ProgressBar: 0/100)
>> (1..100).each{|x| sleep(0.1); pbar.set(x)}; pbar.finish
test: 67% |oooooooooooooooooooooooooo | ETA: 00:00:03

Block mode:

>> ProgressBar.block('test',100) do |pbar|
>> 100.times { sleep(0.1); pbar.inc }
>> end

Even simpler:

>> (1..100).to_a.each_with_progressbar('test') do
>> sleep 0.1
>> end

## Installation

gem install ruby-progressbar

## Limitations

Since the progress is calculated by the proportion to the
Expand Down

0 comments on commit 6f4513c

Please sign in to comment.