leptris 1.9.390.1 → 1.9.390.2
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 +10 -0
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/element.rb +54 -0
- data/lib/leptris/xml/ffi.rb +12 -0
- 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: ec92f0e6c7b71b0a72db8e812b67de6799e78b21d733c3de029dea60e433460c
|
|
4
|
+
data.tar.gz: 9d0c460ecb7b79e3be5ab56d619f030b0acd4c7b0bff68152029b5f39acec8af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ff194f06b122d588af50825b60d44b695fcf670a47e83ad84be5d0992b9eab9445e3a8a40c1df307e6d0a13f3a75836fd637cfc6d2ab79a33cf8f367592702e
|
|
7
|
+
data.tar.gz: 769c589b00fbb8b21e791dedba03761a1af8527e595115c7821f268b9b7f9588f86d5365d35cfd2caaba222226510fc93727bf93bb3c4d4b596b1a9f5ccc11f9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
### Added — 1.9.390.2 (namespace snapshot face)
|
|
4
|
+
|
|
5
|
+
- **Element#namespace_declarations_snapshot (leptris-ruby#565).**
|
|
6
|
+
The engine's bulk in-scope declaration snapshot (libleptris 1.9.388)
|
|
7
|
+
as {path:, prefix:, href:} rows — one engine call replaces the
|
|
8
|
+
per-node namespace_definitions union walk (lutaml-model#1018's
|
|
9
|
+
largest ours-side site). Soft-attached + respond_to?-probed per the
|
|
10
|
+
soft-attach law; parity-pinned against the per-node walk in specs.
|
|
11
|
+
|
|
12
|
+
|
|
3
13
|
### Added — 1.9.390.1 (prebuilt-matrix ride)
|
|
4
14
|
|
|
5
15
|
- **Ruby 4.0 native bundles ship in the platform gems (#563, #554).**
|
data/lib/leptris/version.rb
CHANGED
data/lib/leptris/xml/element.rb
CHANGED
|
@@ -1007,6 +1007,60 @@ class Leptris::XML::Element < Leptris::XML::Node
|
|
|
1007
1007
|
result
|
|
1008
1008
|
end
|
|
1009
1009
|
|
|
1010
|
+
# libleptris 1.9.388 (leptris#1874): the bulk in-scope namespace
|
|
1011
|
+
# declaration snapshot — every (element, declaration) row under
|
|
1012
|
+
# this element in document order, one engine call. Rows are
|
|
1013
|
+
# {path:, prefix:, href:} with path an ancestor-first name array
|
|
1014
|
+
# (empty for self) — the exact shape lutaml-model#1054's
|
|
1015
|
+
# plan-hydrator contract consumes. Defined only when the native
|
|
1016
|
+
# face attached (the soft attach above); consumers probe with
|
|
1017
|
+
# respond_to?.
|
|
1018
|
+
if Leptris::XML::FFI.respond_to?(
|
|
1019
|
+
:leptris_element_namespace_declarations_snapshot,
|
|
1020
|
+
)
|
|
1021
|
+
def namespace_declarations_snapshot
|
|
1022
|
+
ensure_alive!
|
|
1023
|
+
fn = Leptris::XML::FFI
|
|
1024
|
+
out_count = ::FFI::MemoryPointer.new(:size_t)
|
|
1025
|
+
out_blob = ::FFI::MemoryPointer.new(:size_t)
|
|
1026
|
+
rc = fn.leptris_element_namespace_declarations_snapshot(
|
|
1027
|
+
c_ptr, nil, 0, out_count, nil, 0, out_blob,
|
|
1028
|
+
)
|
|
1029
|
+
return [] unless rc.zero?
|
|
1030
|
+
|
|
1031
|
+
rows_cap = out_count.read(:size_t)
|
|
1032
|
+
blob_cap = out_blob.read(:size_t)
|
|
1033
|
+
return [] if rows_cap.zero?
|
|
1034
|
+
|
|
1035
|
+
stride = 7 * ::FFI.type_size(:uint32)
|
|
1036
|
+
rows = ::FFI::MemoryPointer.new(stride * rows_cap)
|
|
1037
|
+
blob = ::FFI::MemoryPointer.new(blob_cap)
|
|
1038
|
+
rc = fn.leptris_element_namespace_declarations_snapshot(
|
|
1039
|
+
c_ptr, rows, rows_cap, out_count, blob, blob_cap, out_blob,
|
|
1040
|
+
)
|
|
1041
|
+
return [] if rc != 0
|
|
1042
|
+
|
|
1043
|
+
u32s = rows.read_array_of_uint32(7 * rows_cap)
|
|
1044
|
+
(0...rows_cap).map do |i|
|
|
1045
|
+
depth, _name_count, names_off, prefix_off, prefix_len,
|
|
1046
|
+
href_off, href_len = u32s.slice(i * 7, 7)
|
|
1047
|
+
path = depth.times.map do |k|
|
|
1048
|
+
name_ptr = blob + names_off
|
|
1049
|
+
s = name_ptr.get_string(0)
|
|
1050
|
+
names_off += s.bytesize + 1
|
|
1051
|
+
s
|
|
1052
|
+
end
|
|
1053
|
+
prefix = if prefix_off == 0xFFFF_FFFF
|
|
1054
|
+
nil
|
|
1055
|
+
else
|
|
1056
|
+
(blob + prefix_off).get_string(0, prefix_len)
|
|
1057
|
+
end
|
|
1058
|
+
href = (blob + href_off).get_string(0, href_len)
|
|
1059
|
+
{ path: path, prefix: prefix, href: href }
|
|
1060
|
+
end
|
|
1061
|
+
end
|
|
1062
|
+
end
|
|
1063
|
+
|
|
1010
1064
|
def namespaces
|
|
1011
1065
|
return @namespaces if memo_hit?(@namespaces_version)
|
|
1012
1066
|
scopes = {}
|
data/lib/leptris/xml/ffi.rb
CHANGED
|
@@ -453,6 +453,18 @@ module Leptris
|
|
|
453
453
|
nil
|
|
454
454
|
end
|
|
455
455
|
|
|
456
|
+
# libleptris 1.9.388 (leptris#1874/#1884): the bulk in-scope
|
|
457
|
+
# namespace-declaration snapshot — one call replaces the
|
|
458
|
+
# per-node namespace_definitions union walk (lutaml-model#1018).
|
|
459
|
+
# SOFT attach — engines before 1.9.388 lack the symbol.
|
|
460
|
+
begin
|
|
461
|
+
attach_function :leptris_element_namespace_declarations_snapshot,
|
|
462
|
+
[:leptris_element, :pointer, :size_t, :pointer,
|
|
463
|
+
:pointer, :size_t, :pointer], :size_t
|
|
464
|
+
rescue ::FFI::NotFoundError
|
|
465
|
+
nil
|
|
466
|
+
end
|
|
467
|
+
|
|
456
468
|
# libleptris 1.9.312 (#1551): serialize a walk result back
|
|
457
469
|
# to XML guided by its plan — the plan supplies element
|
|
458
470
|
# wrappers (row wire_name + ns_prefix), the result the
|