scio.rb (24 lines of code) (raw):
class Scio < Formula
desc "Scala API for Apache Beam and Google Cloud Dataflow"
homepage "https://github.com/spotify/scio/"
url "https://github.com/spotify/scio/releases/download/v0.14.8/scio-repl.jar"
sha256 "7457b22814c330d1d929303c9abfef26485bd26d8d1dd0477ef58fc8795fe0a4"
def install
libexec.install "scio-repl.jar"
(bin+"scio-repl").write <<~EOS
#!/usr/bin/env bash
java_opts=()
scio_opts=()
for o in "$@"; do
if [[ "$o" =~ ^-D.* || "$o" =~ ^-X.* ]]; then
java_opts+=("$o")
else
scio_opts+=("$o")
fi
done
CLASSPATH="#{libexec}/scio-repl.jar"${CLASSPATH:+:${CLASSPATH}} exec java ${java_opts[*]} com.spotify.scio.repl.ScioShell ${scio_opts[*]}
EOS
end
test do
shell_output("#{bin}/scio-repl -Y", 1)
end
end