canon 0.1.12 → 0.1.13
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/lib/canon/comparison/json_comparator.rb +5 -1
- data/lib/canon/comparison.rb +10 -0
- data/lib/canon/version.rb +1 -1
- data/lib/canon/xml/data_model.rb +1 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60a7f65c6d95c4c10672244fe19a027022aadb8de563d9f3ac58da151085e883
|
|
4
|
+
data.tar.gz: 47f17024dd3d1a7055cef281439038d42bfb92527765f92d68392fbb14390d39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 526cfa7a890447be2abc8bc358ac96a67a58ed6cb8016beebb65d087e44de48ef742c90be9ab50960c2b3d543bc7e3a7118af88a4f02af0a3e85eeea83161f14
|
|
7
|
+
data.tar.gz: 95e16e97ee9b71a1f4d220bc3c4f004f3f39f76d1b2631c68e3a5805b9f9aea4390bab9f9537dc0be254c690e6fcfa4146497ce8867bb15a28fec85387d1a0d1
|
|
@@ -83,7 +83,11 @@ module Canon
|
|
|
83
83
|
def parse_json(obj)
|
|
84
84
|
return obj unless obj.is_a?(String)
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
begin
|
|
87
|
+
JSON.parse(obj)
|
|
88
|
+
rescue JSON::ParserError
|
|
89
|
+
obj # Return original string if parsing fails
|
|
90
|
+
end
|
|
87
91
|
end
|
|
88
92
|
|
|
89
93
|
# Compare Ruby objects (Hash, Array, primitives) for JSON/YAML
|
data/lib/canon/comparison.rb
CHANGED
|
@@ -558,6 +558,16 @@ module Canon
|
|
|
558
558
|
format1
|
|
559
559
|
end
|
|
560
560
|
|
|
561
|
+
# get match_profile if it is not defined in options
|
|
562
|
+
# but defined in config
|
|
563
|
+
if opts[:match_profile].nil? &&
|
|
564
|
+
Canon::Config.instance.respond_to?(comparison_format)
|
|
565
|
+
format_config = Canon::Config.instance.public_send(comparison_format)
|
|
566
|
+
if format_config.match.profile
|
|
567
|
+
opts[:match_profile] = format_config.match.profile
|
|
568
|
+
end
|
|
569
|
+
end
|
|
570
|
+
|
|
561
571
|
case comparison_format
|
|
562
572
|
when :xml
|
|
563
573
|
XmlComparator.equivalent?(obj1, obj2, opts)
|
data/lib/canon/version.rb
CHANGED
data/lib/canon/xml/data_model.rb
CHANGED
|
@@ -22,10 +22,7 @@ module Canon
|
|
|
22
22
|
# @return [Nodes::RootNode] Root of the data model tree
|
|
23
23
|
def self.from_xml(xml_string, preserve_whitespace: false)
|
|
24
24
|
# Parse with Nokogiri
|
|
25
|
-
doc = Nokogiri::XML(xml_string)
|
|
26
|
-
config.nonet # Disable network access
|
|
27
|
-
config.strict # Strict parsing
|
|
28
|
-
end
|
|
25
|
+
doc = Nokogiri::XML(xml_string, &:nonet)
|
|
29
26
|
|
|
30
27
|
# Check for relative namespace URIs (prohibited by C14N 1.1)
|
|
31
28
|
check_for_relative_namespace_uris(doc)
|
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.1.
|
|
4
|
+
version: 0.1.13
|
|
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
|
+
date: 2026-02-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: diff-lcs
|