dememoize 0.1.4 → 0.2.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: 25f00061cd02dbf9a043462711f8cc45d067a5afa5a1f599615723c2a7ecca3c
4
- data.tar.gz: f039dff08d510278552ee3edf44a5a3fe9d93ec41b0ba35128454c31bedf2d8b
3
+ metadata.gz: 78551270d5ff9293a7b763e2d174b6a176aaffca388a8ef9efe6a3771b899ccc
4
+ data.tar.gz: 41988cda618a950934fec308b46b888623235979db9165f6f2591a68f5c7a348
5
5
  SHA512:
6
- metadata.gz: 1a09046705dec9b9d4365666c1034327554348e27ab0899cc0d12da8f67eed856523c870d1be308e6f815b40c6e1388f3e86f1494c7713ef1879986f967a5b33
7
- data.tar.gz: 8752776540ef556fcd389075d05e12c2e9c3e2324b3fc5164ca89ca8fa182c2672d3002c4a220f3a86e91da6fc33db15cd90e36cb3d4c85349f7c6255483839c
6
+ metadata.gz: e10ec99f52cee7e3189515d60d089123e2c6ca76f60e60c6593824f4210426ecd034892e9d83a3bcfc804c6c0291af299ecc458e1716ffa69c6712a70f78b746
7
+ data.tar.gz: '031780ef4f0a3a1bbe953ab0468c65310957f8f15f0be3ecfbdd4271655b62df79f27e1fcb8d386e2f13b83ed2f1b38c209e15758814778368da4f7b10a102c5'
data/README.md CHANGED
@@ -111,6 +111,12 @@ describe "without specifying a class it uses described_class" do
111
111
  end
112
112
  end
113
113
 
114
+ # You can also dememoize multiple variables at once:
115
+ describe "dememoizing multiple variables" do
116
+ include_context "with dememoized class variable", :@categories, :@brands
117
+ # ...
118
+ end
119
+
114
120
  # If you want to dememoize a class variable on a different class, you can pass the class as the
115
121
  # first argument to dememoized.
116
122
 
@@ -14,19 +14,19 @@ module RSpec
14
14
  end
15
15
  end
16
16
 
17
- RSpec.shared_context "with dememoized variable" do |name, object:|
17
+ RSpec.shared_context "with dememoized variable" do |*names, object:|
18
18
  around(:each) do |example|
19
- Dememoize.remove_instance_variable_if_defined(object, name)
19
+ names.each { |name| Dememoize.remove_instance_variable_if_defined(object, name) }
20
20
  example.run
21
- Dememoize.remove_instance_variable_if_defined(object, name)
21
+ names.each { |name| Dememoize.remove_instance_variable_if_defined(object, name) }
22
22
  end
23
23
  end
24
24
 
25
- RSpec.shared_context "with dememoized class variable" do |name, clazz: described_class|
25
+ RSpec.shared_context "with dememoized class variable" do |*names, clazz: described_class|
26
26
  around(:each) do |example|
27
- Dememoize.remove_instance_variable_if_defined(clazz, name)
27
+ names.each { |name| Dememoize.remove_instance_variable_if_defined(clazz, name) }
28
28
  example.run
29
- Dememoize.remove_instance_variable_if_defined(clazz, name)
29
+ names.each { |name| Dememoize.remove_instance_variable_if_defined(clazz, name) }
30
30
  end
31
31
  end
32
32
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dememoize
4
- VERSION = "0.1.4"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dememoize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Lascelles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-12 00:00:00.000000000 Z
11
+ date: 2026-02-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  A gem to clean up memoization. This is useful for testing, where you want to