canon 0.3.119 → 0.3.121
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 +4 -4
- data/docs/HANDOFF.adoc +13 -7
- data/lib/canon/comparison.rb +36 -0
- data/lib/canon/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea0a5d94e934c12df80540761d13587ddf9adabad10db384f7bfad3b640affbf
|
|
4
|
+
data.tar.gz: 27ad206ee9f2fc7bb0c37b09948716ee46bb42fbaa2894b813feb90246823343
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 961d3fda5a67a3219e7fad26f5d90cf52ad691e7e625d8f831d29d29cd81593147617cef7dbe17073ecf7d1ad279af0ea941f2d20a88652857e90f373bd6bdec
|
|
7
|
+
data.tar.gz: 99f8e9910736ee42355ccd4a7350d9ba56ed819eb1a2530ed326dd2cc2524b4ddcb50ad7a3e87972279d962637ab2b04d65f79afcfb8b99562ad4697a1e01325
|
data/docs/HANDOFF.adoc
CHANGED
|
@@ -185,13 +185,19 @@ relaton 3.0.4, expressir (admits), lutaml-model 0.8.156 (admits
|
|
|
185
185
|
suite is the executable proof: 489/0 on the resolved modern stack.
|
|
186
186
|
|
|
187
187
|
|metanorma-standoc legs: parsanol 1.3.120 removed the `mode` alias
|
|
188
|
-
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
|Grammar side DONE (pubid-grammar main); vendor step pending — owner
|
|
189
|
+
|Root-caused to pubid's VENDORED `data/parg/iso.json`: the artifact
|
|
190
|
+
bake predates parsanol 1.3.121 and still carries
|
|
191
|
+
`grammar PubidIso ... mode "v1"`. The grammar sources are already
|
|
192
|
+
fixed on pubid-grammar main (the 1.3.121 fleet re-base, 21bcfd6);
|
|
193
|
+
the remaining step is the vendor commit into pubid's `data/parg/`
|
|
194
|
+
(proven mechanical: baking origin/main at 1.3.121 yields `edition 2`
|
|
195
|
+
headers with bindings intact — iso 84, bsi 92, ashrae 37). The
|
|
196
|
+
owner's `worktrees/grammar-rebake` is on it. standoc's severity
|
|
197
|
+
question (#1318/#1324) is re-pinned in metanorma-standoc#1333:
|
|
198
|
+
relaton 3.0.2 degrades `ISO 0a` to RELATON_4 at severity 3, which a
|
|
199
|
+
severity-2 filter legitimately drops; that PR's CI goes green the
|
|
200
|
+
moment the vendor lands.
|
|
195
201
|
|===
|
|
196
202
|
|
|
197
203
|
== Mechanics every team hits
|
data/lib/canon/comparison.rb
CHANGED
|
@@ -637,6 +637,15 @@ module Canon
|
|
|
637
637
|
resolved = opts.dup
|
|
638
638
|
format_hint = resolved[:format]
|
|
639
639
|
|
|
640
|
+
# Arrays have no document format of their own: suites extract
|
|
641
|
+
# value lists (attributes, anchors) or node lists and compare
|
|
642
|
+
# them as arrays. Element-wise, order-sensitive, each element
|
|
643
|
+
# recursing through the normal pipeline (strings short-circuit,
|
|
644
|
+
# nodes take their own format path).
|
|
645
|
+
if obj1.is_a?(Array) && obj2.is_a?(Array)
|
|
646
|
+
return array_diff(obj1, obj2, resolved)
|
|
647
|
+
end
|
|
648
|
+
|
|
640
649
|
# Detect formats (with explicit hint) and pre-parse HTML strings
|
|
641
650
|
# through Nokogiri::HTML5 so html4 and html5 share HTML's
|
|
642
651
|
# whitespace-sensitivity semantics (issue #118). Pre-parsing
|
|
@@ -690,6 +699,33 @@ module Canon
|
|
|
690
699
|
# @param format1 [Symbol]
|
|
691
700
|
# @param format2 [Symbol]
|
|
692
701
|
# @return [Symbol]
|
|
702
|
+
def array_diff(arr1, arr2, opts = {})
|
|
703
|
+
verbose = opts[:verbose]
|
|
704
|
+
if arr1.size != arr2.size
|
|
705
|
+
return verbose ? [:size_mismatch] : false
|
|
706
|
+
end
|
|
707
|
+
|
|
708
|
+
# Elements are extracted values, not documents: strings compare
|
|
709
|
+
# literally (a matcher format hint must not turn "ref1" into an
|
|
710
|
+
# XML fragment, where every bare string parses equal), and the
|
|
711
|
+
# format hint is dropped for the recursion on other scalars.
|
|
712
|
+
scalar_opts = opts.except(:verbose, :format)
|
|
713
|
+
diffs = []
|
|
714
|
+
arr1.zip(arr2).each_with_index do |(a, b), i|
|
|
715
|
+
eq = if a.is_a?(String) && b.is_a?(String)
|
|
716
|
+
a == b
|
|
717
|
+
else
|
|
718
|
+
equivalent?(a, b, scalar_opts)
|
|
719
|
+
end
|
|
720
|
+
next if eq == true
|
|
721
|
+
|
|
722
|
+
return false unless verbose
|
|
723
|
+
|
|
724
|
+
diffs << { index: i, difference: eq == false ? :different : eq }
|
|
725
|
+
end
|
|
726
|
+
verbose ? diffs : diffs.empty?
|
|
727
|
+
end
|
|
728
|
+
|
|
693
729
|
def normalize_comparison_format(format1, format2)
|
|
694
730
|
return format2 if format1 == :ruby_object &&
|
|
695
731
|
%i[json yaml].include?(format2)
|
data/lib/canon/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: canon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.121
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: diff-lcs
|
|
@@ -142,14 +142,14 @@ dependencies:
|
|
|
142
142
|
requirements:
|
|
143
143
|
- - "~>"
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: 0.6.
|
|
145
|
+
version: 0.6.55
|
|
146
146
|
type: :runtime
|
|
147
147
|
prerelease: false
|
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
150
|
- - "~>"
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: 0.6.
|
|
152
|
+
version: 0.6.55
|
|
153
153
|
description: |-
|
|
154
154
|
Canon provides canonicalization and pretty-printing for various serialization
|
|
155
155
|
formats (XML, HTML, JSON, YAML), producing standardized forms suitable for
|