homebrew-core/Formula/redpen.rb
Xu Cheng a9345257c6 redpen datomic: use Language::Java.java_home_env
Closes Homebrew/homebrew#37247.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-02-28 13:10:52 +08:00

22 lines
778 B
Ruby

class Redpen < Formula
homepage "http://redpen.cc/"
url "https://github.com/recruit-tech/redpen/releases/download/v1.1.2/redpen-1.1.2.tar.gz"
sha1 "d9ba46a7c5813b444cbbc1dca5c24aa2d75cb126"
depends_on :java => "1.8"
def install
# Don't need Windows files.
rm_f Dir["bin/*.bat"]
libexec.install %w[conf lib sample-doc]
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