ruby-dbus 0.23.0.beta1 → 0.23.0.beta2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfebbc3384d221039f465d964817aad4c42ccc147ed6351b23728665c200a9b8
4
- data.tar.gz: 63e5542cd3f7a76dc0d7fc0d852e7fae9c0f506fdbc06f7b2d1f644267cead46
3
+ metadata.gz: c671b06e04452129a899cd4b7877cf43f9c05b8e7bc6597e75bc460e250c97e7
4
+ data.tar.gz: 18f660c6e5804fd133cf8351d801f8e0d4e332f1473cc390bedf77341d71845d
5
5
  SHA512:
6
- metadata.gz: 5dea8b83e62b698162f53d18fbc29b60fb594962a449f5d7b8cf82aa10e47fee3633186f894b6d95a42b1d02bc6f5ef172809405e93f57c2b04b450f1fb85732
7
- data.tar.gz: 3f0de7019ee46470c4e4afc2f37b4badeab5a1387c6d14c1df2b42b271c7bec9656dad656227e71efdf84d678c88b3394904f2e3c810270aaf0bafdb673fe5c3
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
- Connection#request_service is deprecated in favor of Connection#object_server
10
- and BusConnection#request_name
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.beta1
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::Connection#[] get the screensaver service}
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