class CypherShell < Formula desc "Command-line shell where you can execute Cypher against Neo4j" homepage "https://github.com/neo4j/cypher-shell" url "https://github.com/neo4j/cypher-shell/releases/download/1.1.11/cypher-shell.zip" version "1.1.11" sha256 "6a3d2da482e818c5092b2931862a3b3ea207c9ae002fff7ea4fb7e324e1544a5" version_scheme 1 bottle :unneeded depends_on :java => "1.8" def install rm_f Dir["bin/*.bat"] # Needs the jar, but cannot go in bin share.install ["cypher-shell.jar"] # Copy the bin bin.install ["cypher-shell"] bin.env_script_all_files(share, :NEO4J_HOME => ENV["NEO4J_HOME"]) end test do # 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