ruby-dbus 0.22.1 → 0.23.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +13 -0
- data/VERSION +1 -1
- data/doc/Reference.md +4 -4
- data/examples/service/complex-property.rb +2 -2
- data/examples/service/service_newapi.rb +2 -2
- data/lib/dbus/bus.rb +50 -302
- data/lib/dbus/logger.rb +3 -2
- data/lib/dbus/main.rb +66 -0
- data/lib/dbus/message.rb +6 -8
- data/lib/dbus/node_tree.rb +105 -0
- data/lib/dbus/object.rb +16 -7
- data/lib/dbus/object_manager.rb +2 -3
- data/lib/dbus/object_server.rb +119 -0
- data/lib/dbus/proxy_object.rb +4 -4
- data/lib/dbus/proxy_service.rb +95 -0
- data/lib/dbus.rb +9 -8
- data/spec/bus_connection_spec.rb +81 -0
- data/spec/coverage_helper.rb +39 -0
- data/spec/main_loop_spec.rb +14 -0
- data/spec/message_spec.rb +21 -0
- data/spec/mock-service/cockpit-dbustests.rb +29 -0
- data/spec/mock-service/com.redhat.Cockpit.DBusTests.xml +180 -0
- data/spec/mock-service/org.ruby.service.service +4 -0
- data/spec/mock-service/org.rubygems.ruby_dbus.DBusTests.service +4 -0
- data/spec/{service_newapi.rb → mock-service/spaghetti-monster.rb} +22 -10
- data/spec/node_spec.rb +1 -5
- data/spec/object_server_spec.rb +104 -0
- data/spec/object_spec.rb +30 -0
- data/spec/{bus_driver_spec.rb → proxy_service_spec.rb} +1 -1
- data/spec/spec_helper.rb +9 -45
- data/spec/thread_safety_spec.rb +9 -11
- data/spec/tools/dbus-launch-simple +4 -1
- data/spec/tools/test_env +26 -6
- metadata +18 -9
- data/spec/server_spec.rb +0 -55
- data/spec/service_spec.rb +0 -18
- data/spec/tools/test_server +0 -39
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.
|
4
|
+
version: 0.23.0.beta1
|
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: 2023-05
|
11
|
+
date: 2023-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rexml
|
@@ -147,17 +147,21 @@ files:
|
|
147
147
|
- lib/dbus/error.rb
|
148
148
|
- lib/dbus/introspect.rb
|
149
149
|
- lib/dbus/logger.rb
|
150
|
+
- lib/dbus/main.rb
|
150
151
|
- lib/dbus/marshall.rb
|
151
152
|
- lib/dbus/matchrule.rb
|
152
153
|
- lib/dbus/message.rb
|
153
154
|
- lib/dbus/message_queue.rb
|
155
|
+
- lib/dbus/node_tree.rb
|
154
156
|
- lib/dbus/object.rb
|
155
157
|
- lib/dbus/object_manager.rb
|
156
158
|
- lib/dbus/object_path.rb
|
159
|
+
- lib/dbus/object_server.rb
|
157
160
|
- lib/dbus/platform.rb
|
158
161
|
- lib/dbus/proxy_object.rb
|
159
162
|
- lib/dbus/proxy_object_factory.rb
|
160
163
|
- lib/dbus/proxy_object_interface.rb
|
164
|
+
- lib/dbus/proxy_service.rb
|
161
165
|
- lib/dbus/raw_message.rb
|
162
166
|
- lib/dbus/type.rb
|
163
167
|
- lib/dbus/xml.rb
|
@@ -166,11 +170,12 @@ files:
|
|
166
170
|
- spec/auth_spec.rb
|
167
171
|
- spec/binding_spec.rb
|
168
172
|
- spec/bus_and_xml_backend_spec.rb
|
169
|
-
- spec/
|
173
|
+
- spec/bus_connection_spec.rb
|
170
174
|
- spec/bus_name_spec.rb
|
171
175
|
- spec/bus_spec.rb
|
172
176
|
- spec/byte_array_spec.rb
|
173
177
|
- spec/client_robustness_spec.rb
|
178
|
+
- spec/coverage_helper.rb
|
174
179
|
- spec/data/marshall.yaml
|
175
180
|
- spec/data_spec.rb
|
176
181
|
- spec/emits_changed_signal_spec.rb
|
@@ -178,9 +183,16 @@ files:
|
|
178
183
|
- spec/introspect_xml_parser_spec.rb
|
179
184
|
- spec/introspection_spec.rb
|
180
185
|
- spec/main_loop_spec.rb
|
186
|
+
- spec/message_spec.rb
|
187
|
+
- spec/mock-service/cockpit-dbustests.rb
|
188
|
+
- spec/mock-service/com.redhat.Cockpit.DBusTests.xml
|
189
|
+
- spec/mock-service/org.ruby.service.service
|
190
|
+
- spec/mock-service/org.rubygems.ruby_dbus.DBusTests.service
|
191
|
+
- spec/mock-service/spaghetti-monster.rb
|
181
192
|
- spec/node_spec.rb
|
182
193
|
- spec/object_manager_spec.rb
|
183
194
|
- spec/object_path_spec.rb
|
195
|
+
- spec/object_server_spec.rb
|
184
196
|
- spec/object_spec.rb
|
185
197
|
- spec/packet_marshaller_spec.rb
|
186
198
|
- spec/packet_unmarshaller_spec.rb
|
@@ -188,11 +200,9 @@ files:
|
|
188
200
|
- spec/property_spec.rb
|
189
201
|
- spec/proxy_object_interface_spec.rb
|
190
202
|
- spec/proxy_object_spec.rb
|
203
|
+
- spec/proxy_service_spec.rb
|
191
204
|
- spec/raw_message_spec.rb
|
192
205
|
- spec/server_robustness_spec.rb
|
193
|
-
- spec/server_spec.rb
|
194
|
-
- spec/service_newapi.rb
|
195
|
-
- spec/service_spec.rb
|
196
206
|
- spec/session_bus_spec.rb
|
197
207
|
- spec/session_bus_spec_manual.rb
|
198
208
|
- spec/signal_spec.rb
|
@@ -201,7 +211,6 @@ files:
|
|
201
211
|
- spec/tools/dbus-launch-simple
|
202
212
|
- spec/tools/dbus-limited-session.conf
|
203
213
|
- spec/tools/test_env
|
204
|
-
- spec/tools/test_server
|
205
214
|
- spec/type_spec.rb
|
206
215
|
- spec/value_spec.rb
|
207
216
|
- spec/variant_spec.rb
|
@@ -221,9 +230,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
221
230
|
version: 2.4.0
|
222
231
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
232
|
requirements:
|
224
|
-
- - "
|
233
|
+
- - ">"
|
225
234
|
- !ruby/object:Gem::Version
|
226
|
-
version:
|
235
|
+
version: 1.3.1
|
227
236
|
requirements: []
|
228
237
|
rubygems_version: 3.3.26
|
229
238
|
signing_key:
|
data/spec/server_spec.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rspec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
# Test that a server survives various error cases
|
5
|
-
require_relative "spec_helper"
|
6
|
-
require "dbus"
|
7
|
-
|
8
|
-
class Foo < DBus::Object
|
9
|
-
dbus_interface "org.ruby.ServerTest" do
|
10
|
-
dbus_signal :signal_without_arguments
|
11
|
-
dbus_signal :signal_with_argument, "epsilon:d"
|
12
|
-
end
|
13
|
-
|
14
|
-
dbus_signal :signal_without_interface
|
15
|
-
rescue DBus::Object::UndefinedInterface
|
16
|
-
# raised by the preceding signal declaration
|
17
|
-
end
|
18
|
-
|
19
|
-
class Bar < DBus::Object
|
20
|
-
dbus_interface "org.ruby.ServerTest" do
|
21
|
-
# a valid Ruby symbol but an invalid DBus name; Ticket#38
|
22
|
-
dbus_signal :signal_with_a_bang!
|
23
|
-
end
|
24
|
-
rescue DBus::InvalidMethodName
|
25
|
-
# raised by the preceding signal declaration
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "ServerTest" do
|
29
|
-
before(:each) do
|
30
|
-
@bus = DBus::ASessionBus.new
|
31
|
-
@svc = @bus.request_service "org.ruby.server-test"
|
32
|
-
end
|
33
|
-
|
34
|
-
after(:each) do
|
35
|
-
@bus.proxy.ReleaseName "org.ruby.server-test"
|
36
|
-
end
|
37
|
-
|
38
|
-
it "tests unexporting an object" do
|
39
|
-
obj = Foo.new "/org/ruby/Foo"
|
40
|
-
@svc.export obj
|
41
|
-
expect(@svc.unexport(obj)).to be_a DBus::Object
|
42
|
-
end
|
43
|
-
|
44
|
-
it "tests unexporting an object not exported" do
|
45
|
-
obj = Foo.new "/org/ruby/Foo"
|
46
|
-
expect(@svc.unexport(obj)).to be false
|
47
|
-
end
|
48
|
-
|
49
|
-
it "tests emiting signals" do
|
50
|
-
obj = Foo.new "/org/ruby/Foo"
|
51
|
-
@svc.export obj
|
52
|
-
obj.signal_without_arguments
|
53
|
-
obj.signal_with_argument(-0.1)
|
54
|
-
end
|
55
|
-
end
|
data/spec/service_spec.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rspec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require_relative "spec_helper"
|
5
|
-
require "dbus"
|
6
|
-
|
7
|
-
describe "DBus::Service (server role)" do
|
8
|
-
let(:bus) { DBus::ASessionBus.new }
|
9
|
-
# This is the client role, but the server role API is bad
|
10
|
-
# and for the one test there is no difference
|
11
|
-
let(:service) { bus["org.ruby.service"] }
|
12
|
-
|
13
|
-
describe "#descendants_for" do
|
14
|
-
it "raises for not existing path" do
|
15
|
-
expect { service.descendants_for("/notthere") }.to raise_error(ArgumentError)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/spec/tools/test_server
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
#! /bin/sh
|
2
|
-
# A wrapper for DBus tests
|
3
|
-
# Run a server (directly or by dbus activation) and then the test
|
4
|
-
# $0 server [args...] -- test [args...]
|
5
|
-
set -o errexit
|
6
|
-
|
7
|
-
while [ "$1" != "--" ]; do
|
8
|
-
SERVER="$SERVER $1"
|
9
|
-
shift
|
10
|
-
done
|
11
|
-
shift # --
|
12
|
-
|
13
|
-
setup_activation () {
|
14
|
-
SDIR=$XDG_DATA_DIRS/dbus-1/services
|
15
|
-
mkdir -p $SDIR
|
16
|
-
# FIXME Name is hardcoded
|
17
|
-
cat <<EOF > $SDIR/test.service
|
18
|
-
[D-BUS Service]
|
19
|
-
Name=org.ruby.service
|
20
|
-
Exec=$SERVER
|
21
|
-
EOF
|
22
|
-
}
|
23
|
-
|
24
|
-
run_server () {
|
25
|
-
echo -n "Hey, server, get on da bus... "
|
26
|
-
# start the server
|
27
|
-
$SERVER & sleep 3
|
28
|
-
echo "off we go!"
|
29
|
-
}
|
30
|
-
|
31
|
-
export XDG_DATA_DIRS=`mktemp -d dbus.activation.XXXXXX`
|
32
|
-
RM_FILES="$RM_FILES $XDG_DATA_DIRS"
|
33
|
-
setup_activation
|
34
|
-
#run_server
|
35
|
-
|
36
|
-
# Clean up at exit.
|
37
|
-
trap "rm -rf \$RM_FILES" EXIT TERM INT
|
38
|
-
|
39
|
-
"$@"
|