moxml 0.5.74 → 0.5.75

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: 9502f77654d0b09a3a8ab3b926702ee07e07009076fbeb4fd7013eb5b2b39499
4
- data.tar.gz: 21d7b7dc2742200d83ac2d89c1610857cb0bf90590ef260052ad287bcb427170
3
+ metadata.gz: 4a7826afac575979216d86bfd086b87c12ad4a02b33672487bc7af7705ddd250
4
+ data.tar.gz: 334bd49580f0237548ee93d968f5f89a0fb9495a3f5bd3bf788366b02dee9599
5
5
  SHA512:
6
- metadata.gz: ae16970a10ade16adfb8f186a6269db7c6e5f94374737eb82bee0e5fb3609719171fcb731db2f52b86948848c938cca984255f55dfaf4cfc854e384602c8e32a
7
- data.tar.gz: 3f2f44d095a8d0fc6ceb0e506e930a16ef2afaa82f817114fe3dafd609a917e8eac7dd4f2b247caa74a7da9b0642b035432cb2cdfd3f6359ac2d0b56b8e19a59
6
+ metadata.gz: e10a1b6e5d89e0f47e97ad9ab3d53e886a4107d52e7db88f41a55ac8f743ec889abce396ba2c18b2396838650d19f740c6c8d2a938290bf1161d45e47737a90c
7
+ data.tar.gz: 1f08889c5df41ea298616e7a247ee15035810c3664f0a2848fc7e591042b98de257d189f067dd002e3db68a41f704c3bc3e763a0753b5cac2ee70ceb10d83096
@@ -332,7 +332,9 @@ module Moxml
332
332
  root.is_a?(::Leptris::XML::Document)
333
333
 
334
334
  root.visit do |node, entering, depth|
335
- yield Moxml::Node.wrap(node, context) if entering && depth.positive?
335
+ if entering && depth.positive?
336
+ yield Moxml::Node.wrap_with(node, context, self)
337
+ end
336
338
  end
337
339
  end
338
340
 
@@ -1060,7 +1062,22 @@ module Moxml
1060
1062
  node.target
1061
1063
  end
1062
1064
 
1065
+ # Walk-minted binding nodes carry the engine's kind int in
1066
+ # @node_type (the visit callback primes it); one ivar read
1067
+ # replaces the class-case chain on the per-wrap hot path.
1068
+ VISIT_NODE_TYPES = %i[element text comment cdata
1069
+ processing_instruction doctype].freeze
1070
+
1063
1071
  def node_type(node)
1072
+ if node.is_a?(::Leptris::XML::Node) &&
1073
+ node.instance_variable_defined?(:@node_type)
1074
+ kind = node.instance_variable_get(:@node_type)
1075
+ if kind.is_a?(Integer)
1076
+ mapped = VISIT_NODE_TYPES[kind]
1077
+ return mapped if mapped
1078
+ end
1079
+ end
1080
+
1064
1081
  if NATIVE_READ_LAYER &&
1065
1082
  node.is_a?(::Leptris::XML::NativeNode)
1066
1083
  type = NN_NODE_TYPE.bind_call(node)
data/lib/moxml/node.rb CHANGED
@@ -571,12 +571,18 @@ module Moxml
571
571
  end
572
572
 
573
573
  def self.wrap(node, context)
574
+ wrap_with(node, context, adapter(context))
575
+ end
576
+
577
+ # The wrap path with the adapter already resolved — walk entry
578
+ # points know the adapter (it is self); one config-chain hop
579
+ # saved per wrapped node.
580
+ def self.wrap_with(node, context, adapter)
574
581
  return nil if node.nil?
575
582
 
576
583
  cached = context.wrapper_for(node)
577
584
  return cached if cached
578
585
 
579
- adapter = adapter(context)
580
586
  type = adapter.node_type(node)
581
587
 
582
588
  # Extend-in-place (issue #230): adapters whose natives can
data/lib/moxml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Moxml
4
- VERSION = "0.5.74"
4
+ VERSION = "0.5.75"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.74
4
+ version: 0.5.75
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-09-22 00:00:00.000000000 Z
11
+ date: 2026-09-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Moxml is a unified XML manipulation library that provides a common API