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.12/cypher-shell.zip" version "1.1.12" sha256 "af051eb6e1cba342ca7b4c2bc5d0372aca443ef738efea0febf6d397deec2118" 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