ruby-progressbar 0.0.9 → 0.0.10
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/lib/progressbar.rb +2 -2
- data/test.rb +2 -2
- metadata +6 -5
data/lib/progressbar.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
|
12
12
|
class ProgressBar
|
13
|
-
VERSION = "0.
|
13
|
+
VERSION = "0.0.10"
|
14
14
|
|
15
15
|
def initialize (title, total, out = STDERR)
|
16
16
|
@title = title
|
@@ -128,7 +128,7 @@ class ProgressBar
|
|
128
128
|
data = [0, 0, 0, 0].pack("SSSS")
|
129
129
|
if @out.ioctl(tiocgwinsz, data) >= 0 then
|
130
130
|
rows, cols, xpixels, ypixels = data.unpack("SSSS")
|
131
|
-
|
131
|
+
cols > 0 ? cols : default_width
|
132
132
|
else
|
133
133
|
default_width
|
134
134
|
end
|
data/test.rb
CHANGED
@@ -51,9 +51,9 @@ class ProgressBarTest < Test::Unit::TestCase
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_inc_x
|
54
|
-
total = File.size("progressbar.rb")
|
54
|
+
total = File.size("lib/progressbar.rb")
|
55
55
|
pbar = do_make_progress_bar("test(inc(x))", total)
|
56
|
-
File.new("progressbar.rb").each {|line|
|
56
|
+
File.new("lib/progressbar.rb").each {|line|
|
57
57
|
sleep(SleepUnit)
|
58
58
|
pbar.inc(line.length)
|
59
59
|
}
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-progressbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.10
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Satoru Takabayashi
|
@@ -9,7 +10,7 @@ autorequire:
|
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
12
|
|
12
|
-
date: 2009-02-16 00:00:00
|
13
|
+
date: 2009-02-16 00:00:00 -06:00
|
13
14
|
default_executable:
|
14
15
|
dependencies: []
|
15
16
|
|
@@ -37,21 +38,21 @@ rdoc_options: []
|
|
37
38
|
require_paths:
|
38
39
|
- lib
|
39
40
|
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
40
42
|
requirements:
|
41
43
|
- - ">="
|
42
44
|
- !ruby/object:Gem::Version
|
43
45
|
version: "0"
|
44
|
-
version:
|
45
46
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
46
48
|
requirements:
|
47
49
|
- - ">="
|
48
50
|
- !ruby/object:Gem::Version
|
49
51
|
version: "0"
|
50
|
-
version:
|
51
52
|
requirements: []
|
52
53
|
|
53
54
|
rubyforge_project:
|
54
|
-
rubygems_version: 1.
|
55
|
+
rubygems_version: 1.6.1
|
55
56
|
signing_key:
|
56
57
|
specification_version: 3
|
57
58
|
summary: Ruby/ProgressBar is a text progress bar library for Ruby. It can indicate progress with percentage, a progress bar, and estimated remaining time.
|