Skip to content

Commit 01960d6

Browse files
committed
metanorma 1.12.8 (new formula)
1 parent 5f7d594 commit 01960d6

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

Formula/m/metanorma.rb

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
class Metanorma < Formula
2+
desc "Toolchain for publishing metanorma documentation"
3+
homepage "https://www.metanorma.com"
4+
5+
url "https://rubygems.org/downloads/metanorma-cli-1.12.8.gem"
6+
sha256 "b746637b00a051ca409ccf98fc82c12c443d27183c3d4bdd3535ad47eb015573"
7+
8+
license "0BSD"
9+
10+
depends_on "pkgconf" => :build
11+
depends_on "gflags"
12+
depends_on "graphviz"
13+
depends_on "libzip"
14+
depends_on "openjdk"
15+
depends_on "plantuml"
16+
depends_on "readline"
17+
depends_on "[email protected]"
18+
depends_on "xml2rfc"
19+
20+
# uses_from_macos "ruby"
21+
uses_from_macos "zlib"
22+
23+
on_linux do
24+
depends_on "libxslt"
25+
depends_on "zlib"
26+
end
27+
28+
def install
29+
ENV["GEM_HOME"] = libexec
30+
system "gem", "install", cached_download, "--no-document"
31+
bin.install Dir["#{libexec}/bin/metanorma"]
32+
bin.env_script_all_files(
33+
libexec/"bin",
34+
PATH: [libexec/"bin", "$PATH"].join(":"),
35+
GEM_HOME: ENV["GEM_HOME"],
36+
JAVA_HOME: Language::Java.java_home("1.8+"),
37+
)
38+
end
39+
40+
def caveats
41+
<<~EOS
42+
inkscape >= 1.0 is required to generate Word output using SVG images.
43+
Install it by running `brew cask install inkscape` or
44+
directly download from https://inkscape.org/release/inkscape-1.0/
45+
EOS
46+
end
47+
48+
test do
49+
test_doc = <<~ADOC
50+
= Document title
51+
Author
52+
:docfile: test.adoc
53+
:nodoc:
54+
:novalid:
55+
:no-isobib:
56+
ADOC
57+
58+
(testpath / "test-iso.adoc").write(test_doc)
59+
system bin / "metanorma", "--type", "iso", testpath / "test-iso.adoc",
60+
"--agree-to-terms"
61+
assert_path_exists testpath / "test-iso.xml"
62+
assert_path_exists testpath / "test-iso.html"
63+
64+
(testpath / "test-csa.adoc").write(test_doc)
65+
system bin / "metanorma", "--type", "csa", testpath / "test-csa.adoc",
66+
"--agree-to-terms"
67+
assert_path_exists testpath / "test-csa.pdf"
68+
assert_path_exists testpath / "test-csa.html"
69+
end
70+
end

0 commit comments

Comments
 (0)