libbeachcomber 0.6.0 → 0.6.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 +4 -4
- data/lib/beachcomber/discovery.rb +14 -12
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 49948fed9514c126aa098f0d469d9d00b455dfee1e295734459aa19d3d5e72be
|
|
4
|
+
data.tar.gz: 8d0ae8bc11f78cada0741b3cd2a668dc1a97d2a68299ca9fc37acb1d6a2806ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6e7f9bfbd336707802e4d45b9a797cf2ba6ee393fded7e674932a87be8d37169709af1142a0620b5087be38b6a3a7d47f26e5750e422cd0786bcb203f327c67
|
|
7
|
+
data.tar.gz: 62d84ba78bd44bcdff01f7ec990b5f3ba6ffa8760de1f7d8f83ed9b58c6682f79e51c756b401f5f0e96baa9957cee0991e3b5654196d0506efc1c4e39319d2f1
|
|
@@ -3,23 +3,25 @@ require 'etc'
|
|
|
3
3
|
module Beachcomber
|
|
4
4
|
# Discovers the Unix socket path for the beachcomber daemon.
|
|
5
5
|
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
6
|
+
# Mirrors the daemon's bind-path resolution (Config::resolve_socket_path),
|
|
7
|
+
# minus the config-file step which is daemon-only. Discovery order:
|
|
8
|
+
# 1. $BEACHCOMBER_SOCKET (if set and non-empty)
|
|
9
|
+
# 2. $XDG_RUNTIME_DIR/beachcomber/sock (if XDG_RUNTIME_DIR is set)
|
|
9
10
|
# 3. /tmp/beachcomber-<uid>/sock
|
|
11
|
+
#
|
|
12
|
+
# There is no existence probe and $TMPDIR is not consulted: the result is the
|
|
13
|
+
# single path the daemon binds for the same environment. Non-standard setups
|
|
14
|
+
# point clients at the daemon via BEACHCOMBER_SOCKET.
|
|
10
15
|
module Discovery
|
|
11
|
-
# @return [String] the
|
|
16
|
+
# @return [String] the resolved socket path
|
|
12
17
|
def self.socket_path
|
|
18
|
+
sock = ENV['BEACHCOMBER_SOCKET']
|
|
19
|
+
return sock if sock && !sock.empty?
|
|
20
|
+
|
|
13
21
|
xdg = ENV['XDG_RUNTIME_DIR']
|
|
14
|
-
if xdg && !xdg.empty?
|
|
15
|
-
candidate = File.join(xdg, 'beachcomber', 'sock')
|
|
16
|
-
return candidate if File.exist?(candidate)
|
|
17
|
-
end
|
|
22
|
+
return File.join(xdg, 'beachcomber', 'sock') if xdg && !xdg.empty?
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
dir = "beachcomber-#{uid}"
|
|
21
|
-
base = ENV.fetch('TMPDIR', nil) || '/tmp'
|
|
22
|
-
File.join(base, dir, 'sock')
|
|
24
|
+
File.join('/tmp', "beachcomber-#{Process.uid}", 'sock')
|
|
23
25
|
end
|
|
24
26
|
end
|
|
25
27
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: libbeachcomber
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NavistAu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Communicates with the beachcomber daemon over a Unix domain socket to
|
|
14
14
|
query cached shell-environment data (git state, hostname, battery, etc.).
|