schematron 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/.semver +2 -2
  2. data/bin/stron +20 -15
  3. data/schematron.gemspec +2 -2
  4. metadata +3 -3
data/.semver CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
+ :patch: "1"
2
3
  :special: ""
3
4
  :major: "1"
4
- :minor: "0"
5
- :patch: "0"
5
+ :minor: "1"
data/bin/stron CHANGED
@@ -6,29 +6,34 @@ require 'schematron'
6
6
 
7
7
  include LibXML
8
8
 
9
- if __FILE__ == $0
10
- XML.default_line_numbers = true
9
+ XML.default_line_numbers = true
11
10
 
12
- begin
11
+ begin
13
12
 
14
- # get args
15
- schema_file = ARGV.shift or raise "schematron file required"
16
- instance_file = ARGV.shift or raise "instance doc file required"
13
+ # get args
14
+ schema_file = ARGV.shift or raise "schematron file required"
15
+ instance_file = ARGV.shift or raise "instance doc file required"
17
16
 
18
- # parse the xml
19
- schema_doc = XML::Document.file schema_file
20
- instance_doc = XML::Document.file instance_file
21
- stron = Schematron::Schema.new schema_doc
17
+ # parse the xml
18
+ schema_doc = XML::Document.file schema_file
19
+ instance_doc = XML::Document.file instance_file
20
+ stron = Schematron::Schema.new schema_doc
22
21
 
23
- # validate
24
- stron.validate(instance_doc).each do |error|
22
+ # validate
23
+ errors = stron.validate(instance_doc)
24
+ if errors.empty?
25
+ exit 0
26
+ else
27
+
28
+ errors.each do |error|
25
29
  puts '%s "%s" on line %d: %s' % error.values_at(:type, :name, :line, :message)
26
30
  end
27
31
 
28
- rescue => e
29
- puts "Usage: stron [schematron] [instance doc]"
30
- puts e.message
31
32
  exit 1
32
33
  end
33
34
 
35
+ rescue => e
36
+ puts "Usage: stron [schematron] [instance doc]"
37
+ puts e.message
38
+ exit 2
34
39
  end
@@ -8,12 +8,12 @@ Gem::Specification.new do |spec|
8
8
  spec.homepage = 'http://github.com/flazz/schematron'
9
9
  spec.authors = ["Francesco Lazzarino"]
10
10
  spec.executables << 'stron'
11
-
11
+
12
12
  spec.files = ["schematron.gemspec", "README.md", "LICENSE.txt", '.semver']
13
13
  spec.files += Dir['lib/*.rb']
14
14
  spec.files += Dir['spec/**/*']
15
15
  spec.files += Dir['iso-schematron-xslt1/*']
16
- spec.add_dependency 'semver', '~> 0.1.0'
16
+ spec.add_dependency 'semver', '~> 0.2.0'
17
17
  spec.add_dependency 'libxml-ruby', '~> 1.1.2'
18
18
  spec.add_dependency 'libxslt-ruby', '>= 0.9.1'
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schematron
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Lazzarino
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-08 00:00:00 -05:00
12
+ date: 2010-04-22 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 0.1.0
23
+ version: 0.2.0
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: libxml-ruby