nofxx-rtui 0.1.1 → 0.1.8
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/rtui/progress.rb +6 -2
- data/lib/rtui.rb +1 -1
- data/rtui.gemspec +2 -2
- data/spec/rtui/progress_spec.rb +1 -0
- metadata +2 -2
data/lib/rtui/progress.rb
CHANGED
@@ -134,7 +134,11 @@ module Rtui
|
|
134
134
|
private
|
135
135
|
|
136
136
|
def fmt_subject
|
137
|
-
|
137
|
+
@subject ||= ""
|
138
|
+
blank = @terminal_width - @subject.length
|
139
|
+
out = " " + @subject
|
140
|
+
out << " " * blank if blank > 0
|
141
|
+
out[0, @terminal_width - 5]
|
138
142
|
end
|
139
143
|
|
140
144
|
def fmt_bar
|
@@ -195,7 +199,7 @@ module Rtui
|
|
195
199
|
convert_bytes(@current)
|
196
200
|
end
|
197
201
|
|
198
|
-
def format_time
|
202
|
+
def format_time t
|
199
203
|
t = t.to_i
|
200
204
|
sec = t % 60
|
201
205
|
min = (t / 60) % 60
|
data/lib/rtui.rb
CHANGED
data/rtui.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rtui}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.8"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Marcos Piccinini"]
|
9
|
-
s.date = %q{2008-12-
|
9
|
+
s.date = %q{2008-12-21}
|
10
10
|
s.description = %q{Set of tools for TUI Eye Candy}
|
11
11
|
s.email = ["x@nofxx.com"]
|
12
12
|
s.extra_rdoc_files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.rdoc"]
|
data/spec/rtui/progress_spec.rb
CHANGED
@@ -64,6 +64,7 @@ describe "Progress Bar" do
|
|
64
64
|
pbar = Rtui::Progress.new("test(inc)", total,
|
65
65
|
:components => [:spinner, :percentage, :subject, :stat])
|
66
66
|
total.times { |i| sleep(0.1); pbar.subject = "inter #{i} times!!!"; pbar.inc }
|
67
|
+
pbar.subject = "finish it"
|
67
68
|
pbar.finish
|
68
69
|
end
|
69
70
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nofxx-rtui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-12-
|
12
|
+
date: 2008-12-21 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|