homebrew-core/Formula/docuum.rb

46 lines
1.7 KiB
Ruby
Raw Normal View History

class Docuum < Formula
desc "Perform least recently used (LRU) eviction of Docker images"
homepage "https://github.com/stepchowfun/docuum"
url "https://github.com/stepchowfun/docuum/archive/v0.20.3.tar.gz"
sha256 "a3a230ef718efb87eb5b42b0ffdaa87dd6df3ea64efe443e31c5fcf608a53580"
license "MIT"
2021-08-07 13:35:13 +00:00
bottle do
2021-08-15 22:07:07 +00:00
sha256 cellar: :any_skip_relocation, arm64_big_sur: "fd66c12ac9e8c81c8d4899b5882d05175cbb5a70bdd10cfbbd3a58a77247a35e"
sha256 cellar: :any_skip_relocation, big_sur: "fc871eccda08dd9bdd4cfb5bfc5665decd1881d63aa8aa7c30188ab4e7cc6658"
sha256 cellar: :any_skip_relocation, catalina: "4480c15b9438c3d94006156fd48d6bd3f563b906ab4c4da7081d62e131b79a48"
sha256 cellar: :any_skip_relocation, mojave: "d91f0318adf9203cb53e478089d657079b060f93d799948a46c73e72e2257805"
sha256 cellar: :any_skip_relocation, x86_64_linux: "b2e080677044824ea663785d3d19ef43ad48e30160b054f8a4cf053afc5dcd7b"
2021-08-07 13:35:13 +00:00
end
depends_on "rust" => :build
def install
system "cargo", "install", *std_cargo_args
end
# https://github.com/stepchowfun/docuum#configuring-your-operating-system-to-run-the-binary-as-a-daemon
service do
run opt_bin/"docuum"
keep_alive true
log_path var/"log/docuum.log"
error_log_path var/"log/docuum.log"
environment_variables PATH: std_service_path_env
end
test do
started_successfully = false
Open3.popen3({ "NO_COLOR" => "true" }, "#{bin}/docuum") do |_, _, stderr, wait_thread|
stderr.each_line do |line|
if line.include?("Performing an initial vacuum on startup…")
Process.kill("TERM", wait_thread.pid)
started_successfully = true
end
end
end
assert(started_successfully, "Docuum did not start successfully.")
end
end