forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaxon6.rb
37 lines (35 loc) · 1.11 KB
/
saxon6.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
class Saxon6 < Formula
desc "XSLT 1.0 processor"
homepage "http://saxon.sourceforge.net/saxon6.5.5/"
url "https://downloads.sourceforge.net/project/saxon/saxon6/6.5.5/saxon6-5-5.zip"
mirror "https://de.osdn.jp/projects/sfnet_saxon/downloads/saxon6/6.5.5/saxon6-5-5.zip/"
version "6.5.5"
sha256 "a76806dda554edc844601d0ec0fb3d2a10a2f397eabf3569dfb44b628363afc4"
def install
libexec.install Dir["*.jar", "doc", "samples"]
bin.write_jar_script libexec/"saxon.jar", "saxon6"
end
test do
(testpath/"test.xml").write <<-XML.undent
<test>It works!</test>
XML
(testpath/"test.xsl").write <<-XSL.undent
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<body>
<p><xsl:value-of select="test"/></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
XSL
assert_equal <<-HTML.undent.chop, shell_output("#{bin}/saxon6 test.xml test.xsl")
<html>
<body>
<p>It works!</p>
</body>
</html>
HTML
end
end