2cb10c4105
Closes Homebrew/homebrew#48504. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
25 lines
900 B
Ruby
25 lines
900 B
Ruby
class Redpen < Formula
|
|
desc "Proofreading tool to help writers of technical documentation"
|
|
homepage "http://redpen.cc/"
|
|
url "https://github.com/redpen-cc/redpen/releases/download/redpen-1.4.3/redpen-1.4.3.tar.gz"
|
|
sha256 "31652d23367f05e77cd9ab2be045844136d2d7772513e23ef503200a54f8c298"
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on :java => "1.8"
|
|
|
|
def install
|
|
# Don't need Windows files.
|
|
rm_f Dir["bin/*.bat"]
|
|
libexec.install %w[conf lib sample-doc js]
|
|
|
|
prefix.install "bin"
|
|
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
|
|
end
|
|
|
|
test do
|
|
path = "#{libexec}/sample-doc/en/sampledoc-en.txt"
|
|
output = "#{bin}/redpen -l 20 -c #{libexec}/conf/redpen-conf-en.xml #{path}"
|
|
assert_match /^sampledoc-en.txt:1: ValidationError[SymbolWithSpace]*/, shell_output(output).split("\n").select { |line| line.start_with?("sampledoc-en.txt") }[0]
|
|
end
|
|
end
|