1 class Blackbox < Formula
2 desc "Safely store secrets in Git/Mercurial/Subversion"
3 homepage "https://github.com/StackExchange/blackbox"
4 url "https://github.com/StackExchange/blackbox/archive/refs/tags/v1.20220610.tar.gz"
5 sha256 "f1efcca6680159f244eb44fdb78e92b521760b875fa5a36e4c433b93ed0f87c1"
11 regex(/^v?(\d+(?:\.\d+)*\.\d{6,8}(?:\.\d+)*)$/i)
16 sha256 cellar: :any_skip_relocation, all: "55abf9c858ccaf04d8ab764718fa5810f09adb66c150ae3a9f263622a1cae753"
22 libexec.install Dir["bin/*"]
23 bin.write_exec_script Dir[libexec/"*"].select { |f| File.executable? f }
27 (testpath/"batch.gpg").write <<~EOS
33 Name-Email: testing@foo.bar
39 system Formula["gnupg"].opt_bin/"gpg", "--batch", "--gen-key", "batch.gpg"
41 system bin/"blackbox_initialize", "yes"
42 add_created_key = shell_output("#{bin}/blackbox_addadmin Testing 2>&1")
43 assert_match "<testing@foo.bar>", add_created_key
45 system Formula["gnupg"].opt_bin/"gpgconf", "--kill", "gpg-agent"
46 system Formula["gnupg"].opt_bin/"gpgconf", "--homedir", "keyrings/live",