homebrew-core/Formula/languagetool.rb
2016-11-05 15:41:28 +08:00

25 lines
795 B
Ruby

class Languagetool < Formula
desc "Style and grammar checker"
homepage "https://www.languagetool.org/"
url "https://languagetool.org/download/LanguageTool-3.5.zip"
sha256 "643029da89041ccfb48772deaf0dd0e16942de2d381c5dc8ae9372f1b043bcab"
bottle :unneeded
def server_script(server_jar); <<-EOS.undent
#!/bin/bash
exec java -cp #{server_jar} org.languagetool.server.HTTPServer "$@"
EOS
end
def install
libexec.install Dir["*"]
bin.write_jar_script libexec/"languagetool-commandline.jar", "languagetool"
(bin+"languagetool-server").write server_script(libexec/"languagetool-server.jar")
bin.write_jar_script libexec/"languagetool.jar", "languagetool-gui"
end
test do
pipe_output("#{bin}/languagetool -l en-US -", "This is a test.")
end
end