Commit 55b8a0157f
Verified · cmc
Layout: unified · split
Formula/ambient-companions.rb +10 −4
| @@ -2,8 +2,8 @@ class AmbientCompanions < Formula | ||
| 2 | 2 | desc "Ambient system companions over one privacy-preserving signal daemon" |
| 3 | 3 | homepage "https://gitbay.org/krz/ambient-companions" |
| 4 | 4 | url "https://gitbay.org/krz/ambient-companions.git", |
| 5 | tag: "v0.6.1", | |
| 6 | revision: "e8edd54d8ff674b8d3c12b2d6e8aba5e2b477067" | |
| 5 | tag: "v1.0.0", | |
| 6 | revision: "106c62e2f9a644811a6f9c261331a70b76139497" | |
| 7 | 7 | license "0BSD" |
| 8 | 8 | head "https://gitbay.org/krz/ambient-companions.git", branch: "main" |
| 9 | 9 | |
| @@ -15,6 +15,7 @@ class AmbientCompanions < Formula | ||
| 15 | 15 | def install |
| 16 | 16 | system "cargo", "install", *std_cargo_args(path: "crates/signald") |
| 17 | 17 | system "cargo", "install", *std_cargo_args(path: "crates/terminal-garden") |
| 18 | system "cargo", "install", *std_cargo_args(path: "crates/terminal-pet") | |
| 18 | 19 | |
| 19 | 20 | # The IOKit collector runs out of process as a child of signald. |
| 20 | 21 | # --disable-sandbox: SwiftPM sandboxes its own manifest compile, and that |
| @@ -57,14 +58,19 @@ class AmbientCompanions < Formula | ||
| 57 | 58 | test do |
| 58 | 59 | assert_match version.to_s, shell_output("#{bin}/signald --version") |
| 59 | 60 | assert_match version.to_s, shell_output("#{bin}/terminal-garden --version") |
| 61 | assert_match version.to_s, shell_output("#{bin}/terminal-pet --version") | |
| 60 | 62 | # Unknown options exit 2 rather than being taken for a repository path. |
| 61 | 63 | shell_output("#{bin}/signald --nonexistent-option 2>&1", 2) |
| 62 | 64 | # One real IOKit read, no root. --once writes raw wire frames to stdout and |
| 63 | 65 | # the human summary to stderr, so capture stderr alone: folding the binary |
| 64 | 66 | # in with 2>&1 hands Ruby a string that is not valid UTF-8. |
| 65 | 67 | assert_match "cpu_load", shell_output("#{bin}/macos-collector --once 2>&1 >/dev/null") |
| 66 | # --hex is the same tick as ASCII: v4 frames, 25 bytes each. | |
| 68 | # --hex is the same tick as ASCII: a 25-byte frame, 21-byte body. The | |
| 69 | # schema version deliberately is not pinned here — the canonical-frame | |
| 70 | # tests in the repo pin it on both the Rust and Swift sides, and asserting | |
| 71 | # it again from the tap only means this formula breaks on every schema | |
| 72 | # bump, in a different repository, for no extra coverage. | |
| 67 | 73 | hex = shell_output("#{bin}/macos-collector --once --hex 2>/dev/null") |
| 68 | assert_match(/^1500000004[0-9a-f]{40}$/, hex.lines.first.chomp) | |
| 74 | assert_match(/^15000000[0-9a-f]{42}$/, hex.lines.first.chomp) | |
| 69 | 75 | end |
| 70 | 76 | end |