homebrew-core/Formula/maxwell.rb

35 lines
941 B
Ruby

class Maxwell < Formula
desc "Reads MySQL binlogs and writes row updates as JSON to Kafka"
homepage "https://maxwells-daemon.io/"
url "https://github.com/zendesk/maxwell/releases/download/v1.27.1/maxwell-1.27.1.tar.gz"
sha256 "81aca4fe49bbe720c9b7706058d3793c22f9b3a718691ad384ba622a6bbb0d6b"
license "Apache-2.0"
livecheck do
url "https://github.com/zendesk/maxwell/releases/latest"
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
end
bottle :unneeded
depends_on java: "1.8"
def install
libexec.install Dir["*"]
%w[maxwell maxwell-bootstrap].each do |f|
bin.install libexec/"bin/#{f}"
end
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
end
test do
fork do
exec "#{bin}/maxwell --log_level=OFF > #{testpath}/maxwell.log 2>/dev/null"
end
sleep 15
assert_match "Using kafka version", IO.read("#{testpath}/maxwell.log")
end
end