moxml 0.5.138 → 0.5.139
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/moxml/adapter/leptris.rb +65 -25
- data/lib/moxml/version.rb +1 -1
- 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: 271ff9c6c8d5502c0cd427efdc84e5ba8f123d0008e100a3e7303d478b4a47eb
|
|
4
|
+
data.tar.gz: c87777565ab89568a4195754e4f6c84fe5bd04e230416e0f4e2a5dc605945b54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5d766ba5edbce1fcba2e14c7227e22c5f3ca0d96a01ab1f2ae2dee5c97f76fc8bb5723e0b1349fe5aee90b026f3532aae07291e17bd2a785761a9f6a7d99e3e
|
|
7
|
+
data.tar.gz: e24616f241e0e846db54db729ad564bf1363f53c7fd7ea422ec6ee3a605138b934d79fe49627b2942c8716b1e2b6655909f2ef84fec0b9ca17fddaa022f23500
|
|
@@ -92,8 +92,20 @@ module Moxml
|
|
|
92
92
|
# NativeNode#[]), so the adapter's native fast paths speak to
|
|
93
93
|
# the native layer through these bound entries — bind_call is
|
|
94
94
|
# the same C dispatch without the shadow lookup.
|
|
95
|
+
# Always defined: nothing can be an instance of an anonymous
|
|
96
|
+
# class, so on the FFI-only lane is_a?(NN) is uniformly false
|
|
97
|
+
# and the ungated native-node conditionals keep their
|
|
98
|
+
# semantics without the compiled ext.
|
|
99
|
+
NN = NATIVE_READ_LAYER ? ::Leptris::XML::NativeNode : Class.new
|
|
100
|
+
|
|
101
|
+
# The binding's Document.parse gained the strict: kwarg later
|
|
102
|
+
# than the native layer's default-strict behavior — probe the
|
|
103
|
+
# face instead of version-gating (the RECOVER_MODE pattern).
|
|
104
|
+
STRICT_PARSE_KWARG =
|
|
105
|
+
::Leptris::XML::Document.method(:parse)
|
|
106
|
+
.parameters.any? { |_, key| key == :strict }
|
|
107
|
+
|
|
95
108
|
if NATIVE_READ_LAYER
|
|
96
|
-
NN = ::Leptris::XML::NativeNode
|
|
97
109
|
NN_ATTRIBUTE = NN.instance_method(:attribute)
|
|
98
110
|
NN_NAME = NN.instance_method(:name)
|
|
99
111
|
NN_PARENT = NN.instance_method(:parent)
|
|
@@ -397,6 +409,27 @@ module Moxml
|
|
|
397
409
|
end
|
|
398
410
|
end
|
|
399
411
|
|
|
412
|
+
class << self
|
|
413
|
+
# These three live OUTSIDE the NATIVE_READ_LAYER gate:
|
|
414
|
+
# ungated methods (register_mint_klasses!, the
|
|
415
|
+
# create/register seams) and the specs' singleton const_get
|
|
416
|
+
# read them, and on the FFI-only lane the gate's Identity
|
|
417
|
+
# classes do not exist. NATIVE_MUTATIONS_COHERENT is false
|
|
418
|
+
# without the native layer, so all three evaluate false
|
|
419
|
+
# there.
|
|
420
|
+
NATIVE_IDENTITY =
|
|
421
|
+
NATIVE_MUTATIONS_COHERENT &&
|
|
422
|
+
Gem::Version.new(::Leptris::VERSION) >= Gem::Version.new("1.9.174.4")
|
|
423
|
+
|
|
424
|
+
NATIVE_C_MINT =
|
|
425
|
+
NATIVE_IDENTITY &&
|
|
426
|
+
Gem::Version.new(::Leptris::VERSION) >= Gem::Version.new("1.9.255.2")
|
|
427
|
+
|
|
428
|
+
NATIVE_KLASS_CHILDREN =
|
|
429
|
+
NATIVE_IDENTITY &&
|
|
430
|
+
Gem::Version.new(::Leptris::VERSION) >= Gem::Version.new("1.9.193.2")
|
|
431
|
+
end
|
|
432
|
+
|
|
400
433
|
if NATIVE_READ_LAYER
|
|
401
434
|
# root NativeNode -> binding document (recorded at #root
|
|
402
435
|
# mint; the native layer exposes no document accessor).
|
|
@@ -501,10 +534,6 @@ module Moxml
|
|
|
501
534
|
TEXT.include(Reads)
|
|
502
535
|
end
|
|
503
536
|
|
|
504
|
-
NATIVE_IDENTITY =
|
|
505
|
-
NATIVE_MUTATIONS_COHERENT &&
|
|
506
|
-
Gem::Version.new(::Leptris::VERSION) >= Gem::Version.new("1.9.174.4")
|
|
507
|
-
|
|
508
537
|
# leptris-ruby#246 klass-propagating reads: the read
|
|
509
538
|
# family (children/element_children/next_sibling/parent)
|
|
510
539
|
# mints the mapped subclass per kind, so children arrive
|
|
@@ -521,14 +550,6 @@ module Moxml
|
|
|
521
550
|
# classes — walked and built nodes arrive already carrying the
|
|
522
551
|
# contract, and the Ruby shell mint drops out entirely
|
|
523
552
|
# (moxml#288: the entire remaining walk/build gap).
|
|
524
|
-
NATIVE_C_MINT =
|
|
525
|
-
NATIVE_IDENTITY &&
|
|
526
|
-
Gem::Version.new(::Leptris::VERSION) >= Gem::Version.new("1.9.255.2")
|
|
527
|
-
|
|
528
|
-
NATIVE_KLASS_CHILDREN =
|
|
529
|
-
NATIVE_IDENTITY &&
|
|
530
|
-
Gem::Version.new(::Leptris::VERSION) >= Gem::Version.new("1.9.193.2")
|
|
531
|
-
|
|
532
553
|
if NATIVE_KLASS_CHILDREN
|
|
533
554
|
kind_classes = [
|
|
534
555
|
Identity::ELEMENT,
|
|
@@ -1065,6 +1086,10 @@ module Moxml
|
|
|
1065
1086
|
::Leptris::XML::Document.parse(
|
|
1066
1087
|
processed,
|
|
1067
1088
|
readonly: options[:readonly] == true,
|
|
1089
|
+
# The FFI fallback lane parses leniently by default —
|
|
1090
|
+
# the strict intent must ride explicitly or strict
|
|
1091
|
+
# callers silently get a best-effort tree.
|
|
1092
|
+
**(options[:strict] && STRICT_PARSE_KWARG ? { strict: true } : {}),
|
|
1068
1093
|
options: parse_flags(options, recover: recover,
|
|
1069
1094
|
context: _context),
|
|
1070
1095
|
)
|
|
@@ -1343,13 +1368,22 @@ module Moxml
|
|
|
1343
1368
|
# comment, cdata, pi. Parsed documents register right after
|
|
1344
1369
|
# the binding mint. Unregistered bindings (older floors, the
|
|
1345
1370
|
# C-mint off) are unchanged — the shell path stays.
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1371
|
+
# Identity lives under the NATIVE_READ_LAYER gate — on the
|
|
1372
|
+
# FFI-only lane (windows, or a binding whose native bundle
|
|
1373
|
+
# fails to load) the constant must not be referenced at load
|
|
1374
|
+
# time. register_mint_klasses! never reads it there
|
|
1375
|
+
# (NATIVE_C_MINT is false).
|
|
1376
|
+
MINT_KIND_CLASSES = if NATIVE_READ_LAYER
|
|
1377
|
+
[
|
|
1378
|
+
Identity::ELEMENT,
|
|
1379
|
+
Identity::TEXT,
|
|
1380
|
+
Identity::COMMENT,
|
|
1381
|
+
Identity::CDATA,
|
|
1382
|
+
Identity::PROCESSING_INSTRUCTION,
|
|
1383
|
+
].freeze
|
|
1384
|
+
else
|
|
1385
|
+
[].freeze
|
|
1386
|
+
end
|
|
1353
1387
|
|
|
1354
1388
|
def register_mint_klasses!(binding_doc)
|
|
1355
1389
|
return binding_doc unless NATIVE_C_MINT && binding_doc
|
|
@@ -2349,7 +2383,7 @@ module Moxml
|
|
|
2349
2383
|
# upstream (its absorbed_into? checks are not transitive) —
|
|
2350
2384
|
# those keep the pin + adoption copy. Entity references
|
|
2351
2385
|
# keep the marker flow below.
|
|
2352
|
-
if NATIVE_DOC_ABSORB && !child.is_a?(NN) &&
|
|
2386
|
+
if NATIVE_READ_LAYER && NATIVE_DOC_ABSORB && !child.is_a?(NN) &&
|
|
2353
2387
|
child.is_a?(::Leptris::XML::Node) &&
|
|
2354
2388
|
!child.is_a?(CustomizedLeptris::EntityReference)
|
|
2355
2389
|
child_doc = child.document
|
|
@@ -2447,8 +2481,11 @@ module Moxml
|
|
|
2447
2481
|
end
|
|
2448
2482
|
# 1.9.311: an absorbed element source moves through the raw
|
|
2449
2483
|
# engine faces — the binding's sibling insert drops it.
|
|
2450
|
-
|
|
2451
|
-
|
|
2484
|
+
# NATIVE_READ_LAYER: the absorb needs the raw engine add to
|
|
2485
|
+
# land the source; on the FFI lane the binding's own insert
|
|
2486
|
+
# handles it and the absorbed-source splice loses the node.
|
|
2487
|
+
if NATIVE_READ_LAYER && new_node.is_a?(::Leptris::XML::Element) &&
|
|
2488
|
+
!new_node.is_a?(NN)
|
|
2452
2489
|
new_doc = new_node.document
|
|
2453
2490
|
node_doc = node.document
|
|
2454
2491
|
if new_doc && node_doc && !new_doc.equal?(node_doc)
|
|
@@ -2477,8 +2514,11 @@ module Moxml
|
|
|
2477
2514
|
pin_foreign_owner_document(node, new_node)
|
|
2478
2515
|
# 1.9.311: an absorbed element source moves through the raw
|
|
2479
2516
|
# engine faces — the binding's sibling insert drops it.
|
|
2480
|
-
|
|
2481
|
-
|
|
2517
|
+
# NATIVE_READ_LAYER: the absorb needs the raw engine add to
|
|
2518
|
+
# land the source; on the FFI lane the binding's own insert
|
|
2519
|
+
# handles it and the absorbed-source splice loses the node.
|
|
2520
|
+
if NATIVE_READ_LAYER && new_node.is_a?(::Leptris::XML::Element) &&
|
|
2521
|
+
!new_node.is_a?(NN)
|
|
2482
2522
|
new_doc = new_node.document
|
|
2483
2523
|
node_doc = node.document
|
|
2484
2524
|
if new_doc && node_doc && !new_doc.equal?(node_doc)
|
data/lib/moxml/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.5.139
|
|
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-10-
|
|
11
|
+
date: 2026-10-16 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
|