ruby-dbus-wrapper-process-watch 1.0.0 → 1.0.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: edd034d2f9c6b834a17fea60c068a306e729dab9
4
- data.tar.gz: ccac79e6952417186662cceb23cd4fab28acec8a
3
+ metadata.gz: 8477c3b5d87ef738f143a812a350ffbfd12f9a06
4
+ data.tar.gz: 1fdafcd00ca33a90b543af3121545968a436bef5
5
5
  SHA512:
6
- metadata.gz: cb45ab3195afa5799c41da4589c5a9032167fd44798beaeb42b44c320ddd72e24fa8957da372e9415e6362fbf57a348a951317e9153d749859a4be00a754431f
7
- data.tar.gz: 51cad04784b645ba45a3ca5bc1324c6a934ac9cb3e16ffa98eb93162b693d632b57d344447ff8d3e5d04dc8cde5e1a74b254704be2289de3a8990c6eb35be46f
6
+ metadata.gz: 1470c6d6852059e60eac60cdbc1a5ccb01b6ec85be579120989453fa8e12b13780a0d1575e7988b65999bb84a91506819357aad8fa10180af529143b430c1b77
7
+ data.tar.gz: eeb13f704f85e80938239f607766664a5a8cf843aa7a8c36b790753646fae8aa1f7d351fc9dce36509e5d7b0e5b6d4ca4891a7c60f420767897257aab1143489
data/README.md CHANGED
@@ -23,10 +23,10 @@ It expects that you manually add ruby-dbus gem to your Gemfile, follow its docs.
23
23
 
24
24
  # Initialize connection and wrapper
25
25
  conn = DBus::SessionBus.instance
26
- bus = DBus::Wrapper::Bus.new(conn, /^monitored\.dbus\.name\.wildcard.*/)
26
+ bus = DBus::Wrapper::Bus.new(conn)
27
27
 
28
28
  # Initialize process watch
29
- ps = DBus::Wrapper::ProcessWatch.new(bus)
29
+ ps = DBus::Wrapper::ProcessWatch.new(bus, /\Amonitored\.dbus\.name\.wildcard.*/)
30
30
 
31
31
  # Bind to events
32
32
  ps.on(:registered) { |a| puts "Registered #{a}" }
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -92,16 +92,21 @@ module DBus
92
92
  end
93
93
  end
94
94
 
95
- @pending.keys.each do |name|
96
- @bus.method_call("org.freedesktop.DBus", "/", "org.freedesktop.DBus", "GetNameOwner", [[ DBus::Type::STRING, name]]) do |message|
97
- if message.is_a? DBus::Error
98
- raise NameResolutionRecoverableError, "Unable to get DBus ID of of DBus process #{name} (#{message}) - most probably it has disappeared during query"
99
- else
100
- register name, message.params.first
101
-
102
- @pending.delete name
103
-
104
- trigger :resolved if @pending.size == 0
95
+ if @pending.size == 0
96
+ trigger :resolved
97
+
98
+ else
99
+ @pending.keys.each do |name|
100
+ @bus.method_call("org.freedesktop.DBus", "/", "org.freedesktop.DBus", "GetNameOwner", [[ DBus::Type::STRING, name]]) do |message|
101
+ if message.is_a? DBus::Error
102
+ raise NameResolutionRecoverableError, "Unable to get DBus ID of of DBus process #{name} (#{message}) - most probably it has disappeared during query"
103
+ else
104
+ register name, message.params.first
105
+
106
+ @pending.delete name
107
+
108
+ trigger :resolved if @pending.size == 0
109
+ end
105
110
  end
106
111
  end
107
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-dbus-wrapper-process-watch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Lewandowski
@@ -14,14 +14,14 @@ dependencies:
14
14
  name: ruby-dbus-wrapper
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description: Allows to register nice callbacks when D-Bus processess appear or disappear
@@ -47,12 +47,12 @@ require_paths:
47
47
  - lib
48
48
  required_ruby_version: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - ">="
50
+ - - '>='
51
51
  - !ruby/object:Gem::Version
52
52
  version: 1.9.3
53
53
  required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ">="
55
+ - - '>='
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []