token-resolver 1.0.1 → 1.0.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +24 -1
- data/README.md +28 -1
- data/lib/token/resolver/version.rb +1 -1
- data.tar.gz.sig +1 -5
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b23a9edef4ee26b3306a11c3829662efdfd3d813f325125fea41a12ab52a4d8
|
|
4
|
+
data.tar.gz: 69f56a454fb92a428d07c19357f7f30f6c343c9538ad7931797bb0c40263d61c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2eb601757412886989daabc322e8128c24c0afc8cbad62195a6d987fe11e6ff6c9b0946831d2b570b589991f0070ecbca60a47787343b9b1c973b07c23f4baec
|
|
7
|
+
data.tar.gz: 62b7ec4552e63c67d80ca72e67931b87091a71311adb4e6c3fcc560fc6efff888606970fe24bacbcf201ab5b58c73f58fba497cfa25963060348df8b01271770
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,27 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [1.0.2] - 2026-02-22
|
|
34
|
+
|
|
35
|
+
- TAG: [v1.0.2][1.0.2t]
|
|
36
|
+
- COVERAGE: 98.13% -- 263/268 lines in 10 files
|
|
37
|
+
- BRANCH COVERAGE: 91.18% -- 62/68 branches in 10 files
|
|
38
|
+
- 96.77% documented
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- **Benchmarking tools** — Performance comparison suite comparing `token-resolver` against simpler
|
|
43
|
+
alternatives (`String#gsub` and `Kernel#sprintf`):
|
|
44
|
+
- `benchmarks/comparison.rb` — Comprehensive benchmark script measuring iterations per second
|
|
45
|
+
across four realistic scenarios (simple replacement, moderate complexity, high complexity,
|
|
46
|
+
and large documents with sparse tokens)
|
|
47
|
+
- `gemfiles/modular/benchmark/ips.gemfile` — Development dependency for `benchmark-ips` gem
|
|
48
|
+
- Rake tasks: `rake bench:comparison` (run comparison), `rake bench:list` (list benchmarks),
|
|
49
|
+
`rake bench:run` (run all benchmarks), `rake bench` (alias)
|
|
50
|
+
- `BENCHMARK.md` — Results and analysis showing token-resolver is 100-3000x slower due to
|
|
51
|
+
PEG parsing, validation, and AST building; includes guidance on when to use each approach
|
|
52
|
+
and real-world performance context
|
|
53
|
+
|
|
33
54
|
## [1.0.1] - 2026-02-22
|
|
34
55
|
|
|
35
56
|
- TAG: [v1.0.1][1.0.1t]
|
|
@@ -70,7 +91,9 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
70
91
|
|
|
71
92
|
### Security
|
|
72
93
|
|
|
73
|
-
[Unreleased]: https://github.com/kettle-rb/token-resolver/compare/v1.0.
|
|
94
|
+
[Unreleased]: https://github.com/kettle-rb/token-resolver/compare/v1.0.2...HEAD
|
|
95
|
+
[1.0.2]: https://github.com/kettle-rb/token-resolver/compare/v1.0.1...v1.0.2
|
|
96
|
+
[1.0.2t]: https://github.com/kettle-rb/token-resolver/releases/tag/v1.0.2
|
|
74
97
|
[1.0.1]: https://github.com/kettle-rb/token-resolver/compare/v1.0.0...v1.0.1
|
|
75
98
|
[1.0.1t]: https://github.com/kettle-rb/token-resolver/releases/tag/v1.0.1
|
|
76
99
|
[1.0.0]: https://github.com/kettle-rb/ast-merge/compare/e0e299cad6e6914d512845c71df6b7ac8009e5ac...v1.0.0
|
data/README.md
CHANGED
|
@@ -286,6 +286,34 @@ infinite loops and ensures predictable behavior when replacement values contain
|
|
|
286
286
|
If the input doesn't contain the `pre` delimiter at all, the parser fast-paths and returns
|
|
287
287
|
a single Text node without invoking parslet.
|
|
288
288
|
|
|
289
|
+
#### 📊 Benchmarks
|
|
290
|
+
|
|
291
|
+
Token-resolver prioritizes **flexibility, configurability, and maintainability** over raw speed.
|
|
292
|
+
|
|
293
|
+
**⚠️ Important**: Token-resolver is **100-3000x slower** than simple alternatives like `String#gsub` and `Kernel#sprintf`.
|
|
294
|
+
because it does significantly more work:
|
|
295
|
+
- Full PEG parsing of the input string
|
|
296
|
+
- Token validation and structure enforcement
|
|
297
|
+
- Building an AST for introspection
|
|
298
|
+
- Flexible error handling for missing tokens
|
|
299
|
+
|
|
300
|
+
This performance difference is **expected and acceptable** because these are fundamentally different
|
|
301
|
+
approaches solving different problems.
|
|
302
|
+
|
|
303
|
+
See [BENCHMARK.md](BENCHMARK.md) for detailed performance comparisons and guidance on:
|
|
304
|
+
|
|
305
|
+
- **When to use token-resolver**: Configurable token structures, validation, introspection, flexible error handling
|
|
306
|
+
- **When to use String#gsub**: Fixed token patterns, maximum performance, simple one-shot replacements
|
|
307
|
+
- **When to use Kernel#sprintf**: Positional formatting, fixed templates, printf-style output
|
|
308
|
+
|
|
309
|
+
The choice should be based on your actual requirements, not just raw performance metrics.
|
|
310
|
+
|
|
311
|
+
To run benchmarks on your system:
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
bundle exec rake bench:comparison
|
|
315
|
+
```
|
|
316
|
+
|
|
289
317
|
### False Positive Prevention
|
|
290
318
|
|
|
291
319
|
The grammar constrains segment content to the configured `segment_pattern` (default: word
|
|
@@ -294,7 +322,6 @@ block parameters (`{ |x| expr }`) or shell variable expansion (`${VAR:+val}`)
|
|
|
294
322
|
mistakenly parsed as a token. Replacement keys that contain characters outside the
|
|
295
323
|
`segment_pattern` are rejected with an `ArgumentError` at resolve time.
|
|
296
324
|
|
|
297
|
-
|
|
298
325
|
## 🦷 FLOSS Funding
|
|
299
326
|
|
|
300
327
|
While kettle-rb tools are free software and will always be, the project would benefit immensely from some funding.
|
data.tar.gz.sig
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
�}l���1�%��p=>U
|
|
3
|
-
�#F��h<cg0G��,* A�4)8��h�h`]��X�ۛ��M�<���-M�!���Z�txKFl�CJ�ˇ�d^ � �6�;+�ԝ�Q3�m�{���X
|
|
4
|
-
���ѫ1ى�p����[z{v�r&2�� N�,���9�k��Q攛�Տݰr졽�^��"uQI ���+r����F��Vm��Uxw&`� ��Rނ��������[]Z��x����j���b
|
|
1
|
+
V���'''��' ���k�0����K-��#$7��G���*���{@P7��R��!�IVd�^ ��X^Km��,u��j�D8��,B{B�T�p����t0�� �M�ơ�|@��Ss_u�m��f�+L�Vyj���s���k>��$��D�p�b�N_"���.�u�4�Z�.N|;n���X�Z/Fʾ�2��e�Jv;(�b!H��hLP�w��TTwe2F
|
|
5
|
-
��p��W�F�Ԣ?�#�����~��ޙ�#b�>��ɀ�?��sՈ��/����������Қ��{QJj�gZI���*�v��?��?|mH3��O�$4�1��d�;�t�Z����|1(eSi�ۀ�����}�kaWdƞ�
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: token-resolver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -274,10 +274,10 @@ licenses:
|
|
|
274
274
|
- MIT
|
|
275
275
|
metadata:
|
|
276
276
|
homepage_uri: https://token-resolver.galtzo.com/
|
|
277
|
-
source_code_uri: https://github.com/kettle-rb/token-resolver/tree/v1.0.
|
|
278
|
-
changelog_uri: https://github.com/kettle-rb/token-resolver/blob/v1.0.
|
|
277
|
+
source_code_uri: https://github.com/kettle-rb/token-resolver/tree/v1.0.2
|
|
278
|
+
changelog_uri: https://github.com/kettle-rb/token-resolver/blob/v1.0.2/CHANGELOG.md
|
|
279
279
|
bug_tracker_uri: https://github.com/kettle-rb/token-resolver/issues
|
|
280
|
-
documentation_uri: https://www.rubydoc.info/gems/token-resolver/1.0.
|
|
280
|
+
documentation_uri: https://www.rubydoc.info/gems/token-resolver/1.0.2
|
|
281
281
|
funding_uri: https://github.com/sponsors/pboling
|
|
282
282
|
wiki_uri: https://github.com/kettle-rb/token-resolver/wiki
|
|
283
283
|
news_uri: https://www.railsbling.com/tags/token-resolver
|
metadata.gz.sig
CHANGED
|
Binary file
|