progress-bar 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/progress-bar.rb +5 -2
- data/progress-bar.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bea79440728cd1a4a6bb6b68fb9c1fe143c514e
|
4
|
+
data.tar.gz: 05a736cfdde2beff140402225001556afb133db3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a6054ba33e0e57c9327b691bd5ed6682f8459dc7ccc6793038e64b97854e9f5f62900d77675703af04e5c3eca26ab3ca754f6ce7cd4fc94dd988165b53a3692
|
7
|
+
data.tar.gz: 9a251ee4db21c560f52123eb29f2b82dc7ac2eaff8395a2e58735017f5b1348ff05036a745be94e96810ff0c6b53fb256a325597d5758ac4d6cee54229fac82d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.6
|
data/lib/progress-bar.rb
CHANGED
@@ -90,16 +90,19 @@ end
|
|
90
90
|
|
91
91
|
class ProgressBar::KDialog < ProgressBar::Base
|
92
92
|
attr_reader :dialog_service_path, :dialog_object_path, :errors, :dialog_object
|
93
|
-
def initialize max, text
|
93
|
+
def initialize max, text = nil
|
94
94
|
super max, text
|
95
|
+
text = @text
|
96
|
+
text = nil if text.nil? or text.empty?
|
95
97
|
@errors = []
|
96
|
-
args = %w[kdialog --progressbar] + [text, max.to_s]
|
98
|
+
args = %w[kdialog --progressbar] + [text || '.', max.to_s]
|
97
99
|
@dialog_service_path, @dialog_object_path = IO.popen( args, 'r', &:readlines).join("\n").split ' '
|
98
100
|
@dialog_bus = DBus.session_bus
|
99
101
|
@dialog_service = @dialog_bus[@dialog_service_path]
|
100
102
|
@dialog_object = @dialog_service.object @dialog_object_path
|
101
103
|
@dialog_object.introspect
|
102
104
|
@dialog_object.showCancelButton true
|
105
|
+
change_text if text.nil?
|
103
106
|
change_progress
|
104
107
|
rescue DBus::Error
|
105
108
|
raise Interrupt if $!.name == 'org.freedesktop.DBus.Error.ServiceUnknown'
|
data/progress-bar.gemspec
CHANGED