class CypherShell < Formula desc "Command-line shell where you can execute Cypher against Neo4j" homepage "https://neo4j.com" url "https://dist.neo4j.org/cypher-shell/cypher-shell-2025.11.2.zip" sha256 "e64aa2b355a0b41507a5f959de3c874a635ada4618d2324f62d32e65bd80f3b6" license "GPL-3.0-only" version_scheme 1 livecheck do url "https://neo4j.com/deployment-center/" regex(/href=.*?cypher-shell[._-]v?(\d+(?:\.\d+)+)\.zip/i) end bottle do sha256 cellar: :any_skip_relocation, all: "78b930ae95c1de89a0e6c43f5179615b345b887611bf6d00c90643ef69a703a4" end depends_on "openjdk@21" def install libexec.install Dir["*"] (bin/"cypher-shell").write_env_script libexec/"bin/cypher-shell", Language::Java.overridable_java_home_env("21") end test do refute_match "unsupported version of the Java runtime", shell_output("#{bin}/cypher-shell -h 2>&1", 1) # The connection will fail and print the name of the host assert_match "doesntexist", shell_output("#{bin}/cypher-shell -a bolt://doesntexist 2>&1", 1) end end