progress_bar 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.mkd +26 -15
- data/lib/progress_bar/version.rb +1 -1
- data/progress_bar.gemspec +1 -1
- metadata +2 -2
data/README.mkd
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# ProgressBar
|
3
3
|
|
4
4
|
*ProgressBar* is a simple Ruby library for displaying progress of
|
5
|
-
long-running tasks on the console. It is intended to be
|
6
|
-
|
5
|
+
long-running tasks on the console. It is intended to be as simple to use
|
6
|
+
as possible.
|
7
7
|
|
8
8
|
# Installation
|
9
9
|
|
@@ -44,22 +44,33 @@ pass a number to `#increment!`
|
|
44
44
|
|
45
45
|
bar.increment! 42
|
46
46
|
|
47
|
-
## The Configurable Way
|
48
47
|
|
49
|
-
|
50
|
-
cfg.width = 60
|
51
|
-
cfg.max = 1000
|
52
|
-
cfg.color = true
|
53
|
-
cfg.meters = [:bar, :eta]
|
48
|
+
## Picking the meters
|
54
49
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
cfg.bar.prefix = '['
|
59
|
-
cfg.bar.suffix = ']'
|
50
|
+
By default, ProgressBar will use all available meters (this will
|
51
|
+
probably change). To select which meters you want, and in which order,
|
52
|
+
pass them to the constructor:
|
60
53
|
|
61
|
-
|
62
|
-
|
54
|
+
bar = ProgressBar.new(100, :bar, :rate, :eta)
|
55
|
+
|
56
|
+
|
57
|
+
### Available Meters
|
58
|
+
|
59
|
+
* `:bar` -- The bar itself, fills empty space with "#"s. Ex: `[###
|
60
|
+
]`.
|
61
|
+
* `:counter` -- Number of items complete, over the max. Ex: `[ 20/100]`
|
62
|
+
* `:percentage` -- Percentage of items in the maximum. Ex: `[ 42%]`
|
63
|
+
* `:elapsed` -- Time elapsed (since the ProgressBar was initialized.
|
64
|
+
Ex: `[00:42]`
|
65
|
+
* `:eta` -- Estimated Time remaining. Given the rate that items are
|
66
|
+
completed, a guess at how long the rest will take. Ex: `[01:30]`
|
67
|
+
* `:rate` -- The rate at which items are being completed. Ex: `[
|
68
|
+
42.42/s]`
|
69
|
+
|
70
|
+
Run the tests to see examples of all the formats, with different values
|
71
|
+
and maximums.
|
72
|
+
|
73
|
+
`rspec test/*_test.rb`
|
63
74
|
|
64
75
|
|
65
76
|
|
data/lib/progress_bar/version.rb
CHANGED
data/progress_bar.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "progress_bar"
|
7
7
|
s.version = ProgressBar::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Paul
|
9
|
+
s.authors = ["Paul Sadauskas"]
|
10
10
|
s.email = ["psadauskas@gmail.com"]
|
11
11
|
s.homepage = "http://www.github.com/paul/progress_bar"
|
12
12
|
s.summary = %q{Simple Progress Bar for output to a terminal}
|