ruby-dbus 0.14.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/NEWS.md +44 -0
- data/README.md +3 -5
- data/Rakefile +26 -8
- data/VERSION +1 -1
- data/doc/Reference.md +84 -1
- data/examples/doc/_extract_examples +5 -0
- data/examples/gdbus/gdbus +21 -20
- data/examples/service/call_service.rb +1 -1
- data/lib/dbus/auth.rb +8 -8
- data/lib/dbus/bus.rb +23 -11
- data/lib/dbus/bus_name.rb +27 -0
- data/lib/dbus/core_ext/class/attribute.rb +23 -41
- data/lib/dbus/core_ext/module/redefine_method.rb +51 -0
- data/lib/dbus/introspect.rb +71 -26
- data/lib/dbus/marshall.rb +2 -1
- data/lib/dbus/message_queue.rb +17 -14
- data/lib/dbus/object.rb +380 -0
- data/lib/dbus/object_path.rb +24 -0
- data/lib/dbus/proxy_object.rb +11 -2
- data/lib/dbus/proxy_object_interface.rb +1 -0
- data/lib/dbus/type.rb +18 -0
- data/lib/dbus/xml.rb +4 -8
- data/lib/dbus.rb +3 -2
- data/ruby-dbus.gemspec +11 -9
- data/spec/binding_spec.rb +6 -2
- data/spec/bus_name_spec.rb +25 -0
- data/spec/client_robustness_spec.rb +25 -0
- data/spec/introspect_xml_parser_spec.rb +13 -13
- data/spec/main_loop_spec.rb +1 -1
- data/spec/object_path_spec.rb +23 -0
- data/spec/property_spec.rb +53 -3
- data/spec/proxy_object_spec.rb +9 -0
- data/spec/service_newapi.rb +20 -66
- data/spec/session_bus_spec.rb +6 -6
- data/spec/signal_spec.rb +33 -18
- data/spec/spec_helper.rb +23 -11
- data/spec/tools/dbus-limited-session.conf +4 -0
- data/spec/type_spec.rb +2 -2
- metadata +32 -15
- data/lib/dbus/core_ext/array/extract_options.rb +0 -31
- data/lib/dbus/core_ext/kernel/singleton_class.rb +0 -8
- data/lib/dbus/core_ext/module/remove_method.rb +0 -14
- data/lib/dbus/export.rb +0 -130
data/spec/main_loop_spec.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env rspec
|
2
|
+
require_relative "spec_helper"
|
3
|
+
require "dbus"
|
4
|
+
|
5
|
+
describe DBus::ObjectPath do
|
6
|
+
describe ".valid?" do
|
7
|
+
it "recognizes valid paths" do
|
8
|
+
expect(described_class.valid?("/")).to be_truthy
|
9
|
+
expect(described_class.valid?("/99Numbers/_And_Underscores/anywhere")).to be_truthy
|
10
|
+
long_name = "/A23456789" * 42
|
11
|
+
# no 255 character limit for object paths
|
12
|
+
expect(described_class.valid?(long_name)).to be_truthy
|
13
|
+
end
|
14
|
+
|
15
|
+
it "recognizes invalid paths" do
|
16
|
+
expect(described_class.valid?("")).to be_falsey
|
17
|
+
expect(described_class.valid?("/Empty//Component")).to be_falsey
|
18
|
+
expect(described_class.valid?("/EmptyLastComponent/")).to be_falsey
|
19
|
+
expect(described_class.valid?("/Invalid Character")).to be_falsey
|
20
|
+
expect(described_class.valid?("/Invalid-Character")).to be_falsey
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/spec/property_spec.rb
CHANGED
@@ -4,8 +4,8 @@ require "dbus"
|
|
4
4
|
|
5
5
|
describe "PropertyTest" do
|
6
6
|
before(:each) do
|
7
|
-
session_bus = DBus::ASessionBus.new
|
8
|
-
@svc = session_bus.service("org.ruby.service")
|
7
|
+
@session_bus = DBus::ASessionBus.new
|
8
|
+
@svc = @session_bus.service("org.ruby.service")
|
9
9
|
@obj = @svc.object("/org/ruby/MyInstance")
|
10
10
|
@iface = @obj["org.ruby.SampleInterface"]
|
11
11
|
end
|
@@ -21,6 +21,10 @@ describe "PropertyTest" do
|
|
21
21
|
expect(iface["ReadMe"]).to eq("READ ME")
|
22
22
|
end
|
23
23
|
|
24
|
+
it "gets an error when reading a property whose implementation raises" do
|
25
|
+
expect { @iface["Explosive"] }.to raise_error(DBus::Error, /Something failed/)
|
26
|
+
end
|
27
|
+
|
24
28
|
it "tests property nonreading" do
|
25
29
|
expect { @iface["WriteMe"] }.to raise_error(DBus::Error, /not readable/)
|
26
30
|
end
|
@@ -31,7 +35,7 @@ describe "PropertyTest" do
|
|
31
35
|
end
|
32
36
|
|
33
37
|
# https://github.com/mvidner/ruby-dbus/pull/19
|
34
|
-
it "tests service select timeout" do
|
38
|
+
it "tests service select timeout", slow: true do
|
35
39
|
@iface["ReadOrWriteMe"] = "VALUE"
|
36
40
|
expect(@iface["ReadOrWriteMe"]).to eq("VALUE")
|
37
41
|
# wait for the service to become idle
|
@@ -64,4 +68,50 @@ describe "PropertyTest" do
|
|
64
68
|
it "tests unknown property writing" do
|
65
69
|
expect { @iface["Spoon"] = "FPRK" }.to raise_error(DBus::Error, /not found/)
|
66
70
|
end
|
71
|
+
|
72
|
+
it "errors for a property on an unknown interface" do
|
73
|
+
# our idiomatic way would error out on interface lookup already,
|
74
|
+
# so do it the low level way
|
75
|
+
prop_if = @obj[DBus::PROPERTY_INTERFACE]
|
76
|
+
expect { prop_if.Get("org.ruby.NoSuchInterface", "SomeProperty") }.to raise_error(DBus::Error) do |e|
|
77
|
+
expect(e.name).to match(/UnknownProperty/)
|
78
|
+
expect(e.message).to match(/no such interface/)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
it "errors for GetAll on an unknown interface" do
|
83
|
+
# no idiomatic way?
|
84
|
+
# so do it the low level way
|
85
|
+
prop_if = @obj[DBus::PROPERTY_INTERFACE]
|
86
|
+
expect { prop_if.GetAll("org.ruby.NoSuchInterface") }.to raise_error(DBus::Error) do |e|
|
87
|
+
expect(e.name).to match(/UnknownProperty/)
|
88
|
+
expect(e.message).to match(/no such interface/)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
it "receives a PropertiesChanged signal", slow: true do
|
93
|
+
received = {}
|
94
|
+
|
95
|
+
# TODO: for client side, provide a helper on_properties_changed,
|
96
|
+
# or automate it even more in ProxyObject, ProxyObjectInterface
|
97
|
+
prop_if = @obj[DBus::PROPERTY_INTERFACE]
|
98
|
+
prop_if.on_signal("PropertiesChanged") do |_interface_name, changed_props, _invalidated_props|
|
99
|
+
received.merge!(changed_props)
|
100
|
+
end
|
101
|
+
|
102
|
+
@iface["ReadOrWriteMe"] = "VALUE"
|
103
|
+
|
104
|
+
# loop to process the signal. complicated :-( see signal_spec.rb
|
105
|
+
loop = DBus::Main.new
|
106
|
+
loop << @session_bus
|
107
|
+
quitter = Thread.new do
|
108
|
+
sleep 1
|
109
|
+
loop.quit
|
110
|
+
end
|
111
|
+
loop.run
|
112
|
+
# quitter has told loop.run to quit
|
113
|
+
quitter.join
|
114
|
+
|
115
|
+
expect(received["ReadOrWriteMe"]).to eq("VALUE")
|
116
|
+
end
|
67
117
|
end
|
data/spec/proxy_object_spec.rb
CHANGED
@@ -38,5 +38,14 @@ describe DBus::ProxyObject do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
describe "#[]" do
|
43
|
+
it "raises when the interface is not found" do
|
44
|
+
obj = svc["/org/ruby/MyInstance"]
|
45
|
+
expect { obj["org.ruby.NoSuchInterface"] }.to raise_error(DBus::Error) do |e|
|
46
|
+
expect(e.message).to match(/no such interface/)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
41
50
|
end
|
42
51
|
end
|
data/spec/service_newapi.rb
CHANGED
@@ -59,6 +59,26 @@ class Test < DBus::Object
|
|
59
59
|
dbus_method :mirror_byte_array, "in bytes:ay, out mirrored:ay" do |bytes|
|
60
60
|
[bytes]
|
61
61
|
end
|
62
|
+
|
63
|
+
# Properties:
|
64
|
+
# ReadMe:string, returns "READ ME" at first, then what WriteMe received
|
65
|
+
# WriteMe:string
|
66
|
+
# ReadOrWriteMe:string, returns "READ OR WRITE ME" at first
|
67
|
+
dbus_attr_accessor :read_or_write_me, "s"
|
68
|
+
dbus_attr_reader :read_me, "s"
|
69
|
+
|
70
|
+
def write_me=(value)
|
71
|
+
@read_me = value
|
72
|
+
end
|
73
|
+
dbus_writer :write_me, "s"
|
74
|
+
|
75
|
+
dbus_attr_writer :password, "s"
|
76
|
+
|
77
|
+
# a property that raises when client tries to read it
|
78
|
+
def explosive
|
79
|
+
raise "Something failed"
|
80
|
+
end
|
81
|
+
dbus_reader :explosive, "s"
|
62
82
|
end
|
63
83
|
|
64
84
|
# closing and reopening the same interface
|
@@ -118,72 +138,6 @@ class Test < DBus::Object
|
|
118
138
|
dbus_signal :LongTaskStart
|
119
139
|
dbus_signal :LongTaskEnd
|
120
140
|
end
|
121
|
-
|
122
|
-
# Properties:
|
123
|
-
# ReadMe:string, returns "READ ME" at first, then what WriteMe received
|
124
|
-
# WriteMe:string
|
125
|
-
# ReadOrWriteMe:string, returns "READ OR WRITE ME" at first
|
126
|
-
dbus_interface PROPERTY_INTERFACE do
|
127
|
-
dbus_method :Get, "in interface:s, in propname:s, out value:v" do |interface, propname|
|
128
|
-
unless interface == INTERFACE
|
129
|
-
raise DBus.error("org.freedesktop.DBus.Error.UnknownInterface"),
|
130
|
-
"Interface '#{interface}' not found on object '#{@path}'"
|
131
|
-
end
|
132
|
-
|
133
|
-
case propname
|
134
|
-
when "ReadMe"
|
135
|
-
[@read_me]
|
136
|
-
when "ReadOrWriteMe"
|
137
|
-
[@read_or_write_me]
|
138
|
-
when "WriteMe"
|
139
|
-
raise DBus.error("org.freedesktop.DBus.Error.InvalidArgs"),
|
140
|
-
"Property '#{interface}.#{propname}' (on object '#{@path}') is not readable"
|
141
|
-
else
|
142
|
-
# what should happen for unknown properties
|
143
|
-
# plasma: InvalidArgs (propname), UnknownInterface (interface)
|
144
|
-
raise DBus.error("org.freedesktop.DBus.Error.InvalidArgs"),
|
145
|
-
"Property '#{interface}.#{propname}' not found on object '#{@path}'"
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
dbus_method :Set, "in interface:s, in propname:s, in value:v" do |interface, propname, value|
|
150
|
-
unless interface == INTERFACE
|
151
|
-
raise DBus.error("org.freedesktop.DBus.Error.UnknownInterface"),
|
152
|
-
"Interface '#{interface}' not found on object '#{@path}'"
|
153
|
-
end
|
154
|
-
|
155
|
-
case propname
|
156
|
-
when "ReadMe"
|
157
|
-
raise DBus.error("org.freedesktop.DBus.Error.InvalidArgs"),
|
158
|
-
"Property '#{interface}.#{propname}' (on object '#{@path}') is not writable"
|
159
|
-
when "ReadOrWriteMe"
|
160
|
-
@read_or_write_me = value
|
161
|
-
self.PropertiesChanged(interface, { propname => value }, [])
|
162
|
-
when "WriteMe"
|
163
|
-
@read_me = value
|
164
|
-
self.PropertiesChanged(interface, { "ReadMe" => value }, [])
|
165
|
-
else
|
166
|
-
raise DBus.error("org.freedesktop.DBus.Error.InvalidArgs"),
|
167
|
-
"Property '#{interface}.#{propname}' not found on object '#{@path}'"
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
dbus_method :GetAll, "in interface:s, out value:a{sv}" do |interface|
|
172
|
-
unless interface == INTERFACE
|
173
|
-
raise DBus.error("org.freedesktop.DBus.Error.UnknownInterface"),
|
174
|
-
"Interface '#{interface}' not found on object '#{@path}'"
|
175
|
-
end
|
176
|
-
|
177
|
-
[
|
178
|
-
{
|
179
|
-
"ReadMe" => @read_me,
|
180
|
-
"ReadOrWriteMe" => @read_or_write_me
|
181
|
-
}
|
182
|
-
]
|
183
|
-
end
|
184
|
-
|
185
|
-
dbus_signal :PropertiesChanged, "interface:s, changed_properties:a{sv}, invalidated_properties:as"
|
186
|
-
end
|
187
141
|
end
|
188
142
|
|
189
143
|
class Derived < Test
|
data/spec/session_bus_spec.rb
CHANGED
@@ -37,31 +37,31 @@ describe DBus::ASessionBus do
|
|
37
37
|
|
38
38
|
context "when DBUS_SESSION_BUS_ADDRESS from file is surrounded by quotation marks" do
|
39
39
|
it "returns session bus address without single quotation marks" do
|
40
|
-
expect(File).to receive(:open).with(session_bus_file_path) { <<-
|
40
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-TEXT.gsub(/^\s*/, "") }
|
41
41
|
DBUS_SESSION_BUS_ADDRESS='#{dbus_session_bus_address}'
|
42
42
|
DBUS_SESSION_BUS_PID=12345
|
43
43
|
DBUS_SESSION_BUS_WINDOWID=12345678
|
44
|
-
|
44
|
+
TEXT
|
45
45
|
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
46
46
|
end
|
47
47
|
|
48
48
|
it "returns session bus address without double quotation marks" do
|
49
|
-
expect(File).to receive(:open).with(session_bus_file_path) { <<-
|
49
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-TEXT.gsub(/^\s*/, "") }
|
50
50
|
DBUS_SESSION_BUS_ADDRESS="#{dbus_session_bus_address}"
|
51
51
|
DBUS_SESSION_BUS_PID=12345
|
52
52
|
DBUS_SESSION_BUS_WINDOWID=12345678
|
53
|
-
|
53
|
+
TEXT
|
54
54
|
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
context "when DBUS_SESSION_BUS_ADDRESS from file is not surrounded by any quotation marks" do
|
59
59
|
it "returns session bus address as it is" do
|
60
|
-
expect(File).to receive(:open).with(session_bus_file_path) { <<-
|
60
|
+
expect(File).to receive(:open).with(session_bus_file_path) { <<-TEXT.gsub(/^\s*/, "") }
|
61
61
|
DBUS_SESSION_BUS_ADDRESS=#{dbus_session_bus_address}
|
62
62
|
DBUS_SESSION_BUS_PID=12345
|
63
63
|
DBUS_SESSION_BUS_WINDOWID=12345678
|
64
|
-
|
64
|
+
TEXT
|
65
65
|
expect(DBus::ASessionBus.address_from_file).to eq(dbus_session_bus_address)
|
66
66
|
end
|
67
67
|
end
|
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
|
@@ -16,7 +29,7 @@ describe "SignalHandlerTest" do
|
|
16
29
|
end
|
17
30
|
|
18
31
|
# testing for commit 017c83 (kkaempf)
|
19
|
-
it "tests overriding a handler" do
|
32
|
+
it "tests overriding a handler", slow: true do
|
20
33
|
DBus.logger.debug "Inside test_overriding_a_handler"
|
21
34
|
counter = 0
|
22
35
|
|
@@ -32,23 +45,14 @@ 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
|
|
48
52
|
expect(counter).to eq(1)
|
49
53
|
end
|
50
54
|
|
51
|
-
it "tests on signal overload" do
|
55
|
+
it "tests on signal overload", slow: true do
|
52
56
|
DBus.logger.debug "Inside test_on_signal_overload"
|
53
57
|
counter = 0
|
54
58
|
started = false
|
@@ -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", slow: true 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
|
data/spec/spec_helper.rb
CHANGED
@@ -2,8 +2,7 @@ coverage = if ENV["COVERAGE"]
|
|
2
2
|
ENV["COVERAGE"] == "true"
|
3
3
|
else
|
4
4
|
# heuristics: enable for interactive builds (but not in OBS)
|
5
|
-
|
6
|
-
ENV["DISPLAY"] || ENV["TRAVIS"]
|
5
|
+
ENV["DISPLAY"]
|
7
6
|
end
|
8
7
|
|
9
8
|
if coverage
|
@@ -15,11 +14,24 @@ if coverage
|
|
15
14
|
# do not cover the activesupport helpers
|
16
15
|
SimpleCov.add_filter "/core_ext/"
|
17
16
|
|
18
|
-
# use coveralls for on-line code coverage reporting at Travis CI
|
19
|
-
if ENV["TRAVIS"]
|
20
|
-
require "coveralls"
|
21
|
-
end
|
22
17
|
SimpleCov.start
|
18
|
+
|
19
|
+
# additionally use the LCOV format for on-line code coverage reporting at CI
|
20
|
+
if ENV["COVERAGE_LCOV"] == "true"
|
21
|
+
require "simplecov-lcov"
|
22
|
+
|
23
|
+
SimpleCov::Formatter::LcovFormatter.config do |c|
|
24
|
+
c.report_with_single_file = true
|
25
|
+
# this is the default Coveralls GitHub Action location
|
26
|
+
# https://github.com/marketplace/actions/coveralls-github-action
|
27
|
+
c.single_report_path = "coverage/lcov.info"
|
28
|
+
end
|
29
|
+
|
30
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
31
|
+
SimpleCov::Formatter::HTMLFormatter,
|
32
|
+
SimpleCov::Formatter::LcovFormatter
|
33
|
+
]
|
34
|
+
end
|
23
35
|
end
|
24
36
|
|
25
37
|
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
@@ -92,11 +104,11 @@ def with_service_by_activation(&block)
|
|
92
104
|
FileUtils.mkdir_p service_dir
|
93
105
|
# file name actually does not need to match the service name
|
94
106
|
File.open("#{service_dir}/#{name}.service", "w") do |f|
|
95
|
-
s =
|
96
|
-
[D-BUS Service]
|
97
|
-
Name=#{name}
|
98
|
-
Exec=#{exec}
|
99
|
-
|
107
|
+
s = <<-TEXT.gsub(/^\s*/, "")
|
108
|
+
[D-BUS Service]
|
109
|
+
Name=#{name}
|
110
|
+
Exec=#{exec}
|
111
|
+
TEXT
|
100
112
|
f.write(s)
|
101
113
|
end
|
102
114
|
|
@@ -25,4 +25,8 @@
|
|
25
25
|
Instead, lower some so that we can test resource leaks. -->
|
26
26
|
<limit name="max_match_rules_per_connection">50</limit><!-- was 512 -->
|
27
27
|
|
28
|
+
<!--
|
29
|
+
dbus-daemon[1700]: [session uid=1001 pid=1700] Unable to set up new connection: Failed to get AppArmor confinement information of socket peer: Protocol not available
|
30
|
+
-->
|
31
|
+
<apparmor mode="disabled"/>
|
28
32
|
</busconfig>
|
data/spec/type_spec.rb
CHANGED
@@ -4,13 +4,13 @@ require "dbus"
|
|
4
4
|
|
5
5
|
describe DBus do
|
6
6
|
describe ".type" do
|
7
|
-
|
7
|
+
["i", "ai", "a(ii)", "aai"].each do |s|
|
8
8
|
it "parses some type #{s}" do
|
9
9
|
expect(DBus.type(s).to_s).to be_eql s
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
["aa", "(ii", "ii)", "hrmp"].each do |s|
|
14
14
|
it "raises exception for invalid type #{s}" do
|
15
15
|
expect { DBus.type(s).to_s }.to raise_error DBus::Type::SignatureException
|
16
16
|
end
|
metadata
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-dbus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
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: 2022-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rexml
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
|
-
type: :
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.50.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.50.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,8 +94,22 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov-lcov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Pure Ruby module for interaction with D-Bus IPC system
|
98
|
-
email:
|
112
|
+
email: martin.github@vidner.net
|
99
113
|
executables: []
|
100
114
|
extensions: []
|
101
115
|
extra_rdoc_files: []
|
@@ -127,18 +141,18 @@ files:
|
|
127
141
|
- lib/dbus/api_options.rb
|
128
142
|
- lib/dbus/auth.rb
|
129
143
|
- lib/dbus/bus.rb
|
130
|
-
- lib/dbus/
|
144
|
+
- lib/dbus/bus_name.rb
|
131
145
|
- lib/dbus/core_ext/class/attribute.rb
|
132
|
-
- lib/dbus/core_ext/
|
133
|
-
- lib/dbus/core_ext/module/remove_method.rb
|
146
|
+
- lib/dbus/core_ext/module/redefine_method.rb
|
134
147
|
- lib/dbus/error.rb
|
135
|
-
- lib/dbus/export.rb
|
136
148
|
- lib/dbus/introspect.rb
|
137
149
|
- lib/dbus/logger.rb
|
138
150
|
- lib/dbus/marshall.rb
|
139
151
|
- lib/dbus/matchrule.rb
|
140
152
|
- lib/dbus/message.rb
|
141
153
|
- lib/dbus/message_queue.rb
|
154
|
+
- lib/dbus/object.rb
|
155
|
+
- lib/dbus/object_path.rb
|
142
156
|
- lib/dbus/proxy_object.rb
|
143
157
|
- lib/dbus/proxy_object_factory.rb
|
144
158
|
- lib/dbus/proxy_object_interface.rb
|
@@ -149,12 +163,15 @@ files:
|
|
149
163
|
- spec/binding_spec.rb
|
150
164
|
- spec/bus_and_xml_backend_spec.rb
|
151
165
|
- spec/bus_driver_spec.rb
|
166
|
+
- spec/bus_name_spec.rb
|
152
167
|
- spec/bus_spec.rb
|
153
168
|
- spec/byte_array_spec.rb
|
169
|
+
- spec/client_robustness_spec.rb
|
154
170
|
- spec/err_msg_spec.rb
|
155
171
|
- spec/introspect_xml_parser_spec.rb
|
156
172
|
- spec/introspection_spec.rb
|
157
173
|
- spec/main_loop_spec.rb
|
174
|
+
- spec/object_path_spec.rb
|
158
175
|
- spec/property_spec.rb
|
159
176
|
- spec/proxy_object_spec.rb
|
160
177
|
- spec/server_robustness_spec.rb
|
@@ -172,9 +189,9 @@ files:
|
|
172
189
|
- spec/type_spec.rb
|
173
190
|
- spec/value_spec.rb
|
174
191
|
- spec/variant_spec.rb
|
175
|
-
homepage: https://
|
192
|
+
homepage: https://github.com/mvidner/ruby-dbus
|
176
193
|
licenses:
|
177
|
-
- LGPL
|
194
|
+
- LGPL-2.1
|
178
195
|
metadata: {}
|
179
196
|
post_install_message:
|
180
197
|
rdoc_options: []
|
@@ -184,7 +201,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
201
|
requirements:
|
185
202
|
- - ">="
|
186
203
|
- !ruby/object:Gem::Version
|
187
|
-
version: 2.
|
204
|
+
version: 2.1.0
|
188
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
206
|
requirements:
|
190
207
|
- - ">="
|
@@ -192,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
209
|
version: '0'
|
193
210
|
requirements: []
|
194
211
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.
|
212
|
+
rubygems_version: 2.7.6.3
|
196
213
|
signing_key:
|
197
214
|
specification_version: 4
|
198
215
|
summary: Ruby module for interaction with D-Bus
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# copied from activesupport/core_ext from Rails, MIT license
|
2
|
-
# https://github.com/rails/rails/tree/5aa869861c192daceafe3a3ee50eb93f5a2b7bd2/activesupport/lib/active_support/core_ext
|
3
|
-
class Hash
|
4
|
-
# By default, only instances of Hash itself are extractable.
|
5
|
-
# Subclasses of Hash may implement this method and return
|
6
|
-
# true to declare themselves as extractable. If a Hash
|
7
|
-
# is extractable, Array#extract_options! pops it from
|
8
|
-
# the Array when it is the last element of the Array.
|
9
|
-
def extractable_options?
|
10
|
-
instance_of?(Hash)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class Array
|
15
|
-
# Extracts options from a set of arguments. Removes and returns the last
|
16
|
-
# element in the array if it's a hash, otherwise returns a blank hash.
|
17
|
-
#
|
18
|
-
# def options(*args)
|
19
|
-
# args.extract_options!
|
20
|
-
# end
|
21
|
-
#
|
22
|
-
# options(1, 2) # => {}
|
23
|
-
# options(1, 2, a: :b) # => {:a=>:b}
|
24
|
-
def extract_options!
|
25
|
-
if last.is_a?(Hash) && last.extractable_options?
|
26
|
-
pop
|
27
|
-
else
|
28
|
-
{}
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# copied from activesupport/core_ext from Rails, MIT license
|
2
|
-
# https://github.com/rails/rails/tree/5aa869861c192daceafe3a3ee50eb93f5a2b7bd2/activesupport/lib/active_support/core_ext
|
3
|
-
module Kernel
|
4
|
-
# class_eval on an object acts like singleton_class.class_eval.
|
5
|
-
def class_eval(*args, &block)
|
6
|
-
singleton_class.class_eval(*args, &block)
|
7
|
-
end
|
8
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# copied from activesupport/core_ext from Rails, MIT license
|
2
|
-
# https://github.com/rails/rails/tree/5aa869861c192daceafe3a3ee50eb93f5a2b7bd2/activesupport/lib/active_support/core_ext
|
3
|
-
class Module
|
4
|
-
def remove_possible_method(method)
|
5
|
-
if method_defined?(method) || private_method_defined?(method)
|
6
|
-
undef_method(method)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def redefine_method(method, &block)
|
11
|
-
remove_possible_method(method)
|
12
|
-
define_method(method, &block)
|
13
|
-
end
|
14
|
-
end
|