Skip to content

Releases: kettle-rb/token-resolver

v1.0.2

22 Feb 12:02
v1.0.2

Choose a tag to compare

1.0.2 - 2026-02-22

  • TAG: v1.0.2
  • COVERAGE: 98.13% -- 263/268 lines in 10 files
  • BRANCH COVERAGE: 91.18% -- 62/68 branches in 10 files
  • 96.77% documented

Added

  • Benchmarking tools — Performance comparison suite comparing token-resolver against simpler
    alternatives (String#gsub and Kernel#sprintf):
    • benchmarks/comparison.rb — Comprehensive benchmark script measuring iterations per second
      across four realistic scenarios (simple replacement, moderate complexity, high complexity,
      and large documents with sparse tokens)
    • gemfiles/modular/benchmark/ips.gemfile — Development dependency for benchmark-ips gem
    • Rake tasks: rake bench:comparison (run comparison), rake bench:list (list benchmarks),
      rake bench:run (run all benchmarks), rake bench (alias)
    • BENCHMARK.md — Results and analysis showing token-resolver is 100-3000x slower due to
      PEG parsing, validation, and AST building; includes guidance on when to use each approach
      and real-world performance context

Official Discord 👉️ Live Chat on Discord

Many paths lead to being a sponsor or a backer of this project. Are you on such a path?

OpenCollective Backers OpenCollective Sponsors Sponsor Me on Github Liberapay Goal Progress Donate on PayPal

Buy me a coffee Donate on Polar Donate to my FLOSS efforts at ko-fi.com Donate to my FLOSS efforts using Patreon

v1.0.1

22 Feb 10:23
v1.0.1
3a6ee9a

Choose a tag to compare

1.0.1 - 2026-02-22

  • TAG: v1.0.1
  • COVERAGE: 98.13% -- 263/268 lines in 10 files
  • BRANCH COVERAGE: 91.18% -- 62/68 branches in 10 files
  • 96.77% documented

Added

  • Config#segment_pattern option — a parslet character class constraining which characters
    are valid inside token segments (default: "[A-Za-z0-9_]"). This prevents false positive
    token matches against Ruby block parameters ({ |x| expr }), shell variable expansion
    (${VAR:+val}), and other syntax that structurally resembles tokens but contains spaces
    or punctuation in the "segments".
  • Resolve#resolve now validates replacement keys against the config's segment_pattern and
    raises ArgumentError if a key contains characters that the grammar would never parse.

Fixed

  • False positive token matches — the grammar previously used any (match any character)
    for segment content, which allowed spaces, operators, and punctuation inside token segments.
    This caused Ruby block syntax like { |fp| File.exist?(fp) } and shell expansion like
    ${CLASSPATH:+:$CLASSPATH} to be incorrectly parsed as tokens. With multi-separator configs
    (["|", ":"]), the second | was reconstructed as : during on_missing: :keep
    roundtripping, silently corrupting source files. The grammar now uses
    match(segment_pattern) instead of any, limiting segments to word characters by default.

Official Discord 👉️ Live Chat on Discord

Many paths lead to being a sponsor or a backer of this project. Are you on such a path?

OpenCollective Backers OpenCollective Sponsors Sponsor Me on Github Liberapay Goal Progress Donate on PayPal

Buy me a coffee Donate on Polar Donate to my FLOSS efforts at ko-fi.com Donate to my FLOSS efforts using Patreon

v1.0.0

21 Feb 13:14
v1.0.0
71d2c81

Choose a tag to compare

1.0.0 - 2026-02-21

  • TAG: v1.0.0
  • COVERAGE: 97.67% -- 252/258 lines in 10 files
  • BRANCH COVERAGE: 89.39% -- 59/66 branches in 10 files
  • 96.72% documented

Added

  • Initial release

Security

Official Discord 👉️ Live Chat on Discord

Many paths lead to being a sponsor or a backer of this project. Are you on such a path?

OpenCollective Backers OpenCollective Sponsors Sponsor Me on Github Liberapay Goal Progress Donate on PayPal

Buy me a coffee Donate on Polar Donate to my FLOSS efforts at ko-fi.com Donate to my FLOSS efforts using Patreon