simple_progressbar 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/VERSION +1 -1
- data/lib/simple_progressbar.rb +7 -9
- data/simple_progressbar.gemspec +4 -2
- metadata +4 -2
data/.document
ADDED
data/.gitignore
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/simple_progressbar.rb
CHANGED
@@ -8,24 +8,22 @@ class SimpleProgressbar
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def progress(percent)
|
11
|
-
print "\e[
|
11
|
+
print "\e[18D"
|
12
12
|
render_progress(percent)
|
13
13
|
end
|
14
14
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def render_progress(percent)
|
18
|
-
|
18
|
+
print "["
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
(percent/10).to_i.times do
|
21
|
+
print "*"
|
22
22
|
end
|
23
|
-
|
24
|
-
|
23
|
+
(10 - (percent/10).to_i).times do
|
24
|
+
print " "
|
25
25
|
end
|
26
|
-
|
27
|
-
line += "]\e[32m#{'%4s' % percent}\e[0m %"
|
28
|
-
print line
|
26
|
+
print "]\e[32m#{'%4s' % percent}\e[0m %"
|
29
27
|
STDOUT.flush
|
30
28
|
end
|
31
29
|
|
data/simple_progressbar.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{simple_progressbar}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bodo Tasche"]
|
@@ -17,7 +17,9 @@ Gem::Specification.new do |s|
|
|
17
17
|
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
"
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
21
23
|
"README.rdoc",
|
22
24
|
"Rakefile",
|
23
25
|
"VERSION",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bodo Tasche
|
@@ -39,6 +39,8 @@ extra_rdoc_files:
|
|
39
39
|
- LICENSE
|
40
40
|
- README.rdoc
|
41
41
|
files:
|
42
|
+
- .document
|
43
|
+
- .gitignore
|
42
44
|
- LICENSE
|
43
45
|
- README.rdoc
|
44
46
|
- Rakefile
|