leptris 1.9.49-x86_64-linux → 1.9.50-x86_64-linux
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/CHANGELOG.md +16 -0
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/element.rb +7 -3
- data/lib/leptris/xml/node.rb +6 -3
- data/lib/leptris/xml/serialization.rb +7 -11
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 82771f3b1186801c18c35e8a120077fb00b699848e3e1f416abb8745c7cba9eb
|
|
4
|
+
data.tar.gz: 2e5e709e74ec8e0b4885138f2566ac74559d855213917a5908d65e3f2bb5a104
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee78523e4b6a4226d6411b438a4170fcdcf4706699815cdbfa1a6c5a5f288fbd2c9f5580b3958853e07fa61927b9f0c84ae4b1ae20453fe179838f3d113760e7
|
|
7
|
+
data.tar.gz: 77d47c27d3b3a946c4d12cded1dd533a65cab50fa7f981de9c4743c2c2aa47d17a79a42b2f2f2a53b8fb3fcc74aaee07259e07928f30a5bf9878176aabb31741
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to Leptris will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.50] - 2026-09-01
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Copies keep comment and PI children (leptris-ruby#115)**:
|
|
13
|
+
`leptris_element_copy` silently drops COMMENT and PI children —
|
|
14
|
+
the C child-copy loop reads `/* Skip COMMENT and PI nodes for
|
|
15
|
+
now */` (engine-side, filed as leptris/leptris#696 with the
|
|
16
|
+
line). Blast radius in the binding: `Element#dup/#clone` and the
|
|
17
|
+
element indent-unit path both composed through the C copy. Both
|
|
18
|
+
now round through serialization instead — the serializer
|
|
19
|
+
preserves every child kind, prefixed names, and namespace
|
|
20
|
+
declarations, and re-parsing rebuilds them all; `dup` returns a
|
|
21
|
+
tree in a NEW document (unchanged contract), detached from the
|
|
22
|
+
original (spec-pinned).
|
|
23
|
+
|
|
8
24
|
## [1.9.49] - 2026-09-01
|
|
9
25
|
|
|
10
26
|
### Added
|
data/lib/leptris/version.rb
CHANGED
data/lib/leptris/xml/element.rb
CHANGED
|
@@ -251,10 +251,14 @@ class Leptris::XML::Element < Leptris::XML::Node
|
|
|
251
251
|
self
|
|
252
252
|
end
|
|
253
253
|
|
|
254
|
+
# Deep copy in a NEW document, via serialization round-trip:
|
|
255
|
+
# leptris_element_copy silently drops COMMENT and PI children
|
|
256
|
+
# (leptris/leptris#696, leptris-ruby#115) — the serializer
|
|
257
|
+
# preserves every child kind, prefixed names, and namespace
|
|
258
|
+
# declarations, and re-parsing rebuilds them all.
|
|
254
259
|
def dup
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
Leptris::XML::Node.wrap(copy_ptr, @document)
|
|
260
|
+
ensure_alive!
|
|
261
|
+
Leptris::XML::Document.parse(to_xml).root
|
|
258
262
|
end
|
|
259
263
|
alias_method :clone, :dup
|
|
260
264
|
|
data/lib/leptris/xml/node.rb
CHANGED
|
@@ -369,13 +369,16 @@ class Leptris::XML::Node
|
|
|
369
369
|
result
|
|
370
370
|
end
|
|
371
371
|
|
|
372
|
+
# Deep copy in a NEW document. Rounds through serialization
|
|
373
|
+
# rather than leptris_element_copy: the C copy silently drops
|
|
374
|
+
# COMMENT and PI children (leptris/leptris#696, leptris-ruby#115)
|
|
375
|
+
# — the serializer preserves every child kind, prefixed names,
|
|
376
|
+
# and namespace declarations, and re-parsing rebuilds them all.
|
|
372
377
|
def dup
|
|
373
378
|
ensure_alive!
|
|
374
379
|
elem_ptr = Leptris::XML::FFI.leptris_node_as_element(@c_ptr)
|
|
375
380
|
raise Leptris::XML::Error, "dup is only supported for element nodes" if elem_ptr.null?
|
|
376
|
-
|
|
377
|
-
raise Leptris::XML::Error, "leptris_element_copy failed" if copy_ptr.null?
|
|
378
|
-
Leptris::XML::Node.wrap(copy_ptr, @document)
|
|
381
|
+
Leptris::XML::Document.parse(to_xml).root
|
|
379
382
|
end
|
|
380
383
|
alias_method :clone, :dup
|
|
381
384
|
|
|
@@ -97,19 +97,15 @@ module Leptris::XML::Serialization
|
|
|
97
97
|
|
|
98
98
|
# Element-face indent unit (leptris-ruby#109 residual 2): no
|
|
99
99
|
# element-level ext-serialize entry exists yet, so the unit path
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
#
|
|
100
|
+
# rounds the subtree through serialization into a fresh document
|
|
101
|
+
# (leptris_element_copy drops COMMENT/PI children —
|
|
102
|
+
# leptris/leptris#696, leptris-ruby#115) and serializes that
|
|
103
|
+
# document without a declaration — identical output to the
|
|
104
|
+
# element serializer for the standard layout, with the unit and
|
|
105
|
+
# every child kind intact.
|
|
104
106
|
def self.to_xml_element_unit(element, unit, indent: 0)
|
|
105
|
-
document = Leptris::XML::Document.
|
|
107
|
+
document = Leptris::XML::Document.parse(element.to_xml)
|
|
106
108
|
begin
|
|
107
|
-
copy_ptr = Leptris::XML::FFI.leptris_element_copy(
|
|
108
|
-
element.c_ptr, document.c_ptr)
|
|
109
|
-
if copy_ptr.null?
|
|
110
|
-
raise Leptris::XML::Error, "leptris_element_copy failed"
|
|
111
|
-
end
|
|
112
|
-
document.root = Leptris::XML::Node.wrap(copy_ptr, document)
|
|
113
109
|
to_xml_indent_unit(document.c_ptr, unit,
|
|
114
110
|
indent: indent, no_decl: true)
|
|
115
111
|
ensure
|