Skip to content

Commit

Permalink
Bugfix to properly handle jar in packaged gem
Browse files Browse the repository at this point in the history
  • Loading branch information
halfbyte committed Nov 6, 2024
1 parent af96ac9 commit a8c87ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 3.0.1

- [BUGFIX] Schema JAR must be properly relatively addressed when published as a gem
- [BUGFIX] Make sure tmpdir lib is loaded when needed

## 3.0.0

- [BREAKING] This now needs Java installed to run the Schematron validator, as nokogiri-schematron does not work with XSLT based schematron files
Expand Down
4 changes: 3 additions & 1 deletion lib/secretariat/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
=end

require 'nokogiri'
require 'tmpdir'

module Secretariat
class Validator
Expand Down Expand Up @@ -55,7 +56,8 @@ def validate_against_schematron
Dir.mktmpdir do |dir|
docpath = File.join(dir, 'doc.xml')
File.write(docpath, doc, mode: 'wb')
out = `java -jar bin/schxslt-cli.jar -v -d #{docpath} -s #{schematron_path}`
jarpath = File.join(__dir__, '../..', 'bin', 'schxslt-cli.jar')
out = `java -jar #{jarpath} -v -d #{docpath} -s #{schematron_path}`
return [] if out.match("[valid]")
out.lines
end
Expand Down
2 changes: 1 addition & 1 deletion lib/secretariat/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
=end

module Secretariat
VERSION = '3.0.0'
VERSION = '3.0.1'
end

0 comments on commit a8c87ff

Please sign in to comment.