moxml 0.5.73 → 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: ace6b41dffe3e14f90cdc9c356dc35297f7eb522c0b6e0181317e7af30a06228
4
- data.tar.gz: 31db091908469cf25de7032bd43263a72507cbb6a99ce91c0786a8193c54b611
3
+ metadata.gz: 4a7826afac575979216d86bfd086b87c12ad4a02b33672487bc7af7705ddd250
4
+ data.tar.gz: 334bd49580f0237548ee93d968f5f89a0fb9495a3f5bd3bf788366b02dee9599
5
5
  SHA512:
6
- metadata.gz: ac58af0ccdb2d511a8ec245ab25616748985ba36e3f658fa7a91cc20afede1c5ab20bae2103ceaebd7d54ff72d989e9c3dc034206ae20431593ab1507a6f5600
7
- data.tar.gz: 3a6ce368d0ba3ab911db0e692282511cbe4502c5986c6fc88ee0bd12690fe460b5b4728b67bfe66f5109a7b85354c169e03d0a3217dad7348d963ab7eafc50ca
6
+ metadata.gz: e10a1b6e5d89e0f47e97ad9ab3d53e886a4107d52e7db88f41a55ac8f743ec889abce396ba2c18b2396838650d19f740c6c8d2a938290bf1161d45e47737a90c
7
+ data.tar.gz: 1f08889c5df41ea298616e7a247ee15035810c3664f0a2848fc7e591042b98de257d189f067dd002e3db68a41f704c3bc3e763a0753b5cac2ee70ceb10d83096
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gemspec
9
9
  gem "benchmark"
10
10
  gem "benchmark-ips"
11
11
  gem "get_process_mem"
12
- gem "leptris", "~> 1.9.216"
12
+ gem "leptris", "~> 1.9.222"
13
13
  gem "libxml-ruby", ">= 5.0"
14
14
  gem "nokogiri", "~> 1.18"
15
15
  gem "openssl", "~> 3.0"
@@ -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.73"
4
+ VERSION = "0.5.75"
5
5
  end
data/moxml.gemspec CHANGED
@@ -12,7 +12,8 @@ Gem::Specification.new do |spec|
12
12
  spec.description = <<~DESCRIPTION
13
13
  Moxml is a unified XML manipulation library that provides a common API
14
14
  for XML node navigation, manipulation, building and XPath querying
15
- interface covering multiple parser implementations including Nokogiri, Oga, REXML, Ox, LibXML.
15
+ interface covering multiple parser implementations including Leptris,
16
+ Nokogiri, Oga, REXML, Ox, HeadedOx and LibXML.
16
17
  DESCRIPTION
17
18
 
18
19
  spec.homepage = "https://github.com/lutaml/moxml"
metadata CHANGED
@@ -1,19 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.73
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
15
15
  for XML node navigation, manipulation, building and XPath querying
16
- interface covering multiple parser implementations including Nokogiri, Oga, REXML, Ox, LibXML.
16
+ interface covering multiple parser implementations including Leptris,
17
+ Nokogiri, Oga, REXML, Ox, HeadedOx and LibXML.
17
18
  email:
18
19
  - open.source@ribose.com
19
20
  executables: []