ruby-dbus 0.23.0.beta1 → 0.23.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +28 -3
- data/VERSION +1 -1
- data/doc/Reference.md +1 -1
- data/examples/no-bus/pulseaudio.rb +50 -0
- data/lib/dbus/bus.rb +42 -436
- data/lib/dbus/connection.rb +350 -0
- data/lib/dbus/object.rb +22 -12
- 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 +7 -8
- data/spec/connection_spec.rb +37 -0
- data/spec/dbus_spec.rb +22 -0
- data/spec/mock-service/spaghetti-monster.rb +3 -4
- 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 +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c671b06e04452129a899cd4b7877cf43f9c05b8e7bc6597e75bc460e250c97e7
|
4
|
+
data.tar.gz: 18f660c6e5804fd133cf8351d801f8e0d4e332f1473cc390bedf77341d71845d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cff2ab01f4db3d069a73b28f46cf861dcc81302ed239a7fc4332f46a7583b2394d679d5d73ab13f080b674e46f8961c89fa3fccc58ce9043d0bd33c4c2d02c4
|
7
|
+
data.tar.gz: 495c060e5161c2c5267b723598d3185b14d4c6517e41504f5b49971d3c355acec1ee3ab6285b7796bb7aa8cb61dfb5bd24535a2613a9f22cfb80f65ec8a1cf49
|
data/NEWS.md
CHANGED
@@ -2,18 +2,43 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## Ruby D-Bus 0.23.0.beta2 - 2023-06-23
|
6
|
+
|
7
|
+
License:
|
8
|
+
* clarified to be LGPL-2.1-or-later
|
9
|
+
|
10
|
+
API:
|
11
|
+
* DBus::Object#object_server replaces @service (which still works) and the short-lived
|
12
|
+
@connection
|
13
|
+
* ObjectServer#export will raise if the path is already taken by an object
|
14
|
+
* ObjectServer#unexport now also accepts an object path
|
15
|
+
* Connection#object_server can export objects even without requesting any
|
16
|
+
service name ([#49][], in beta1 already).
|
17
|
+
* Add PeerConnection for connections without a bus, useful for PulseAudio.
|
18
|
+
Fix listening for signals there ([#44][]).
|
19
|
+
* Moved from Connection to BusConnection: #unique_name, #proxy, #service.
|
20
|
+
Call send_hello in BusConnection#initialize already.
|
21
|
+
|
22
|
+
Bug fixes:
|
23
|
+
* Fixed a refactoring crasher bug in ProxyService#introspect (oops).
|
24
|
+
* Fix crash on #unexport of /child_of_root or even /
|
25
|
+
|
26
|
+
[#44]: https://github.com/mvidner/ruby-dbus/issues/44
|
27
|
+
[#49]: https://github.com/mvidner/ruby-dbus/issues/49
|
28
|
+
|
5
29
|
## Ruby D-Bus 0.23.0.beta1 - 2023-06-05
|
6
30
|
|
7
31
|
Bug fixes:
|
8
|
-
* A service can now have more than one name ([#69][]).
|
9
|
-
|
10
|
-
|
32
|
+
* A service can now have more than one name ([#69][]).
|
33
|
+
Connection#request_service is deprecated in favor of Connection#object_server
|
34
|
+
and BusConnection#request_name
|
11
35
|
|
12
36
|
[#69]: https://github.com/mvidner/ruby-dbus/issues/69
|
13
37
|
|
14
38
|
API:
|
15
39
|
* Remove Service, splitting it into ProxyService and ObjectServer
|
16
40
|
* Split off BusConnection from Connection
|
41
|
+
* DBus::Object @service replaced by @connection
|
17
42
|
|
18
43
|
## Ruby D-Bus 0.22.1 - 2023-05-17
|
19
44
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.23.0.
|
1
|
+
0.23.0.beta2
|
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
|