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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c7f014834dac890a353a1e85abe80dc834e81f20b853cfa00f51a06c423a699
4
- data.tar.gz: 3b849925479fcec2777b22619bee9ab3d710fd33ce29b10bf2873c90d3095192
3
+ metadata.gz: 60a7f65c6d95c4c10672244fe19a027022aadb8de563d9f3ac58da151085e883
4
+ data.tar.gz: 47f17024dd3d1a7055cef281439038d42bfb92527765f92d68392fbb14390d39
5
5
  SHA512:
6
- metadata.gz: 7def7dca16c59b0e3f3952b12f814ad93b38cb108654903471320e0e3c7d55418af60068a114eb9d3fcd4e260bdc806c5cd65b9471b06a85b5c5a223f6373395
7
- data.tar.gz: b36133cf1c3c0597e12b880057ebdc5af80689ab59bb8983ff631208d31db994151858521fb8897c88c00d1651e0ac25ad376584558a3b5b514cfd409c2f20be
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
- JSON.parse(obj)
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canon
4
- VERSION = "0.1.12"
4
+ VERSION = "0.1.13"
5
5
  end
@@ -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) do |config|
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.12
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-01-21 00:00:00.000000000 Z
11
+ date: 2026-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs