progress_bar 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
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 easy to use
6
- first, and configurable for additional needs.
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
- bar = ProgressBar.new do |cfg|
50
- cfg.width = 60
51
- cfg.max = 1000
52
- cfg.color = true
53
- cfg.meters = [:bar, :eta]
48
+ ## Picking the meters
54
49
 
55
- cfg.bar.width = 40
56
- cfg.bar.fill = '#'
57
- cfg.bar.empty = ' '
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
- cfg.eta.format = "%H:%M:%S"
62
- end
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
 
@@ -1,3 +1,3 @@
1
1
  module ProgressBar
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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 Sasauskas"]
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}
metadata CHANGED
@@ -2,10 +2,10 @@
2
2
  name: progress_bar
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.3.1
6
6
  platform: ruby
7
7
  authors:
8
- - Paul Sasauskas
8
+ - Paul Sadauskas
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []