ruby-dbus 0.23.0.beta1 → 0.23.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +38 -3
- data/VERSION +1 -1
- data/doc/Reference.md +1 -1
- data/examples/no-bus/pulseaudio.rb +50 -0
- data/examples/utils/listnames.rb +9 -1
- data/lib/dbus/bus.rb +125 -432
- data/lib/dbus/connection.rb +363 -0
- data/lib/dbus/object.rb +46 -18
- data/lib/dbus/object_manager.rb +5 -1
- data/lib/dbus/object_server.rb +44 -14
- data/lib/dbus/org.freedesktop.DBus.xml +97 -0
- data/lib/dbus/proxy_service.rb +14 -2
- data/lib/dbus.rb +1 -0
- data/ruby-dbus.gemspec +1 -1
- data/spec/bus_connection_spec.rb +27 -15
- data/spec/connection_spec.rb +37 -0
- data/spec/dbus_spec.rb +22 -0
- data/spec/mock-service/spaghetti-monster.rb +4 -5
- data/spec/object_server_spec.rb +58 -24
- data/spec/object_spec.rb +16 -0
- data/spec/proxy_service_spec.rb +12 -7
- data/spec/tools/dbus-limited-session.conf +3 -0
- metadata +10 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2465a9a90d0b4837640d475566edfde23aee4dc1d7d439d76d1f861b71f13033
|
4
|
+
data.tar.gz: 906288ee9d180ff0bfd4e53f45982040f240da983e23c818acd91d449d9f7f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2939e81cff3f5db2dd768f9e0f1c04159b0285501c73840f14dd8f61ad9f539fbbbf35d7e408cca11847dcd31848131c1c4df69705798860f03e4255f02dedf
|
7
|
+
data.tar.gz: 553f1d4c97a284371d7a10a0f439a40d2861ff8c40c2318c09f6f818f5911644db05142dc7a8d5e377dac355ddc389fcc9858647a568184e8598fd3d3bb71154
|
data/NEWS.md
CHANGED
@@ -2,18 +2,53 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## Ruby D-Bus 0.23.1 - 2023-10-03
|
6
|
+
|
7
|
+
API:
|
8
|
+
* Add DBus::Object.dbus_reader_attr_accessor to declare a common use case
|
9
|
+
with a single call ([#140][]).
|
10
|
+
* BusConnection#request_name defaults to the simple use case: single owner
|
11
|
+
without queuing, failing fast; documented the complex use cases.
|
12
|
+
|
13
|
+
[#140]: https://github.com/mvidner/ruby-dbus/pull/140
|
14
|
+
|
15
|
+
## Ruby D-Bus 0.23.0.beta2 - 2023-06-23
|
16
|
+
|
17
|
+
License:
|
18
|
+
* clarified to be LGPL-2.1-or-later
|
19
|
+
|
20
|
+
API:
|
21
|
+
* DBus::Object#object_server replaces @service (which still works) and the short-lived
|
22
|
+
@connection
|
23
|
+
* ObjectServer#export will raise if the path is already taken by an object
|
24
|
+
* ObjectServer#unexport now also accepts an object path
|
25
|
+
* Connection#object_server can export objects even without requesting any
|
26
|
+
service name ([#49][], in beta1 already).
|
27
|
+
* Add PeerConnection for connections without a bus, useful for PulseAudio.
|
28
|
+
Fix listening for signals there ([#44][]).
|
29
|
+
* Moved from Connection to BusConnection: #unique_name, #proxy, #service.
|
30
|
+
Call send_hello in BusConnection#initialize already.
|
31
|
+
|
32
|
+
Bug fixes:
|
33
|
+
* Fixed a refactoring crasher bug in ProxyService#introspect (oops).
|
34
|
+
* Fix crash on #unexport of /child_of_root or even /
|
35
|
+
|
36
|
+
[#44]: https://github.com/mvidner/ruby-dbus/issues/44
|
37
|
+
[#49]: https://github.com/mvidner/ruby-dbus/issues/49
|
38
|
+
|
5
39
|
## Ruby D-Bus 0.23.0.beta1 - 2023-06-05
|
6
40
|
|
7
41
|
Bug fixes:
|
8
|
-
* A service can now have more than one name ([#69][]).
|
9
|
-
|
10
|
-
|
42
|
+
* A service can now have more than one name ([#69][]).
|
43
|
+
Connection#request_service is deprecated in favor of Connection#object_server
|
44
|
+
and BusConnection#request_name
|
11
45
|
|
12
46
|
[#69]: https://github.com/mvidner/ruby-dbus/issues/69
|
13
47
|
|
14
48
|
API:
|
15
49
|
* Remove Service, splitting it into ProxyService and ObjectServer
|
16
50
|
* Split off BusConnection from Connection
|
51
|
+
* DBus::Object @service replaced by @connection
|
17
52
|
|
18
53
|
## Ruby D-Bus 0.22.1 - 2023-05-17
|
19
54
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.23.
|
1
|
+
0.23.1
|
data/doc/Reference.md
CHANGED
@@ -23,7 +23,7 @@ is simply "dbus"
|
|
23
23
|
#### Calling Methods
|
24
24
|
|
25
25
|
1. {DBus.session_bus Connect to the session bus};
|
26
|
-
2. {DBus::
|
26
|
+
2. {DBus::BusConnection#[] get the screensaver service}
|
27
27
|
3. {DBus::ProxyService#[] and its screensaver object}.
|
28
28
|
4. Call one of its methods in a loop, solving [xkcd#196](http://xkcd.com/196).
|
29
29
|
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# find the library without external help
|
5
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __dir__)
|
6
|
+
|
7
|
+
require "dbus"
|
8
|
+
|
9
|
+
def peer_address
|
10
|
+
bus = DBus::SessionBus.instance
|
11
|
+
svc = bus["org.PulseAudio1"]
|
12
|
+
obj = svc["/org/pulseaudio/server_lookup1"]
|
13
|
+
ifc = obj["org.PulseAudio.ServerLookup1"]
|
14
|
+
adr = ifc["Address"]
|
15
|
+
puts "PA address: #{adr}"
|
16
|
+
adr
|
17
|
+
end
|
18
|
+
|
19
|
+
address = peer_address
|
20
|
+
begin
|
21
|
+
conn = DBus::PeerConnection.new(address)
|
22
|
+
rescue Errno::ENOENT
|
23
|
+
puts "Address exists but could not connect; telling PA to load the protocol"
|
24
|
+
system "pactl load-module module-dbus-protocol"
|
25
|
+
conn = DBus::PeerConnection.new(address)
|
26
|
+
end
|
27
|
+
no_svc = conn.peer_service
|
28
|
+
obj = no_svc["/org/pulseaudio/core1"]
|
29
|
+
ifc = obj["org.PulseAudio.Core1"]
|
30
|
+
puts "PA version: #{ifc["Version"]}"
|
31
|
+
|
32
|
+
puts "Waiting for volume changes, try adjusting it. Ctrl-C to exit."
|
33
|
+
|
34
|
+
vol_ifc = "org.PulseAudio.Core1.Device"
|
35
|
+
vol_member = "VolumeUpdated"
|
36
|
+
# PA needs explicit enabling of signals
|
37
|
+
ifc.ListenForSignal("#{vol_ifc}.#{vol_member}", [])
|
38
|
+
|
39
|
+
match_rule = DBus::MatchRule.new
|
40
|
+
match_rule.interface = vol_ifc
|
41
|
+
match_rule.member = vol_member
|
42
|
+
conn.add_match(match_rule) do |msg|
|
43
|
+
# a single argument that is an array
|
44
|
+
volumes = msg.params[0]
|
45
|
+
puts "VolumeUpdated: #{volumes.join(", ")}"
|
46
|
+
end
|
47
|
+
|
48
|
+
loop = DBus::Main.new
|
49
|
+
loop << conn
|
50
|
+
loop.run
|
data/examples/utils/listnames.rb
CHANGED
@@ -8,4 +8,12 @@ d = if ARGV.member?("--system")
|
|
8
8
|
else
|
9
9
|
DBus::SessionBus.instance
|
10
10
|
end
|
11
|
-
d.proxy.ListNames[0].each
|
11
|
+
d.proxy.ListNames[0].each do |n|
|
12
|
+
puts "\t#{n}"
|
13
|
+
qns = d.proxy.ListQueuedOwners(n)[0]
|
14
|
+
next if qns.size == 1 && qns.first == n
|
15
|
+
|
16
|
+
qns.each do |qn|
|
17
|
+
puts "\t\t#{qn}"
|
18
|
+
end
|
19
|
+
end
|