ruby-dbus 0.14.0 → 0.14.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/NEWS.md +8 -0
- data/VERSION +1 -1
- data/lib/dbus/bus.rb +2 -1
- data/ruby-dbus.gemspec +3 -3
- data/spec/signal_spec.rb +31 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ca1c79fb320bdde63e80e01a065481bbb705b75
|
4
|
+
data.tar.gz: 3a85e1c88c87d352fc2e838f64df72ccf90e4ddf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cced70bcf377786b5e5b28d29fbccdc0513e9535af05dcc2b0580b5eb860fbe0f1822c46aedc910c4c8479ba0f21e5b3927df48d283fd121fc980a49bd015d9b
|
7
|
+
data.tar.gz: e38930b71af6c62a9dad723001ccdd8bb059d1130b7089b210c1e35334faa3e6d413823abdf70ccaf2af6d49a9116b0afa4fc68135ff7f1936504f7b77d729cf
|
data/NEWS.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## Ruby D-Bus 0.14.1 - 2018-01-05
|
6
|
+
|
7
|
+
Bug fixes:
|
8
|
+
* Allow registering signal handlers while a signal is being handled
|
9
|
+
([#70][], Jan Biniok).
|
10
|
+
|
11
|
+
[#70]: https://github.com/mvidner/ruby-dbus/pull/70
|
12
|
+
|
5
13
|
## Ruby D-Bus 0.14.0 - 2017-10-13
|
6
14
|
|
7
15
|
Bug fixes:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.14.
|
1
|
+
0.14.1
|
data/lib/dbus/bus.rb
CHANGED
@@ -538,7 +538,8 @@ module DBus
|
|
538
538
|
end
|
539
539
|
when DBus::Message::SIGNAL
|
540
540
|
# the signal can match multiple different rules
|
541
|
-
|
541
|
+
# clone to allow new signale handlers to be registered
|
542
|
+
@signal_matchrules.dup.each do |mrs, slot|
|
542
543
|
if DBus::MatchRule.new.from_s(mrs).match(m)
|
543
544
|
slot.call(m)
|
544
545
|
end
|
data/ruby-dbus.gemspec
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
require "rubygems"
|
3
|
-
require "rake"
|
4
3
|
|
5
4
|
GEMSPEC = Gem::Specification.new do |s|
|
6
5
|
s.name = "ruby-dbus"
|
@@ -12,10 +11,11 @@ GEMSPEC = Gem::Specification.new do |s|
|
|
12
11
|
s.author = "Ruby DBus Team"
|
13
12
|
s.email = "ruby-dbus-devel@lists.luon.net"
|
14
13
|
s.homepage = "https://trac.luon.net/ruby-dbus"
|
15
|
-
s.files =
|
14
|
+
s.files = Dir[
|
16
15
|
"{doc,examples,lib,spec}/**/*",
|
17
16
|
"COPYING", "NEWS.md", "Rakefile", "README.md",
|
18
|
-
"ruby-dbus.gemspec", "VERSION", ".rspec"
|
17
|
+
"ruby-dbus.gemspec", "VERSION", ".rspec"
|
18
|
+
]
|
19
19
|
s.require_path = "lib"
|
20
20
|
|
21
21
|
s.required_ruby_version = ">= 2.0.0"
|
data/spec/signal_spec.rb
CHANGED
@@ -3,6 +3,19 @@
|
|
3
3
|
require_relative "spec_helper"
|
4
4
|
require "dbus"
|
5
5
|
|
6
|
+
def new_quitter(main_loop)
|
7
|
+
Thread.new do
|
8
|
+
DBus.logger.debug "sleep before quit"
|
9
|
+
# FIXME: if we sleep for too long
|
10
|
+
# the socket will be drained and we deadlock in a select.
|
11
|
+
# It could be worked around by sending ourselves a Unix signal
|
12
|
+
# (with a dummy handler) to interrupt the select
|
13
|
+
sleep 1
|
14
|
+
DBus.logger.debug "will quit"
|
15
|
+
main_loop.quit
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
6
19
|
describe "SignalHandlerTest" do
|
7
20
|
before(:each) do
|
8
21
|
@session_bus = DBus::ASessionBus.new
|
@@ -32,16 +45,7 @@ describe "SignalHandlerTest" do
|
|
32
45
|
DBus.logger.debug "will begin"
|
33
46
|
@obj.LongTaskBegin 3
|
34
47
|
|
35
|
-
quitter =
|
36
|
-
DBus.logger.debug "sleep before quit"
|
37
|
-
# FIXME: if we sleep for too long
|
38
|
-
# the socket will be drained and we deadlock in a select.
|
39
|
-
# It could be worked around by sending ourselves a Unix signal
|
40
|
-
# (with a dummy handler) to interrupt the select
|
41
|
-
sleep 1
|
42
|
-
DBus.logger.debug "will quit"
|
43
|
-
@loop.quit
|
44
|
-
end
|
48
|
+
quitter = new_quitter(@loop)
|
45
49
|
@loop.run
|
46
50
|
quitter.join
|
47
51
|
|
@@ -60,12 +64,7 @@ describe "SignalHandlerTest" do
|
|
60
64
|
counter += 1
|
61
65
|
end
|
62
66
|
@obj.LongTaskBegin 3
|
63
|
-
quitter =
|
64
|
-
DBus.logger.debug "sleep before quit"
|
65
|
-
sleep 1
|
66
|
-
DBus.logger.debug "will quit"
|
67
|
-
@loop.quit
|
68
|
-
end
|
67
|
+
quitter = new_quitter(@loop)
|
69
68
|
@loop.run
|
70
69
|
quitter.join
|
71
70
|
|
@@ -75,6 +74,22 @@ describe "SignalHandlerTest" do
|
|
75
74
|
expect { @intf.on_signal "to", "many", "yarrrrr!" }.to raise_error(ArgumentError)
|
76
75
|
end
|
77
76
|
|
77
|
+
it "is possible to add signal handlers from within handlers" do
|
78
|
+
ended = false
|
79
|
+
@intf.on_signal "LongTaskStart" do
|
80
|
+
@intf.on_signal "LongTaskEnd" do
|
81
|
+
ended = true
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
@obj.LongTaskBegin 3
|
86
|
+
quitter = new_quitter(@loop)
|
87
|
+
@loop.run
|
88
|
+
quitter.join
|
89
|
+
|
90
|
+
expect(ended).to eq(true)
|
91
|
+
end
|
92
|
+
|
78
93
|
it "tests too many rules" do
|
79
94
|
100.times do
|
80
95
|
@obj.on_signal "Whichever" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-dbus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruby DBus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|