canon 0.3.69 → 0.3.71

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: 4f23fa758538acdbe352d58250d880b04e905191ce3c44b30528580cee06f224
4
- data.tar.gz: c33b27f2839764f6d91fded3b3d7cb2042dc7e91d1d7a630037bcda0ce645c37
3
+ metadata.gz: 958eeca178b78a0f3de23eb6ab23674aacb3fee50c6671da8911b1225431278f
4
+ data.tar.gz: e9d9cee428547b4117a7b15e335f9b31ae0c76bb9120c76b0f362e5a499dfde8
5
5
  SHA512:
6
- metadata.gz: 6137233af91995ea5956d35fa154d2c206557e30c7fd9d1ced455667560f05810a034c4a1c407e4635fdbaefe8ad9929ad5b28cdf4cf5118990d83865611c4a3
7
- data.tar.gz: 16a631574442c56fc87e5a48851643630ba9342d7e06f4b0b938f28a24792d5b414884099ec7c767fedb067971cc6ab82cf48871d55a1d1551f9cc5d7886e868
6
+ metadata.gz: 17f11eed81fe5f50ef94ca58ea8ce3932281b0b478a8143439c148e15fd4519abe0d754e9a14d23b294f366523668c97ac21d96418190fbc7c65e3a86373b77a
7
+ data.tar.gz: 7a3cf3fb1b732e84a7167a7f184cd2085afa43023829f77021e91197c40c4e8d9f9910847ca18d641d144c3c7aecb55cea5657441e726f95833210f333bbc705
@@ -342,6 +342,17 @@ puts "Defaults: #{resolver.defaults.inspect}"
342
342
  puts "Source of algorithm: #{resolver.source_for(:algorithm)}"
343
343
  ----
344
344
 
345
+ === Engine digests: LEPTRIS_DIGEST_ATTR_ORDER
346
+
347
+ Canon's XML digest gate reads one *engine-level* variable that belongs to
348
+ libleptris, not to canon. Canon never sets it — the host decides:
349
+
350
+ `LEPTRIS_DIGEST_ATTR_ORDER=1`:: Makes attribute order identity-bearing in
351
+ libleptris' structural digests. Canon detects this and skips the SAX
352
+ signature probe in verbose diff reports — attribute-order identity is then
353
+ proven by the digest itself. Digest *values* change process-wide, so enable
354
+ it only if nothing in your process persists leptris digests across restarts.
355
+
345
356
  == See also
346
357
 
347
358
  * link:size-limits/[Size Limits] - File size and node count limits
@@ -202,16 +202,14 @@ module Canon
202
202
  def verbose_report_proven_empty?(n1, n2, opts)
203
203
  return true unless opts[:verbose]
204
204
 
205
- # Identical input parses identically — differences and
206
- # attribute order coincide by construction. Recover errors
207
- # ride the fingerprint's diag check when the engine exposes
208
- # them (libleptris 1.9.205+, #1200); otherwise the one SAX
209
- # scan covers the parse-error banner (issue #130).
210
- if n1 == n2
211
- return true if Xml::DigestGate.recover_diags_available?
212
-
213
- return !Xml::Sax.probe(n1).saw_error?
214
- end
205
+ # Identical input parses identically, and certify has
206
+ # already declined any recover-error document through the
207
+ # wrapper's parse_diagnostics — the banner cannot be lost.
208
+ return true if n1 == n2
209
+ # With order-sensitive digests (host-set flag), attribute
210
+ # order is digest-proven as well — the signature probe has
211
+ # nothing left to answer.
212
+ return true if Xml::DigestGate.attr_order_digest?
215
213
 
216
214
  left = Xml::Sax.probe(n1)
217
215
  return false if left.saw_error?
data/lib/canon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canon
4
- VERSION = "0.3.69"
4
+ VERSION = "0.3.71"
5
5
  end
@@ -21,26 +21,24 @@ module Canon
21
21
  module DigestGate
22
22
  module_function
23
23
 
24
- # libleptris 1.9.205+ records duplicate-attribute recover
25
- # events on the parsed document (#1200): read through the
26
- # FFI diag counter. Evaluated lazily at call time — a load-time
27
- # constant would freeze before leptris loads (defined? never
28
- # resolves pending autoloads). When the adapter is not leptris
29
- # (or the binding predates the surface), the verbose lane
30
- # falls back to the SAX probe for its error scan.
31
- def recover_diags_available?
32
- defined?(::Leptris::XML::FFI) &&
33
- ::Leptris::XML::FFI.respond_to?(:leptris_document_parse_diag_count)
34
- rescue StandardError
35
- false
36
- end
37
-
24
+ # moxml 0.5.76+ (moxml#271) surfaces the engine's recover
25
+ # diagnostics — duplicate-attribute events and the like (#1200)
26
+ # — as Document#parse_diagnostics. The direct-leptris-FFI
27
+ # reach-in this replaced was the gate's one documented seam
28
+ # exception; the wrapper ends it.
38
29
  def recover_diags?(doc)
39
- return false unless recover_diags_available?
30
+ !doc.parse_diagnostics.empty?
31
+ end
40
32
 
41
- native = doc.native
42
- native = native.c_ptr if native.respond_to?(:c_ptr)
43
- ::Leptris::XML::FFI.leptris_document_parse_diag_count(native).positive?
33
+ # Whether the HOST opted into attribute-order-sensitive digests
34
+ # (libleptris 1.9.228 honors LEPTRIS_DIGEST_ATTR_ORDER per
35
+ # digest call; leptris#1297). Canon reads the env — never
36
+ # writes it: the flag re-spaces digest values process-wide, so
37
+ # enabling it is the host's call, not a library's. When set,
38
+ # digest equality proves attribute-order identity too, and the
39
+ # verbose lane's signature probe becomes redundant.
40
+ def attr_order_digest?
41
+ ENV["LEPTRIS_DIGEST_ATTR_ORDER"] == "1"
44
42
  end
45
43
 
46
44
  def available?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.69
4
+ version: 0.3.71
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.9.222
47
+ version: 1.9.228
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.9.222
54
+ version: 1.9.228
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: moxml
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.5.73
61
+ version: 0.5.78
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.5.73
68
+ version: 0.5.78
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: paint
71
71
  requirement: !ruby/object:Gem::Requirement