Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
#333 build is clean
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 22, 2018
1 parent a4723b6 commit a3a1e2f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,12 @@ task :xsl do
xsls.each do |p|
next if File.basename(p) == 'templates.xsl'
f = p.sub(%r{xsl/}, 'xml/').sub(%r{/([^/]+)\.xsl$}, '/\1/simple.xml')
xslt = Nokogiri::XSLT(File.open(p))
label = p.sub(%r{.+/([^/]+)\.xsl$}, '\1.html')
xml = Nokogiri::XML(File.open(f))
root = xml.xpath('/*').first
raise "version and updated attributes are required <#{f}>" if
root.attr('version').nil? || root.attr('updated').nil?
html = Nokogiri::XML(
xsl_transform(
f, p,
'today' => "'#{Time.now.iso8601}'"
)
)
html = Nokogiri::XML(xsl_transform(f, p))
html.remove_namespaces!
if html.xpath('/html/body/section').empty?
puts html
Expand Down Expand Up @@ -334,7 +328,7 @@ task :copyright do
."
end

def xsl_transform(xml, xsl, params = {})
def xsl_transform(xml, xsl)
saxon = '~/.m2/repository/net/sf/saxon/Saxon-HE/9.8.0-8/Saxon-HE-9.8.0-8.jar'
`java -jar #{saxon} -s:#{xml} -xsl:#{xsl}`
end

0 comments on commit a3a1e2f

Please sign in to comment.