progress-bar 0.3.6 → 0.3.7

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: 9bea79440728cd1a4a6bb6b68fb9c1fe143c514e
4
- data.tar.gz: 05a736cfdde2beff140402225001556afb133db3
3
+ metadata.gz: 67db22370ee46bd79b0397d0d2bc97fad6cc0ec2
4
+ data.tar.gz: 8253f8eceaac27970c3461f4552c178c07ba4903
5
5
  SHA512:
6
- metadata.gz: 3a6054ba33e0e57c9327b691bd5ed6682f8459dc7ccc6793038e64b97854e9f5f62900d77675703af04e5c3eca26ab3ca754f6ce7cd4fc94dd988165b53a3692
7
- data.tar.gz: 9a251ee4db21c560f52123eb29f2b82dc7ac2eaff8395a2e58735017f5b1348ff05036a745be94e96810ff0c6b53fb256a325597d5758ac4d6cee54229fac82d
6
+ metadata.gz: d87c0922a23b65462ef863000c52a115ded381f2f2753547106b0bcf356104c8b43fdf8549c8fcdfc4473273aa805a456f8a041a9ec906c8a93e0fa26fd58681
7
+ data.tar.gz: e5eeff9d0f908222cd9d217605896f4c33a1d5c059c2913f8a47e92213ded8d9fc07aba283127cbb8d3aa492f956ef14a9266504af96cd93069d85253af4fcd4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.3.7
data/lib/progress-bar.rb CHANGED
@@ -17,6 +17,7 @@ class ProgressBar::Base
17
17
  attr_accessor :start
18
18
  def initialize max = nil, text = nil
19
19
  @start, @max, @i, @text, @error = Time.now, max || 100, 0, text || '', nil
20
+ at_exit {finish}
20
21
  end
21
22
 
22
23
  def i= x
@@ -90,12 +91,13 @@ end
90
91
 
91
92
  class ProgressBar::KDialog < ProgressBar::Base
92
93
  attr_reader :dialog_service_path, :dialog_object_path, :errors, :dialog_object
93
- def initialize max, text = nil
94
+ def initialize max, text = nil, title = nil
94
95
  super max, text
95
96
  text = @text
96
97
  text = nil if text.nil? or text.empty?
98
+ title = nil if title.nil? or title.empty?
97
99
  @errors = []
98
- args = %w[kdialog --progressbar] + [text || '.', max.to_s]
100
+ args = ['kdialog', *(title ? ['--title', title] : []), '--progressbar', text || '.', max.to_s]
99
101
  @dialog_service_path, @dialog_object_path = IO.popen( args, 'r', &:readlines).join("\n").split ' '
100
102
  @dialog_bus = DBus.session_bus
101
103
  @dialog_service = @dialog_bus[@dialog_service_path]
data/progress-bar.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "progress-bar"
8
- s.version = "0.3.6"
8
+ s.version = "0.3.7"
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"]
12
- s.date = "2014-12-23"
12
+ s.date = "2014-12-24"
13
13
  s.description = "Displays a Progress Bar in terminal or via kdialog"
14
14
  s.email = "\#{\"de\"}nis@denkn.at"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progress-bar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Knauf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-23 00:00:00.000000000 Z
11
+ date: 2014-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-dbus