leptris 1.9.20 → 1.9.21

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: 5b71e0f6fdc7eafc4b804bfc7006f7e15e11f8e1ebf2a403c440763bc1fe9cba
4
- data.tar.gz: 3d7d98ef8818d1789afa83fbb9e5eff6bab040ef4838900bccd8213cb8404570
3
+ metadata.gz: 01fef4edf0eca47c087e7c3e111952207c69c10ed75c367858f284f78b5c6753
4
+ data.tar.gz: 4b094de8b8b535e081fee40f7fd1117330ed0b28ad909043293c34071ae47335
5
5
  SHA512:
6
- metadata.gz: a11ceae79c465f05002dd31e9af7a29d1b86194c45398f940523c4718f4e1695382b573557199dac34e8cc4aae1c39aa9faf430d6def6b6333f86f3973938393
7
- data.tar.gz: d77c0a145409d9735b593e396b4e3a2d093cbc8011f5880510c2100fac2e2787cdff6977ba795e5b85ac2f1b6f837c17ff8b647a1e20dcdb3037cc3f08621c00
6
+ metadata.gz: 92c89619228205696fe95555b1e2cb55032237ff82066651140824219994ae0e9a60829a6de0262e7a21de39fcb1655177575de18c9191bb52e50f7a1b772a21
7
+ data.tar.gz: 12862b063ed8f1c903c53f17de0e1d30f84b059c042a9f3ca1c786901af4189362f311f67fe51a1df0905a4b7e5e30d7638061293a9c5d3cfc238bd1856ba888
data/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ 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.21] - 2026-08-27
9
+
10
+ ### Changed
11
+
12
+ - **`#at` / `#%` take the single-node seam**: the generic entry now
13
+ dispatches on syntax (like `#search`) and calls `at_xpath` /
14
+ `at_css` directly instead of routing through
15
+ `search().first` and its NodeSet container — the round-XIV fast
16
+ path's last un-routed caller. Measured: `at("item > name")` 0.026 s
17
+ -> 0.020 s per 2000 iterations (**-23%**, now at parity with
18
+ `at_css`); scalar semantics for XPath-shaped expressions keep the
19
+ full-wrapper behavior.
20
+
8
21
  ## [1.9.20] - 2026-08-27
9
22
 
10
23
  ### Changed
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.20"
4
+ VERSION = "1.9.21"
5
5
  end
@@ -50,9 +50,16 @@ module Leptris::XML::Searchable
50
50
  end
51
51
  alias_method :/, :search
52
52
 
53
+ # Single-node seam (round XIV): dispatch on syntax like #search,
54
+ # then call the at_* fast paths directly — no NodeSet container,
55
+ # no result handle, one fewer dispatch than search().first.
53
56
  def at(*args)
54
- result = search(*args)
55
- result.is_a?(Leptris::XML::NodeSet) ? result.first : result
57
+ paths = args.first.is_a?(Array) ? args.first : [args.first]
58
+ if paths.map(&:to_s).all? { |p| looks_like_xpath?(p) }
59
+ at_xpath(*paths)
60
+ else
61
+ at_css(*args)
62
+ end
56
63
  end
57
64
  alias_method :%, :at
58
65
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.20
4
+ version: 1.9.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.