aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorKozo Nishida2014-12-20 20:14:49 +0900
committerMike McQuaid2015-01-19 18:29:29 +0100
commit540644a04b5fe7d38d13abcbdda4227ae73fbb78 (patch)
tree3f7438ba939bc64adccf78d08b52eeb015066dac /Library/Formula
parentc48bcbd34874f144ea886ea1a2d6f51257ded227 (diff)
downloadhomebrew-540644a04b5fe7d38d13abcbdda4227ae73fbb78.tar.bz2
redpen 1.0.1
RedPen is a proofreading tool to help writers or programmers who write technical documents or manuals that need to adhere to a writing standard. RedPen automates the verifications of input documents written in natural languages. Closes #35147. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/redpen.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/Library/Formula/redpen.rb b/Library/Formula/redpen.rb
new file mode 100644
index 000000000..4f9856030
--- /dev/null
+++ b/Library/Formula/redpen.rb
@@ -0,0 +1,23 @@
+class Redpen < Formula
+ homepage "http://redpen.cc/"
+ url "https://github.com/recruit-tech/redpen/releases/download/v1.0.1/redpen-1.0.1.tar.gz"
+ sha1 "df0324348af5e07840454cd088ea7d26f490e6bf"
+
+ 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"
+ java_home = `/usr/libexec/java_home`.chomp
+ bin.env_script_all_files(libexec/"bin", :JAVA_HOME => java_home)
+ end
+
+ test do
+ path = "#{libexec}/sample-doc/en/sampledoc-en.txt"
+ output = "#{bin}/redpen -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