Skip to content

Commit 5069a1a

Browse files
committed
metanorma 1.12.8 (new formula)
1 parent 5f7d594 commit 5069a1a

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

Formula/m/metanorma.rb

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
end
26+
27+
def install
28+
ENV["GEM_HOME"] = libexec
29+
system "gem", "install", cached_download, "--no-document"
30+
bin.install Dir["#{libexec}/bin/metanorma"]
31+
bin.env_script_all_files(
32+
libexec/"bin",
33+
PATH: [libexec/"bin", "$PATH"].join(":"),
34+
GEM_HOME: ENV["GEM_HOME"],
35+
JAVA_HOME: Language::Java.java_home("1.8+"),
36+
)
37+
end
38+
39+
def caveats
40+
<<~EOS
41+
inkscape >= 1.0 is required to generate Word output using SVG images.
42+
Install it by running `brew cask install inkscape` or
43+
directly download from https://inkscape.org/release/inkscape-1.0/
44+
EOS
45+
end
46+
47+
test do
48+
test_doc = <<~ADOC
49+
= Document title
50+
Author
51+
:docfile: test.adoc
52+
:nodoc:
53+
:novalid:
54+
:no-isobib:
55+
ADOC
56+
57+
(testpath / "test-iso.adoc").write(test_doc)
58+
system bin / "metanorma", "--type", "iso", testpath / "test-iso.adoc",
59+
"--agree-to-terms"
60+
assert_path_exists testpath / "test-iso.xml"
61+
assert_path_exists testpath / "test-iso.html"
62+
63+
(testpath / "test-csa.adoc").write(test_doc)
64+
system bin / "metanorma", "--type", "csa", testpath / "test-csa.adoc",
65+
"--agree-to-terms"
66+
assert_path_exists testpath / "test-csa.pdf"
67+
assert_path_exists testpath / "test-csa.html"
68+
end
69+
end

0 commit comments

Comments
 (0)