canon 0.3.55 → 0.3.56

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: 50a34a46b082f7aa0555199b09780ec1e8c5f38f76656e2a6899a54b3b96a90f
4
- data.tar.gz: f2b7cbf27874cc6bbd6ab5615a14ad43a2ea6cb7e8ebdd9a3894efcc112c103c
3
+ metadata.gz: 13ed2f639e9860dac532ef7dfde80a21e76306a14282adabdf0923224c7cbacf
4
+ data.tar.gz: ebf4db9c33fce786057bd2cb47698deca9ee3f42e85fa76df5e7e0f9429e251c
5
5
  SHA512:
6
- metadata.gz: 5474c6581c262c497d51cebfe91b0882a096a3340acfd7f7c77d67ca064d12164cbc423b6c4865138a80a660115755597672c3e7a1dbe380ddf24f94e8c55d0d
7
- data.tar.gz: 8dac986a479c7820ec6d780c116d906ef34489cbfdf15f19ebad9f013c0ec90070ad75801471e4cd8e4be4f1e9c62faaeaa8b97d42a296286f1c0842ce9d8d9b
6
+ metadata.gz: cec261c87059cd1b27874937a2b801c9d77bdcc05eb346c52dcfb0b3199ac4cc501cd46ae19b54133b491feab360b2eeffebfdd4e804eba112d7a250b0959883
7
+ data.tar.gz: 02b82fe957da9ec3b01bf669d28c8be0187adb1ab18ffb7b37f055d223d3bff4b1f14aec19f16e8b509d4cdd07414ecd1d5003916944c3f22186d5a3e17b329c
data/CLAUDE.md CHANGED
@@ -128,7 +128,7 @@ The comparison pipeline flows through four independent layers:
128
128
  - `lib/canon/formatters/` — Pretty-printers for canonicalization/formatting (distinct from diff formatters). `XmlFormatter` supports Canonical XML (C14N).
129
129
  - `lib/canon/config.rb` — Global configuration with per-format settings (profiles, preprocessing, diff options). Read at runtime via `Canon::Config.instance`.
130
130
  - `lib/canon/rspec_matchers.rb` — RSpec matchers (`be_xml_equivalent_to`, `be_json_equivalent_to`, etc.). These delegate to `Canon::Comparison.equivalent?` with the global config. Automatically included in RSpec.
131
- - `lib/canon/xml/sax_builder.rb` — SAX-based canon-tree builder (~6x faster than DOM parsing for large documents). Engine-neutral; `lib/canon/xml/sax.rb` selects the driver (`NokogiriDriver` on CRuby, `MoxmlDriver` under Opal).
131
+ - `lib/canon/xml/sax_builder.rb` — SAX-based canon-tree builder (~6x faster than DOM parsing for large documents). Engine-neutral; `lib/canon/xml/sax.rb` selects the driver following the resolved adapter (`MoxmlDriver` → leptris SAX under the leptris default, `NokogiriDriver` when the adapter is nokogiri, `MoxmlDriver` under Opal).
132
132
 
133
133
  ### XML Engines
134
134
 
@@ -137,9 +137,9 @@ Canon is engine-agnostic across three seams (MECE — one concern per module):
137
137
  - `Canon::XmlBackend` — XML engine selection. The default follows moxml's resolved adapter: **leptris whenever it is installed** (parse ~1.6x, serialize ~3.8x vs Nokogiri), raw Nokogiri otherwise (wrapping Nokogiri in moxml buys nothing — the wrapper adds 2-3x overhead). `:moxml` under Opal. `CANON_XML_BACKEND=nokogiri|moxml` forces either engine.
138
138
  - `Canon::XmlParsing` — the only place that talks to engines for XML parse/serialize (moxml parses pass `readonly: true` — canon never mutates engine documents); node type queries answer for ANY recognized node (Nokogiri or moxml) by type, never by active backend — user-supplied Nokogiri nodes keep working under the moxml engine.
139
139
  - `Canon::Html::NokogiriSupport` — HTML is always Nokogiri on CRuby (moxml has no HTML adapter, leptris no HTML parser); independent of the XML engine.
140
- - `Canon::Xml::Sax` — SAX driver selection: `NokogiriDriver` on CRuby (per-event C callbacks beat FFI SAX today), `MoxmlDriver` under Opal. The builder (`SaxBuilder`) is engine-neutral.
140
+ - `Canon::Xml::Sax` — SAX driver selection follows the resolved adapter: `MoxmlDriver` (leptris SAX — the comparison hot path, CI-gated in the split flip) under the leptris default, `NokogiriDriver` when the resolved adapter is nokogiri, `MoxmlDriver` under Opal. The builder (`SaxBuilder`) is engine-neutral.
141
141
 
142
- Engine parity is complete through libleptris 1.9.8 / leptris-ruby 1.9.33 / moxml 0.5.12: attribute-value normalization, prolog/epilog PIs and comments, DTD ATTLIST defaults off by default (opt-in via `ParseOptions::DTDATTR`), PI-data whitespace matching libxml2, materialize with namespace declarations and a root-subtree-only record contract (moxml#140), readonly parse, deterministic `Document#free` (wired into `from_moxml_xml` — moxml#134). Canon's moxml conversion is record-based (`build_from_moxml` consumes `materialize` records — no per-node wrapper allocation; ~0.55x the Nokogiri conversion). `spec/canon/xml/engine_parity_spec.rb` is fully green. Remaining product gaps: moxml#129 (serializer byte parity — last blocker for pretty-printing on leptris) and leptris#594 (SAX at parity, not faster the SAX driver stays Nokogiri). Pretty-printers (`PrettyPrinter::Xml`, `XmlNormalized`) deliberately stay on the Nokogiri pipeline — pretty-printed bytes are canon's product.
142
+ Engine parity is complete through libleptris 1.9.8 / leptris-ruby 1.9.33 / moxml 0.5.12: attribute-value normalization, prolog/epilog PIs and comments, DTD ATTLIST defaults off by default (opt-in via `ParseOptions::DTDATTR`), PI-data whitespace matching libxml2, materialize with namespace declarations and a root-subtree-only record contract (moxml#140), readonly parse, deterministic `Document#free` (wired into `from_moxml_xml` — moxml#134). Canon's moxml conversion is record-based (`build_from_moxml` consumes `materialize` records — no per-node wrapper allocation; ~0.55x the Nokogiri conversion). `spec/canon/xml/engine_parity_spec.rb` is fully green. Pretty-printing runs the leptris serializer through `PrettyPrinter::Xml#moxml_format` (byte parity via moxml#153/#155/#156; the #167 escaping race fixed in 0.5.28), with Nokogiri serving the fallback engine and Opal — pretty-printed bytes are canon's product, gated by the fixture-integrity suite and the CI performance gate.
143
143
 
144
144
  Engine A/B testing: `CANON_XML_BACKEND=nokogiri bundle exec rspec` (or `=moxml` to force leptris when it isn't the resolved default). The default suite must stay green under BOTH values; the only expected pendings are the upstream-tracked ones. The benchmark header (`rake performance:quick`) reports the active engine.
145
145
 
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.55"
4
+ VERSION = "0.3.56"
5
5
  end
@@ -45,7 +45,12 @@ module Canon
45
45
 
46
46
  def characters(_string); end
47
47
 
48
- def cdata_block(_string); end
48
+ # The builder protocol the SAX drivers forward to is `cdata`
49
+ # (MoxmlDriver#on_cdata and NokogiriDriver#cdata_block both call
50
+ # builder.cdata); the nokogiri-style name here made every
51
+ # CDATA-bearing probe raise NoMethodError under the flipped
52
+ # leptris SAX engine.
53
+ def cdata(_string); end
49
54
 
50
55
  def comment(_string); end
51
56
 
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.55
4
+ version: 0.3.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.