saxon-rb 0.7.2-java → 0.7.3-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b28465f21f4fe169b356cbd1bce2d66ae1ae2a083d2ebe022963e1c3d229ef12
4
- data.tar.gz: 82da6fa6d8570e791d17b3e46ec644200c7518019c9cec3c7804ad106ef2306e
3
+ metadata.gz: c17f2a7367744b11c9ffdcf65e191dee9859cc3887902ce98291e52cea245080
4
+ data.tar.gz: 919c7e5a00c629ecc5d6193ce9f4836b0fb55ae1a4e80673347856d8ad4c5ce1
5
5
  SHA512:
6
- metadata.gz: 83cc23c8755cb8843cb8f44afd948582339e26b492ff7eb505badbb9f727f8a98d622b1adf501f06f77ab4554ba40b5e40ead8554a7bd06caf20ab570a7765fb
7
- data.tar.gz: '09db9b468b5ce5d21bc48c6602ec6a93e1a0ad61b55a550556cff4804912848a0947904d6fa0ff19e9a8cb92cb847e61615dc435c15147e43b197a8fa5d3d6e0'
6
+ metadata.gz: 5781e2bd70022ed23b2b649de4dcffef94abf400f9d0ab71ee28a8b711f74c7fd4efec02d5a88221ffcd14a99663f9be27413c12de312aa419c217ac26eaf250
7
+ data.tar.gz: 6d13e4918a6140693ec1e3dbcbb07bcefbcac9afa49cfd76edec287254b795bdf49ee91cdee2b08def37258c7e466675dbca6f56c04628c9b4bb1cd77b9e91da
@@ -33,8 +33,11 @@ jobs:
33
33
  command: |-
34
34
  ./cc-test-reporter before-build
35
35
  mkdir -p /tmp/test-results
36
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
37
+ if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o "cc-coverage-jar-loading-alt-saxon.json"; fi
38
+ rm -rf coverage
36
39
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
37
- if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o "cc-coverage-alt-saxon.json"; fi
40
+ if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o "cc-coverage-main-alt-saxon.json"; fi
38
41
  - persist_to_workspace:
39
42
  root: "~/project"
40
43
  paths:
@@ -67,8 +70,11 @@ jobs:
67
70
  command: |-
68
71
  ./cc-test-reporter before-build
69
72
  mkdir -p /tmp/test-results
73
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
74
+ if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o "cc-coverage-jar-loading.json"; fi
75
+ rm -rf coverage
70
76
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
71
- if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o "cc-coverage.json"; fi
77
+ if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o "cc-coverage-main.json"; fi
72
78
  - persist_to_workspace:
73
79
  root: "~/project"
74
80
  paths:
@@ -104,6 +110,8 @@ jobs:
104
110
  name: Run the tests
105
111
  command: |-
106
112
  mkdir -p /tmp/test-results
113
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
114
+ rm -rf coverage
107
115
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
108
116
  - store_test_results:
109
117
  path: "/tmp/test-results"
@@ -127,6 +135,8 @@ jobs:
127
135
  name: Run the tests
128
136
  command: |-
129
137
  mkdir -p /tmp/test-results
138
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
139
+ rm -rf coverage
130
140
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
131
141
  - store_test_results:
132
142
  path: "/tmp/test-results"
@@ -159,6 +169,8 @@ jobs:
159
169
  name: Run the tests
160
170
  command: |-
161
171
  mkdir -p /tmp/test-results
172
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
173
+ rm -rf coverage
162
174
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
163
175
  - store_test_results:
164
176
  path: "/tmp/test-results"
@@ -182,6 +194,8 @@ jobs:
182
194
  name: Run the tests
183
195
  command: |-
184
196
  mkdir -p /tmp/test-results
197
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
198
+ rm -rf coverage
185
199
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
186
200
  - store_test_results:
187
201
  path: "/tmp/test-results"
@@ -214,6 +228,8 @@ jobs:
214
228
  name: Run the tests
215
229
  command: |-
216
230
  mkdir -p /tmp/test-results
231
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
232
+ rm -rf coverage
217
233
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
218
234
  - store_test_results:
219
235
  path: "/tmp/test-results"
@@ -237,6 +253,8 @@ jobs:
237
253
  name: Run the tests
238
254
  command: |-
239
255
  mkdir -p /tmp/test-results
256
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
257
+ rm -rf coverage
240
258
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
241
259
  - store_test_results:
242
260
  path: "/tmp/test-results"
@@ -269,6 +287,8 @@ jobs:
269
287
  name: Run the tests
270
288
  command: |-
271
289
  mkdir -p /tmp/test-results
290
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
291
+ rm -rf coverage
272
292
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
273
293
  - store_test_results:
274
294
  path: "/tmp/test-results"
@@ -292,6 +312,8 @@ jobs:
292
312
  name: Run the tests
293
313
  command: |-
294
314
  mkdir -p /tmp/test-results
315
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
316
+ rm -rf coverage
295
317
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
296
318
  - store_test_results:
297
319
  path: "/tmp/test-results"
@@ -324,6 +346,8 @@ jobs:
324
346
  name: Run the tests
325
347
  command: |-
326
348
  mkdir -p /tmp/test-results
349
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
350
+ rm -rf coverage
327
351
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
328
352
  - store_test_results:
329
353
  path: "/tmp/test-results"
@@ -347,6 +371,8 @@ jobs:
347
371
  name: Run the tests
348
372
  command: |-
349
373
  mkdir -p /tmp/test-results
374
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
375
+ rm -rf coverage
350
376
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
351
377
  - store_test_results:
352
378
  path: "/tmp/test-results"
@@ -379,6 +405,8 @@ jobs:
379
405
  name: Run the tests
380
406
  command: |-
381
407
  mkdir -p /tmp/test-results
408
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
409
+ rm -rf coverage
382
410
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
383
411
  - store_test_results:
384
412
  path: "/tmp/test-results"
@@ -402,6 +430,8 @@ jobs:
402
430
  name: Run the tests
403
431
  command: |-
404
432
  mkdir -p /tmp/test-results
433
+ VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml
434
+ rm -rf coverage
405
435
  bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
406
436
  - store_test_results:
407
437
  path: "/tmp/test-results"
@@ -0,0 +1,2 @@
1
+ --format progress
2
+ --color
data/Rakefile CHANGED
@@ -190,12 +190,18 @@ task :circleci do
190
190
  def run_tests_step(opts)
191
191
  command = [
192
192
  "mkdir -p /tmp/test-results",
193
- "bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress"
193
+ "VERIFY_SAXON_LAZY_LOADING=1 bundle exec rspec spec/jar_loading_spec.rb --options .rspec-jar-loading --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec-jar-loading.xml"
194
194
  ]
195
195
  if opts.fetch(:run_codeclimate)
196
196
  command.prepend("./cc-test-reporter before-build")
197
- command.append("if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o \"cc-coverage#{"-alt-saxon" if opts.fetch(:alt_saxon_url)}.json\"; fi")
197
+ command.append("if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o \"cc-coverage-jar-loading#{"-alt-saxon" if opts.fetch(:alt_saxon_url)}.json\"; fi")
198
198
  end
199
+ command.append("rm -rf coverage")
200
+ command.append("bundle exec rspec spec --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress")
201
+ if opts.fetch(:run_codeclimate)
202
+ command.append("if [ $? -eq 0 ]; then ./cc-test-reporter format-coverage -t simplecov -o \"cc-coverage-main#{"-alt-saxon" if opts.fetch(:alt_saxon_url)}.json\"; fi")
203
+ end
204
+
199
205
  {
200
206
  "run" => {
201
207
  "name" => "Run the tests" + (opts.fetch(:run_codeclimate) ? ", and upload coverage data to Code Climate" : ""),
@@ -38,60 +38,70 @@ module Saxon
38
38
  end
39
39
  end
40
40
 
41
- # @param saxon_home [String, Pathname] the path to the dir containing
42
- # Saxon's .jars. Defaults to the vendored Saxon HE
43
- # @return [true, false] Returns true if Saxon had not been loaded and
44
- # is now, and false if Saxon was already loaded
45
- def self.load!(saxon_home = nil)
46
- return false if instance_variable_defined?(:@saxon_loaded) && @saxon_loaded
47
- LOAD_SEMAPHORE.synchronize do
48
- if Saxon::S9API.const_defined?(:Processor)
41
+ class << self
42
+ # Are the Saxon jars missing from the Classpath?
43
+ # @return [Boolean] true if the Jars are not on the Classpath
44
+ def jars_not_on_classpath?
45
+ begin
46
+ Java::net.sf.saxon.s9api.Processor
49
47
  false
50
- else
51
- if jars_not_on_classpath?
52
- if saxon_home.nil?
53
- require 'saxon-rb_jars'
54
- else
55
- saxon_home = Pathname.new(saxon_home)
56
- raise NoJarsError, saxon_home unless saxon_home.directory?
57
- jars = [main_jar(saxon_home)].compact
58
- raise MissingJarError if jars.empty?
59
- jars += extra_jars(saxon_home)
48
+ rescue
49
+ true
50
+ end
51
+ end
52
+
53
+ # Are the Saxon JARs on the Classpath?
54
+ # @return [Boolean] whether the Jars are on the Classpath already
55
+ def jars_on_classpath?
56
+ !jars_not_on_classpath?
57
+ end
58
+
59
+ # @param saxon_home [String, Pathname] the path to the dir containing
60
+ # Saxon's .jars. Defaults to the vendored Saxon HE
61
+ # @return [true, false] Returns true if Saxon had not been loaded and
62
+ # is now, and false if Saxon was already loaded
63
+ def load!(saxon_home = nil)
64
+ return false if instance_variable_defined?(:@saxon_loaded) && @saxon_loaded
65
+ LOAD_SEMAPHORE.synchronize do
66
+ if Saxon::S9API.const_defined?(:Processor)
67
+ false
68
+ else
69
+ if jars_not_on_classpath?
70
+ if saxon_home.nil?
71
+ require 'saxon-rb_jars'
72
+ else
73
+ saxon_home = Pathname.new(saxon_home)
74
+ raise NoJarsError, saxon_home unless saxon_home.directory?
75
+ jars = [main_jar(saxon_home)].compact
76
+ raise MissingJarError if jars.empty?
77
+ jars += extra_jars(saxon_home)
60
78
 
61
- add_jars_to_classpath!(saxon_home, jars)
79
+ add_jars_to_classpath!(saxon_home, jars)
80
+ end
62
81
  end
63
- end
64
82
 
65
- @saxon_loaded = true
66
- true
83
+ @saxon_loaded = true
84
+ true
85
+ end
67
86
  end
68
87
  end
69
- end
70
88
 
71
- private
72
-
73
- def self.main_jar(path)
74
- ['saxon9he.jar', 'saxon9pe.jar', 'saxon9ee.jar'].map { |jar| path.join(jar) }.find { |jar| jar.file? }
75
- end
89
+ private
76
90
 
77
- def self.extra_jars(path)
78
- optional = ['saxon9-unpack.jar', 'saxon9-sql.jar'].map { |jar| path.join(jar) }.select { |jar| jar.file? }
79
- icu = path.children.find { |jar| jar.extname == '.jar' && !jar.basename.to_s.match(/^saxon-icu|^icu4j/).nil? }
80
- ([icu] + optional).compact
81
- end
91
+ def main_jar(path)
92
+ ['saxon9he.jar', 'saxon9pe.jar', 'saxon9ee.jar'].map { |jar| path.join(jar) }.find { |jar| jar.file? }
93
+ end
82
94
 
83
- def self.jars_not_on_classpath?
84
- begin
85
- Java::net.sf.saxon.s9api.Processor
86
- false
87
- rescue
88
- true
95
+ def extra_jars(path)
96
+ optional = ['saxon9-unpack.jar', 'saxon9-sql.jar'].map { |jar| path.join(jar) }.select { |jar| jar.file? }
97
+ icu = path.children.find { |jar| jar.extname == '.jar' && !jar.basename.to_s.match(/^saxon-icu|^icu4j/).nil? }
98
+ ([icu] + optional).compact
89
99
  end
90
- end
91
100
 
92
- def self.add_jars_to_classpath!(saxon_home, jars)
93
- jars.each do |jar|
94
- $CLASSPATH << jar.to_s
101
+ def add_jars_to_classpath!(saxon_home, jars)
102
+ jars.each do |jar|
103
+ $CLASSPATH << jar.to_s
104
+ end
95
105
  end
96
106
  end
97
107
  end
@@ -4,6 +4,6 @@ module Saxon
4
4
  # Provides the saxon-rb and underlying Saxon library versions
5
5
  module Version
6
6
  # The version of the saxon-rb gem (not of Saxon itself)
7
- WRAPPER = "0.7.2"
7
+ WRAPPER = "0.7.3"
8
8
  end
9
9
  end
@@ -36,12 +36,17 @@ module Saxon
36
36
  end
37
37
  end
38
38
 
39
- # ItemType representing QNames
40
- XS_QNAME = ItemType.get_type('xs:QName')
41
- # ItemType representing NOTATION
42
- XS_NOTATION = ItemType.get_type('xs:NOTATION')
43
-
44
39
  class << self
40
+ # ItemType representing QNames
41
+ def xs_qname
42
+ @xs_qname ||= ItemType.get_type('xs:QName')
43
+ end
44
+
45
+ # ItemType representing NOTATION
46
+ def xs_notation
47
+ @xs_notation ||= ItemType.get_type('xs:NOTATION')
48
+ end
49
+
45
50
  # Convert a single Ruby value into an XDM::AtomicValue
46
51
  #
47
52
  # If no explicit {ItemType} is passed, the correct type is guessed based
@@ -71,8 +76,8 @@ module Saxon
71
76
 
72
77
  item_type = ItemType.get_type(item_type)
73
78
 
74
- return new(Saxon::S9API::XdmAtomicValue.new(value.to_java)) if item_type == XS_QNAME && value_is_qname?(value)
75
- raise NotationCannotBeDirectlyCreated if item_type == XS_NOTATION
79
+ return new(Saxon::S9API::XdmAtomicValue.new(value.to_java)) if item_type == xs_qname && value_is_qname?(value)
80
+ raise NotationCannotBeDirectlyCreated if item_type == xs_notation
76
81
 
77
82
  value_lexical_string = item_type.lexical_string(value)
78
83
  new(new_s9_xdm_atomic_value(value_lexical_string, item_type))
@@ -91,7 +96,7 @@ module Saxon
91
96
  # @return [Saxon::XDM::AtomicValue]
92
97
  def from_lexical_string(value, item_type)
93
98
  item_type = ItemType.get_type(item_type)
94
- raise CannotCreateQNameFromString if item_type == XS_QNAME
99
+ raise CannotCreateQNameFromString if item_type == xs_qname
95
100
  new(new_s9_xdm_atomic_value(value.to_s, item_type))
96
101
  end
97
102
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saxon-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: java
6
6
  authors:
7
7
  - Matt Patterson
@@ -163,6 +163,7 @@ files:
163
163
  - ".circleci/config.yml"
164
164
  - ".gitignore"
165
165
  - ".rspec"
166
+ - ".rspec-jar-loading"
166
167
  - ".ruby-version"
167
168
  - ".yardopts"
168
169
  - CODE_OF_CONDUCT.md