Repository navigation
0.1.2
Mostly tooling. No behavioral changes; same 275 tests pass.
Added
-
RBS type signatures. Six files under
sig/mirrorlib/, covering every public entry point onCSS, the AST node classes (CSS::Nodes::*,CSS::Selectors::*,CSS::MediaQueries::*), and theCascade. Distributed in the gem, so type checkers like Steep pick them up automatically when p_css is a dependency. CI runsbundle exec rbs -I sig validateon every push.Symbol unions match the implementation:
combinator = :descendant | :child | :next_sibling | :subsequent_siblingattribute_matcher = :exact | :includes | :dash | :prefix | :suffix | :substringcomparison_op = :eq | :lt | :le | :gt | :ge
Element types in the matcher are kept as
untyped— Nokogiri elements work without any wrapping.
Internals
- Simplify pass on the 0.1.1 cascade work: dropped a dead constant (
Cascade::EMPTY_INDEXES) and an unused method (Selectors::Matcher#class_list); replaced ad-hoc[:id, name]anchor tuples with aCascade::AnchorKeyData class; collapsed the three sequentialcompound.components.eachscans inanchor_keyinto a single pass; switchedSelectors::Matcher::ContextfromStruct.new(keyword_init:)toData.definefor codebase consistency; replaced theSet + to_a + sort!candidate-collection withArray#concat + sort! + uniq!(buckets are already sorted at compile time).
Compatibility
Same as 0.1.0 / 0.1.1 — Ruby 3.4+, no mandatory runtime dependencies.