safe_memoize 0.6.1 → 0.6.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
- data/CHANGELOG.md +10 -1
- data/README.md +4 -4
- data/lib/safe_memoize/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2de4904a414a2af75e49e3e2b86016c96cb293b31b2e42cc2494c3bc4183a0a9
|
|
4
|
+
data.tar.gz: 8a9cd0b7d63453a60098f119c11239220ef41fa88fdd12c8dbeaed132a0754ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d30bce8de6b1324d7a0e453f489e08c7ed90df83a7c0de1dd08c4decbceaf658d75d037c47c9fe3abb04df32e12ce1ce130a52a961c17eaeae37c6cd8402e19
|
|
7
|
+
data.tar.gz: 97530abba5c99442016afdfcb0413fc88149c5bd31dae253acbedf6bca05ddafae9ba2ee0809d72967348ad272ff20c38556c6f978d04f1dfc212aaa2f269c01
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.6.2] - 2026-05-18
|
|
4
|
+
|
|
5
|
+
- Achieve 100% line coverage across all lib files
|
|
6
|
+
- Add SimpleCov filter to exclude `/spec` from coverage reporting
|
|
7
|
+
- Add tests for `memo_ttl` in `CacheRecordMethods` covering nil, valid numeric, negative, and non-numeric inputs
|
|
8
|
+
- Add tests for private `memo_cache_read` in `CacheStoreMethods` covering nil cache, live hit, and expired entry
|
|
9
|
+
- Add tests for `memo_keys` / `memo_values` with custom-key entries, covering the `custom_key:` projection branch in `InspectionMethods`
|
|
10
|
+
- Add missing error-case tests for `ReleaseTooling.update_version_file` (no VERSION constant) and `finalize_changelog` (no Unreleased heading)
|
|
11
|
+
|
|
3
12
|
## [0.6.1] - 2026-05-17
|
|
4
13
|
|
|
5
14
|
- Fix `memo_keys` and `memo_values` showing `args: custom_key, kwargs: nil` for methods using `memoize_with_custom_key` — now surfaces as `custom_key:`
|
|
@@ -18,7 +27,7 @@
|
|
|
18
27
|
|
|
19
28
|
## [0.5.0] - 2026-05-17
|
|
20
29
|
|
|
21
|
-
- Drop support for Ruby 3.2 (EOL); minimum required version is now Ruby 3.3
|
|
30
|
+
- Drop support for Ruby 3.2 (EOL); minimum required version is now Ruby 3.3
|
|
22
31
|
|
|
23
32
|
## [0.4.0] - 2026-05-17
|
|
24
33
|
|
data/README.md
CHANGED
|
@@ -18,6 +18,10 @@ end
|
|
|
18
18
|
|
|
19
19
|
SafeMemoize uses `Hash#key?` to distinguish "not yet cached" from "cached nil/false", so your methods are only computed once regardless of return value.
|
|
20
20
|
|
|
21
|
+
## How It Works
|
|
22
|
+
|
|
23
|
+
SafeMemoize uses Ruby's `prepend` mechanism. When you call `memoize :method_name`, it creates an anonymous module with a wrapper method and prepends it onto your class. The wrapper calls `super` to invoke the original method and stores the result in a per-instance hash. Thread safety is achieved with a per-instance `Mutex` using double-check locking.
|
|
24
|
+
|
|
21
25
|
## Features
|
|
22
26
|
|
|
23
27
|
- [Correctly memoizes `nil` and `false` return values](#nil-and-false-safety)
|
|
@@ -519,10 +523,6 @@ obj.cache_metrics_reset # Clears all collected metrics
|
|
|
519
523
|
|
|
520
524
|
Metrics are per-instance and reset independently from the cache itself — clearing metrics does not evict cached values.
|
|
521
525
|
|
|
522
|
-
## How It Works
|
|
523
|
-
|
|
524
|
-
SafeMemoize uses Ruby's `prepend` mechanism. When you call `memoize :method_name`, it creates an anonymous module with a wrapper method and prepends it onto your class. The wrapper calls `super` to invoke the original method and stores the result in a per-instance hash. Thread safety is achieved with a per-instance `Mutex` using double-check locking.
|
|
525
|
-
|
|
526
526
|
## Development
|
|
527
527
|
|
|
528
528
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt.
|
data/lib/safe_memoize/version.rb
CHANGED