2014-12-20 11:14:49 +00:00
|
|
|
class Redpen < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Proofreading tool to help writers of technical documentation"
|
2014-12-20 11:14:49 +00:00
|
|
|
homepage "http://redpen.cc/"
|
2015-11-02 05:18:56 +00:00
|
|
|
url "https://github.com/recruit-tech/redpen/releases/download/v1.4.1/redpen-1.4.1.tar.gz"
|
|
|
|
sha256 "431fd0771facc77c353309d981c774c0099b4529f51ca414edb399d936a96f08"
|
2014-12-20 11:14:49 +00:00
|
|
|
|
2015-10-23 12:30:50 +00:00
|
|
|
bottle :unneeded
|
|
|
|
|
2014-12-20 11:14:49 +00:00
|
|
|
depends_on :java => "1.8"
|
|
|
|
|
|
|
|
def install
|
|
|
|
# Don't need Windows files.
|
|
|
|
rm_f Dir["bin/*.bat"]
|
2015-11-02 05:18:56 +00:00
|
|
|
libexec.install %w[conf lib sample-doc js]
|
2014-12-20 11:14:49 +00:00
|
|
|
|
|
|
|
prefix.install "bin"
|
2015-02-27 18:17:32 +00:00
|
|
|
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
|
2014-12-20 11:14:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
path = "#{libexec}/sample-doc/en/sampledoc-en.txt"
|
2015-02-13 04:24:42 +00:00
|
|
|
output = "#{bin}/redpen -l 20 -c #{libexec}/conf/redpen-conf-en.xml #{path}"
|
2014-12-20 11:14:49 +00:00
|
|
|
assert_match /^sampledoc-en.txt:1: ValidationError[SymbolWithSpace]*/, shell_output(output).split("\n").select { |line| line.start_with?("sampledoc-en.txt") }[0]
|
|
|
|
end
|
|
|
|
end
|