progress-bar 0.2.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/progress-bar.rb +15 -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: 6e8975cb038becc5828637c319a498f2f5fc434a
|
4
|
+
data.tar.gz: 2561f08104f6fb93d9377954663f860fb510a46c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d04884c0cf4107612f923cbc7f2afeabad5eb85180af275057d07cdf1453955bebeef0f81caa2fb4ea2c46b591e112dde7a7e78671c032cf91914196c086c498
|
7
|
+
data.tar.gz: 67eb5a003527d87e73fbb98c62fbcc7279d6cfea501a582cdd0f26af1f6cabdbb08cbac5fcb40a07bdfa1ad2081e97f53ec4ec38ce5ee53e59e08453fee6dc81
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.1
|
data/lib/progress-bar.rb
CHANGED
@@ -24,6 +24,11 @@ class ProgressBar::Base
|
|
24
24
|
change_progress
|
25
25
|
end
|
26
26
|
|
27
|
+
def max= val
|
28
|
+
@max = val
|
29
|
+
change_progress
|
30
|
+
end
|
31
|
+
|
27
32
|
def increment!( x = nil) self.i += (x || 1) end
|
28
33
|
alias to_i i
|
29
34
|
alias inc! increment!
|
@@ -79,8 +84,8 @@ end
|
|
79
84
|
|
80
85
|
class ProgressBar::KDialog < ProgressBar::Base
|
81
86
|
attr_reader :dialog_service_path, :dialog_object_path, :errors, :dialog_object
|
82
|
-
def initialize
|
83
|
-
super
|
87
|
+
def initialize max, text
|
88
|
+
super max, text
|
84
89
|
@errors = []
|
85
90
|
args = %w[kdialog --progressbar] + [text, max.to_s]
|
86
91
|
@dialog_service_path, @dialog_object_path = IO.popen( args, 'r', &:readlines).join("\n").split ' '
|
@@ -123,4 +128,12 @@ class ProgressBar::KDialog < ProgressBar::Base
|
|
123
128
|
@dialog_object.close rescue DBus::Error
|
124
129
|
kdialog '--detailederror', "Some errors occured:", errors.join( "<br/>\n") unless errors.empty?
|
125
130
|
end
|
131
|
+
|
132
|
+
def max= val
|
133
|
+
@dialog_object.Set '', 'maximum', val
|
134
|
+
end
|
135
|
+
|
136
|
+
def max
|
137
|
+
@dialog_object.Get '', 'maximum'
|
138
|
+
end
|
126
139
|
end
|
data/progress-bar.gemspec
CHANGED