homebrew-core/Formula/languagetool.rb
William 4c0586c40b languagetool: add test do block
Closes Homebrew/homebrew#46535.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-04 18:06:15 +00:00

25 lines
799 B
Ruby

class Languagetool < Formula
desc "Style and grammar checker"
homepage "https://www.languagetool.org/"
url "https://www.languagetool.org/download/LanguageTool-3.1.zip"
sha256 "4d446990bf3dc983b8313e872cd62df45deab9eae65c9bc5e4103c31db0e5bc3"
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