progress-meter 0.0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/progress-meter.rb +3 -2
- metadata +3 -3
data/lib/progress-meter.rb
CHANGED
@@ -43,7 +43,8 @@ class Progress
|
|
43
43
|
#
|
44
44
|
def initialize(max,depth)
|
45
45
|
@max = max
|
46
|
-
@
|
46
|
+
@max = 1 if @max < 1
|
47
|
+
@current = 0
|
47
48
|
@time = Time.now
|
48
49
|
@last_report = 0
|
49
50
|
@num_reports = @@num_reports
|
@@ -82,7 +83,7 @@ class Progress
|
|
82
83
|
def report
|
83
84
|
|
84
85
|
percent = @current.to_f/ @max.to_f
|
85
|
-
percent = 0.
|
86
|
+
percent = 0.001 if percent < 0.001
|
86
87
|
if @desc != ""
|
87
88
|
indicator = @desc + ": "
|
88
89
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: progress-meter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-04-03 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -23,8 +23,8 @@ extra_rdoc_files:
|
|
23
23
|
- README
|
24
24
|
files:
|
25
25
|
- lib/progress-meter.rb
|
26
|
-
- samples/two-loops.rb
|
27
26
|
- samples/collect.rb
|
27
|
+
- samples/two-loops.rb
|
28
28
|
- samples/hash-loop.rb
|
29
29
|
- samples/file.rb
|
30
30
|
- README
|