progress-bar 0.2.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ee00bdd00686cd7974a76d943cfb0c93faf8514
4
- data.tar.gz: 99fb955b4cf3873c1d8b905ee966ac10c9658817
3
+ metadata.gz: 6e8975cb038becc5828637c319a498f2f5fc434a
4
+ data.tar.gz: 2561f08104f6fb93d9377954663f860fb510a46c
5
5
  SHA512:
6
- metadata.gz: 63f37da19bc5852e1644d8bed571749ddacfd464db7954343543c169eaa7266cc7f35e3bb7fc291a9a89a22dfb37da779d99cef5f38ca69dc595c77dea9eab98
7
- data.tar.gz: c0c62ec8a6a97435dff5c2e869b5fcdd76df0c5cb6effea66d8df2dcffd22f3fbc54bab3caad1e2eb4a1635714b6ee6ddfac5bd497fc30c747d609b71309b714
6
+ metadata.gz: d04884c0cf4107612f923cbc7f2afeabad5eb85180af275057d07cdf1453955bebeef0f81caa2fb4ea2c46b591e112dde7a7e78671c032cf91914196c086c498
7
+ data.tar.gz: 67eb5a003527d87e73fbb98c62fbcc7279d6cfea501a582cdd0f26af1f6cabdbb08cbac5fcb40a07bdfa1ad2081e97f53ec4ec38ce5ee53e59e08453fee6dc81
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.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 *a
83
- super *a
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "progress-bar"
8
- s.version = "0.2.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Denis Knauf"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progress-bar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Knauf