memo_pad 0.2.0 → 0.3.0

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: 9c11f68aeb52a2137f6151c79c374fe1416b4c6c01882b0cfffc74bf66a4cbc0
4
- data.tar.gz: 4bce812c02f59353b89f64a6e09f21659f24dc10a63c78407a7063fdc30e59ae
3
+ metadata.gz: 97c689cb2334577cebb1cc240157fe251ed5c5679da2c7568dccb7afd0034ca3
4
+ data.tar.gz: 917b40d49c689d4709d013363aa8fa23e7f0b50e37d3b3f4d5cab2f5a7309c8d
5
5
  SHA512:
6
- metadata.gz: 10eb9d8596163ac3edf59a74ed1851df52c97d0bcc8b35943364d1c9bd0eda6087011ea37217cc3e029a6b60ac5e4d45e8847ae26bc9aa83742d89a5b1634dd2
7
- data.tar.gz: 8320f2f73c565c637923657bf27dd660c785705ae53918bef50bd562e605ad150d04c5dda362131e2c6bed2b23f34c1b44116f7b2241c58fe4a19de1b7f97922
6
+ metadata.gz: 4cf0fdf8831d0166f340962bcebf2c4fd7ce7543903e0de0236fa8a96a46f40853ee00538638bbfac5f68cd34d289e0b937e02c11df6e97e047fd82b599657b7
7
+ data.tar.gz: 4f36f0b1bf2f7941378e7a032cb5c8fb1eef0e706e8d03ce14f48a2284171e2b81be9c5647c51e3164854e6a9e49dd4d96acbf37955bfb3fdfef9da0ffbe38a8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.0] - 2024-02-16
4
+
5
+ - Add `#clear` method to flush all cached entries on the instance.
6
+
3
7
  ## [0.2.0] - 2024-02-14
4
8
 
5
9
  - **BREAKING**: Changes `MemoPad::Memo#call` to `MemoPad::Memo#fetch` to more closely match interfaces like `ActiveSupport::Cache`.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- memo_pad (0.2.0)
4
+ memo_pad (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -70,6 +70,12 @@ def precache_things(things)
70
70
  end
71
71
  ```
72
72
 
73
+ You can also flush the whole of the cache on an instance.
74
+
75
+ ```ruby
76
+ foo.memo_pad.clear
77
+ ```
78
+
73
79
  ## Development
74
80
 
75
81
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/memo_pad/memo.rb CHANGED
@@ -17,6 +17,10 @@ module MemoPad
17
17
  write(method_name, *args, value: block.call)
18
18
  end
19
19
 
20
+ def clear
21
+ cache.clear
22
+ end
23
+
20
24
  def read(method_name, *args)
21
25
  cache[method_name].fetch(args, nil)
22
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MemoPad
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memo_pad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Byrne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2024-02-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: