leptris 1.9.7-aarch64-linux → 1.9.8-aarch64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e675b83fc86c61c5711b97dfb7f7a487c68a950fae14e530bd5310d5cb4a188
4
- data.tar.gz: d2dc2339a090408af8989534296bd76367b058a757ed53ec7f8625ea52b027ef
3
+ metadata.gz: 5fbe855476d5983224c48fee05aac7c39b5b68ad97ac4471960121435ba12ee0
4
+ data.tar.gz: 4839996a52ccefdc5786bb11da99fea5a43823b669385fe76bcedc0fad0238bf
5
5
  SHA512:
6
- metadata.gz: ac187f6f91c2b7884fd8c405212f675b8eb53d5c052edcf0656cffc4a9df3726da3ae9d64cb6907a00f1e7eb5e22a1e5ce61f54f12da460fe5af2668282cf615
7
- data.tar.gz: 3e24d0394e4ef11675c2ee257a1386a7c24f2310c44e2ae59bb53bf49e7ea1b52f6698006e2ce5aae8e1fd5e5e689c4cb1a05e0d4dffce628a96c7c852382260
6
+ metadata.gz: 4c7bace3fda21144a9d3b24fffb7b19704110f57e55ce540cbec9e6b751957c6bc5a0737f25d83a546e284d7f7ae3a59f4c086301ec74edea51844464e2e1bc6
7
+ data.tar.gz: 761e779a227d720e062d95661dfb0043c6992b73caf2aebc5c11fa393ccb433027615ee940b3f5622324d507c30d8e45d8646aaee611bc3eb96aba88b727bd15
data/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ 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.8] - 2026-08-26
9
+
10
+ ### Added
11
+
12
+ - **`rake audit:symbols`**: the lockstep drift detector as an
13
+ executable step — `nm -gU` on the vendored library vs the ffi.rb
14
+ attach list, failing with both directions of drift (ADR 0001's
15
+ enforcement arm; previously prose plus ad-hoc pipelines).
16
+
17
+ ### Changed
18
+
19
+ - ffi.rb attaches the five header-declared exports past cleanups
20
+ had dropped (element_children, serialize_document,
21
+ xpath_ns_set_add, xpath_result_get, xpath_result_get_nodes) —
22
+ mirror-only, supersession noted inline. The audit now runs green:
23
+ **224/224 symbols in lockstep**. Pull-attribute batch fetch asked
24
+ upstream (leptris/leptris#562).
25
+
8
26
  ## [1.9.7] - 2026-08-26
9
27
 
10
28
  ### Added
data/CLAUDE.md CHANGED
@@ -91,6 +91,7 @@ lib/leptris/xml/css_to_xpath.rb — minimal CSS translation
91
91
  check both before proposing refactors; they exist so reviews
92
92
  stop re-deriving settled questions.
93
93
  - libleptris public headers (`src/include/leptris/*.h`) are the
94
- contract; when symbols change, bump lockstep and audit
95
- attached-vs-exported (`nm -gU` on a fresh build).
94
+ contract; when symbols change, bump lockstep and run
95
+ `rake audit:symbols` (attached == exported on the vendored
96
+ library; fails listing both directions of drift).
96
97
  - Upstream issues worth tracking live at leptris/leptris.
data/README.adoc CHANGED
@@ -169,12 +169,13 @@ against a readonly document is legal; mutating the frozen one is not.
169
169
 
170
170
  == Searching: XPath and CSS
171
171
 
172
- `Document` and `Element` (via `Leptris::XML::Searchable`) support:
172
+ `Document`, `Element`, and `DocumentFragment` (via
173
+ `Leptris::XML::Searchable`) support:
173
174
 
174
175
  [horizontal]
175
176
  `#xpath(*exprs)` :: evaluate XPath; returns `NodeSet`, `true`/`false`, `Float`, or `String` depending on the expression.
176
177
  `#at_xpath(*exprs)` :: first match (or scalar), like `xpath(*exprs).first`.
177
- `#css(*selectors)` :: minimal CSS-to-XPath translation, then `xpath`.
178
+ `#css(*selectors)` :: minimal CSS-to-XPath translation, then `xpath`. Receiver-relative (Nokogiri semantics): scoped to the element or fragment, document-wide from a Document.
178
179
  `#at_css(*selectors)` :: first match of `css`.
179
180
  `#search(*exprs)` :: dispatches on syntax — `/`-prefixed or `,`-separated → `xpath`, otherwise `css`.
180
181
  `#at(*exprs)` :: first match of `search`.
@@ -190,6 +191,11 @@ doc.at_xpath("string(//book[1]/@id)") # => "b1"
190
191
  doc.css("book[lang='en'] title") # => NodeSet[<title>Refactoring</title>]
191
192
  doc.at_css("book#b1 title") # => <title>Refactoring</title> (id selector)
192
193
  doc.css("book:first-child") # first <book>
194
+
195
+ # css is receiver-relative: scoped to the receiver, not the document
196
+ doc.root.at_css("book").css("title") # titles under THAT book only
197
+ frag = doc.fragment("<a x='1'><n/></a>")
198
+ frag.css("a > n") # searches the fragment
193
199
  ----
194
200
 
195
201
  XPath result type follows XPath 1.0 semantics:
data/Rakefile CHANGED
@@ -49,6 +49,41 @@ task spec: :compile unless ENV.key?("LEPTRIS_LIB_PATH")
49
49
 
50
50
  task default: :spec
51
51
 
52
+ # Lockstep drift detector (ADR 0001): ffi.rb mirrors the public
53
+ # header, so attached == exported must hold on the vendored library.
54
+ # Run after `rake compile` and before any lockstep release.
55
+ namespace :audit do
56
+ desc "Fail when ffi.rb attachments and library exports drift"
57
+ task :symbols do
58
+ lib = Dir.glob("lib/libleptris.{dylib,so,dll}").first
59
+ unless lib && system("which nm > /dev/null 2>&1")
60
+ abort "audit:symbols: vendored library or nm not found — run rake compile"
61
+ end
62
+ exported = `nm -gU #{lib}`
63
+ .lines.map { |l| l.split[2] }.compact
64
+ .map { |n| n.sub(/\A_/, "") }
65
+ .select { |n| n.start_with?("leptris_") }
66
+ .map { |n| n.sub(/\Aleptris_/, "") }.sort
67
+ attached = File.read("lib/leptris/xml/ffi.rb")
68
+ .scan(/attach_function :leptris_([a-z_0-9]+)/).flatten.sort
69
+ unattached = exported - attached
70
+ unexported = attached - exported
71
+ unless unattached.empty?
72
+ puts "exported but NOT attached (upstream surface drift):"
73
+ unattached.each { |s| puts " leptris_#{s}" }
74
+ end
75
+ unless unexported.empty?
76
+ puts "attached but NOT exported (stale attachment):"
77
+ unexported.each { |s| puts " leptris_#{s}" }
78
+ end
79
+ if unattached.empty? && unexported.empty?
80
+ puts "audit:symbols: #{attached.length}/#{exported.length} symbols in lockstep"
81
+ else
82
+ abort "audit:symbols: drift detected"
83
+ end
84
+ end
85
+ end
86
+
52
87
  require "rubygems/package_task"
53
88
 
54
89
  desc "Build the pure-Ruby gem"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.7"
4
+ VERSION = "1.9.8"
5
5
  end
@@ -173,6 +173,10 @@ module Leptris
173
173
  # count-only query returning the TOTAL across every child kind.
174
174
  attach_function :leptris_node_children,
175
175
  [:leptris_node_ref, :pointer, :size_t], :size_t
176
+ # Element-only batch; mirror-only — fetch_children rides the
177
+ # all-kind node_children above.
178
+ attach_function :leptris_element_children,
179
+ [:leptris_element, :pointer, :size_t], :size_t
176
180
  attach_function :leptris_node_as_element,
177
181
  [:leptris_node_ref], :leptris_element
178
182
  attach_function :leptris_element_as_node,
@@ -402,6 +406,12 @@ module Leptris
402
406
  # which (element / synthetic attribute / text / other).
403
407
  attach_function :leptris_xpath_result_node_kind,
404
408
  [:leptris_xpath_result, :size_t], :int
409
+ # Pre-_ex variants, superseded by xpath_result_get_nodes_ex /
410
+ # xpath_result_get_node; mirror-only (ADR 0001).
411
+ attach_function :leptris_xpath_result_get,
412
+ [:leptris_xpath_result, :size_t], :leptris_element
413
+ attach_function :leptris_xpath_result_get_nodes,
414
+ [:leptris_xpath_result, :pointer, :size_t], :size_t
405
415
  attach_function :leptris_xpath_result_get_node,
406
416
  [:leptris_xpath_result, :size_t], :leptris_node_ref
407
417
  attach_function :leptris_xpath_result_node_name,
@@ -447,6 +457,10 @@ module Leptris
447
457
  [:leptris_xpath_ns_set], :void
448
458
  # One-call constructor: flat array of 2*pair_count alternating
449
459
  # prefix/URI strings.
460
+ # Per-pair add; superseded by ns_set_new_from_pairs (one call);
461
+ # mirror-only (ADR 0001).
462
+ attach_function :leptris_xpath_ns_set_add,
463
+ [:leptris_xpath_ns_set, :string, :string], :leptris_status
450
464
  attach_function :leptris_xpath_ns_set_new_from_pairs,
451
465
  [:pointer, :size_t], :leptris_xpath_ns_set
452
466
  attach_function :leptris_xpath_eval_ns,
@@ -507,6 +521,10 @@ module Leptris
507
521
 
508
522
  attach_function :leptris_document_serialize,
509
523
  [:leptris_document, :pointer], :pointer
524
+ # Deprecated automatic-options alias (header: prefer
525
+ # leptris_document_serialize); mirror-only.
526
+ attach_function :leptris_serialize_document,
527
+ [:leptris_document], :pointer
510
528
  # libleptris >= 1.9.0: caller-buffer serialization with options
511
529
  # (leptris#541). buf=NULL is a size query; the size-query +
512
530
  # fill pair reuses one serialization through a per-document
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.7
4
+ version: 1.9.8
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-25 00:00:00.000000000 Z
11
+ date: 2026-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi