Skip to content

v2.5.0

Latest

Choose a tag to compare

@MarioRuiz MarioRuiz released this 23 Sep 14:12

Added

  • Added StringPattern.with to apply configuration for the duration of a block, and StringPattern.reset! to restore defaults and clear caches.
  • Added StringPattern::VERSION.
  • Added full-string Regexp validation via StringPattern.validate, StringPattern.valid?, and Regexp#validate / #val.
  • Added StringPattern.explain with the failing segment index for pattern arrays.
  • Added StringPattern.iban / valid_iban? (ISO 13616) and StringPattern.luhn / valid_luhn?.
  • Added block_list_regexp to opt into the previous regular-expression block list.
  • StringPattern.sample forwards seed: and other generate options.

Changed

  • Generation uses its own Random instance. seed: no longer calls srand, so it does not change Kernel#rand. Sequences for a given seed may differ from 2.4.0.
  • block_list matches literals (case-insensitive) unless block_list_regexp is true.
  • Spanish word generation loads all data/spanish/palabras*.json files instead of one random file.
  • Invalid patterns and impossible generation honor raise_on_error on every failure path.
  • Required Ruby version is 3.0 or newer.