ruby-dbus 0.23.0.beta1 → 0.23.1

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: 2465a9a90d0b4837640d475566edfde23aee4dc1d7d439d76d1f861b71f13033
4
+ data.tar.gz: 906288ee9d180ff0bfd4e53f45982040f240da983e23c818acd91d449d9f7f05
5
5
  SHA512:
6
- metadata.gz: 5dea8b83e62b698162f53d18fbc29b60fb594962a449f5d7b8cf82aa10e47fee3633186f894b6d95a42b1d02bc6f5ef172809405e93f57c2b04b450f1fb85732
7
- data.tar.gz: 3f0de7019ee46470c4e4afc2f37b4badeab5a1387c6d14c1df2b42b271c7bec9656dad656227e71efdf84d678c88b3394904f2e3c810270aaf0bafdb673fe5c3
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
- Connection#request_service is deprecated in favor of Connection#object_server
10
- and BusConnection#request_name
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.0.beta1
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::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
@@ -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 { |n| puts "\t#{n}" }
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