forked from Homebrew/homebrew-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasciidoctorj.rb
46 lines (35 loc) · 1.02 KB
/
asciidoctorj.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Asciidoctorj < Formula
desc "Java wrapper and bindings for Asciidoctor"
homepage "https://github.com/asciidoctor/asciidoctorj"
url "https://dl.bintray.com/asciidoctor/maven/org/asciidoctor/asciidoctorj/2.1.0/asciidoctorj-2.1.0-bin.zip"
sha256 "708bb954d09eeb862ed7627e743be8f96f2a67397c561ab56e85b6bc4650cc77"
bottle :unneeded
depends_on :java => "1.6+"
def install
rm_rf Dir["bin/*.bat"] # Remove Windows files.
libexec.install Dir["*"]
executable = libexec/"bin/asciidoctorj"
executable.chmod 0555
bin.write_exec_script executable
end
test do
(testpath/"test.adoc").write <<~EOS
= This Is A Title
Random J. Author <[email protected]>
:icons: font
Hello, World!
== Syntax Highlighting
Python source.
[source, python]
----
import something
----
List
- one
- two
- three
EOS
system bin/"asciidoctorj", "-b", "pdf", "test.adoc"
assert_predicate testpath/"test.pdf", :exist?
end
end