2016-04-21 12:32:11 +00:00
|
|
|
class Liquigraph < Formula
|
|
|
|
desc "Migration runner for Neo4j"
|
|
|
|
homepage "http://www.liquigraph.org"
|
|
|
|
url "https://github.com/fbiville/liquigraph/archive/liquigraph-3.0.0.tar.gz"
|
|
|
|
sha256 "4864c323a626c15df9fed49d05ede3e947e0b78fe864ff81dcc8703b875662b1"
|
|
|
|
head "https://github.com/fbiville/liquigraph.git"
|
|
|
|
|
2016-09-06 18:52:03 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-09-27 22:32:10 +00:00
|
|
|
sha256 "57dd3af316302286243bd702f80a4ad4fa53a41f60c570da8b39928bf063aae3" => :sierra
|
2016-09-06 18:52:03 +00:00
|
|
|
sha256 "68fe2a70de1b7df7c4207ee2e83e0f80f94e40735152272752cf3b78bdcbc5e2" => :el_capitan
|
|
|
|
sha256 "c6bc6dd5f9769bbf176c44e1f72e08b43f14f2ba3ae21442bbd1b465378aff7d" => :yosemite
|
|
|
|
sha256 "d61206398e4b4a24b88b9ca44957f99db227d8a6a259b74a111c6f4d6fc38b8e" => :mavericks
|
|
|
|
end
|
|
|
|
|
2016-04-21 12:32:11 +00:00
|
|
|
depends_on "maven" => :build
|
2016-09-24 15:45:48 +00:00
|
|
|
depends_on :java => "1.8+"
|
2016-04-21 12:32:11 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.java_cache
|
|
|
|
system "mvn", "-q", "clean", "package", "-DskipTests"
|
|
|
|
(buildpath/"binaries").mkpath
|
|
|
|
system "tar", "xzf", "liquigraph-cli/target/liquigraph-cli-bin.tar.gz", "-C", "binaries"
|
|
|
|
libexec.install "binaries/liquigraph-cli/liquigraph.sh" => "liquigraph"
|
|
|
|
libexec.install "binaries/liquigraph-cli/liquigraph-cli.jar"
|
|
|
|
bin.install_symlink libexec/"liquigraph"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
failing_hostname = "verrryyyy_unlikely_host"
|
2016-09-09 04:07:46 +00:00
|
|
|
changelog = testpath/"changelog"
|
2016-04-21 12:32:11 +00:00
|
|
|
changelog.write <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<changelog>
|
|
|
|
<changeset id="hello-world" author="you">
|
|
|
|
<query>CREATE (n:Sentence {text:'Hello monde!'}) RETURN n</query>
|
|
|
|
</changeset>
|
|
|
|
<changeset id="hello-world-fixed" author="you">
|
|
|
|
<query>MATCH (n:Sentence {text:'Hello monde!'}) SET n.text='Hello world!' RETURN n</query>
|
|
|
|
</changeset>
|
|
|
|
</changelog>
|
2016-09-08 19:15:07 +00:00
|
|
|
EOS
|
2016-09-09 04:07:46 +00:00
|
|
|
|
|
|
|
jdbc = "jdbc:neo4j:http://#{failing_hostname}:7474/"
|
|
|
|
output = shell_output("#{bin}/liquigraph -c #{changelog.realpath} -g #{jdbc} 2>&1", 1)
|
|
|
|
assert_match "UnknownHostException: #{failing_hostname}", output
|
2016-04-21 12:32:11 +00:00
|
|
|
end
|
|
|
|
end
|