+28
−23
Loading
Address @reprazent's review on !283: - Hash-key naming follows the metrics-catalog selector pattern: canonical short forms are :eq and :re; :equality accepted as an alias of :eq. The previous :regex key is removed and now raises a clear ArgumentError pointing at :re. - Internal Matcher#type symbols renamed to match the canonical hash keys (:equality -> :eq, :regex -> :re). External callers were unaffected: every match value still goes through Matcher.build, and the Evaluator only calls Matcher#match?. - Compile path for :re trusts Regexp.new for type validation instead of pre-checking source.is_a?(String). This unlocks the nested {path: {re: /api\/.*/}} convenience Bob raised. - Rescue widened to catch TypeError alongside RegexpError so that e.g. {re: 42} surfaces an ArgumentError at Rule.new instead of leaking TypeError. Length cap (200 chars) only applies when the source is a String -- a precompiled Regexp source has no analogous user-typed bound. Specs updated to assert the new shapes (eq/equality/re forms, bare Regexp inside {re: ...}, TypeError-wrapping path, removed-key error) and to confirm the cross-format Ruby<->YAML parity scenario still holds with the new key names. Co-Authored-By:Claude Opus 4.7 (1M context) <noreply@anthropic.com>