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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 036e876f53d96a1c6ca54ae257bb631c30b0b973a0f0bed77b6fafd92f187c93
4
- data.tar.gz: 2d09472476154ff424940a59666b5a891d95156d44a829025ad9929f92fed24d
3
+ metadata.gz: 2de4904a414a2af75e49e3e2b86016c96cb293b31b2e42cc2494c3bc4183a0a9
4
+ data.tar.gz: 8a9cd0b7d63453a60098f119c11239220ef41fa88fdd12c8dbeaed132a0754ba
5
5
  SHA512:
6
- metadata.gz: d0004ea27b6d21d3e32df92f782ddb0d4a768212d4344e3d4e4793d6eb44bb481b309a05a875bb166e1633f3be8c08e4580b006f512dd74723383e11516ff5c4
7
- data.tar.gz: 6a81f21e5e4347a723305893cfcf3dbe8b4b71bdb0ef3767774276e7046893e5ec12471898b6ecfc87df135b0462691324fa16808369a5ad98fc6e54d6ce1a14
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SafeMemoize
4
- VERSION = "0.6.1"
4
+ VERSION = "0.6.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe_memoize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuck Smith