memery 1.4.1 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/.rubocop.yml +1 -1
- data/Gemfile +11 -0
- data/Gemfile.lock +87 -66
- data/README.md +24 -21
- data/Rakefile +2 -1
- data/lib/memery/version.rb +1 -1
- data/lib/memery.rb +6 -6
- data/memery.gemspec +2 -15
- metadata +6 -161
- data/CHANGELOG.md +0 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fee1d8473d6873f228f16f5f9a0b3dce5f3e54350101b69be7d2842a2d4fc1f
|
4
|
+
data.tar.gz: 24eb3da54355028d92664c734a2c28ea5a52462351b6a598c6acd80a5b3cca7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe66f7ef175fae643de7382ad2b311a546c079f9f105118f2907437a439ccde57b86143b46d063f868805921d72a33eb790625610c43f111268eeb21b8b5821c
|
7
|
+
data.tar.gz: 28120e605bbf3627d09376f081ba1071745e0d8d0a32ccef9675012c12596baf695aaa37275bcce27bbf6998e4b22b92c0787e2b973decd87f15e201a6fa1294
|
data/.github/workflows/ci.yml
CHANGED
@@ -12,12 +12,12 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
fail-fast: false
|
14
14
|
matrix:
|
15
|
-
ruby: ["2.
|
15
|
+
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"]
|
16
16
|
|
17
17
|
name: ${{ matrix.ruby }}
|
18
18
|
|
19
19
|
steps:
|
20
|
-
- uses: actions/checkout@
|
20
|
+
- uses: actions/checkout@v4
|
21
21
|
|
22
22
|
- uses: ruby/setup-ruby@v1
|
23
23
|
with:
|
@@ -26,6 +26,6 @@ jobs:
|
|
26
26
|
|
27
27
|
- run: bundle exec rake
|
28
28
|
|
29
|
-
- uses: coverallsapp/github-action@
|
29
|
+
- uses: coverallsapp/github-action@v2
|
30
30
|
with:
|
31
31
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,100 +1,121 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
memery (1.
|
5
|
-
ruby2_keywords (~> 0.0.2)
|
4
|
+
memery (1.6.0)
|
6
5
|
|
7
6
|
GEM
|
8
7
|
remote: https://rubygems.org/
|
9
8
|
specs:
|
10
|
-
activesupport (
|
9
|
+
activesupport (7.1.4)
|
10
|
+
base64
|
11
|
+
bigdecimal
|
11
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
connection_pool (>= 2.2.5)
|
14
|
+
drb
|
12
15
|
i18n (>= 1.6, < 2)
|
13
16
|
minitest (>= 5.1)
|
17
|
+
mutex_m
|
14
18
|
tzinfo (~> 2.0)
|
15
|
-
zeitwerk (~> 2.3)
|
16
19
|
ast (2.4.2)
|
17
|
-
|
18
|
-
benchmark-
|
19
|
-
|
20
|
+
base64 (0.2.0)
|
21
|
+
benchmark-ips (2.14.0)
|
22
|
+
benchmark-memory (0.2.0)
|
23
|
+
memory_profiler (~> 1)
|
24
|
+
bigdecimal (3.1.8)
|
20
25
|
coderay (1.1.3)
|
21
|
-
concurrent-ruby (1.
|
22
|
-
|
23
|
-
|
24
|
-
|
26
|
+
concurrent-ruby (1.3.4)
|
27
|
+
connection_pool (2.4.1)
|
28
|
+
diff-lcs (1.5.1)
|
29
|
+
docile (1.4.1)
|
30
|
+
drb (2.2.1)
|
31
|
+
i18n (1.14.5)
|
25
32
|
concurrent-ruby (~> 1.0)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
33
|
+
json (2.7.2)
|
34
|
+
language_server-protocol (3.17.0.3)
|
35
|
+
memory_profiler (1.0.2)
|
36
|
+
method_source (1.1.0)
|
37
|
+
minitest (5.25.1)
|
38
|
+
mutex_m (0.2.0)
|
39
|
+
parallel (1.26.3)
|
40
|
+
parser (3.3.5.0)
|
31
41
|
ast (~> 2.4.1)
|
32
|
-
|
42
|
+
racc
|
43
|
+
pry (0.14.2)
|
33
44
|
coderay (~> 1.1)
|
34
45
|
method_source (~> 1.0)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
rspec-
|
43
|
-
rspec-
|
44
|
-
|
45
|
-
|
46
|
-
|
46
|
+
racc (1.8.1)
|
47
|
+
rack (3.1.7)
|
48
|
+
rainbow (3.1.1)
|
49
|
+
rake (13.2.1)
|
50
|
+
regexp_parser (2.9.2)
|
51
|
+
rexml (3.3.7)
|
52
|
+
rspec (3.13.0)
|
53
|
+
rspec-core (~> 3.13.0)
|
54
|
+
rspec-expectations (~> 3.13.0)
|
55
|
+
rspec-mocks (~> 3.13.0)
|
56
|
+
rspec-core (3.13.1)
|
57
|
+
rspec-support (~> 3.13.0)
|
58
|
+
rspec-expectations (3.13.3)
|
47
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-mocks (3.
|
60
|
+
rspec-support (~> 3.13.0)
|
61
|
+
rspec-mocks (3.13.1)
|
50
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-support (3.
|
53
|
-
rubocop (1.
|
63
|
+
rspec-support (~> 3.13.0)
|
64
|
+
rspec-support (3.13.1)
|
65
|
+
rubocop (1.63.5)
|
66
|
+
json (~> 2.3)
|
67
|
+
language_server-protocol (>= 3.17.0)
|
54
68
|
parallel (~> 1.10)
|
55
|
-
parser (>= 3.
|
69
|
+
parser (>= 3.3.0.2)
|
56
70
|
rainbow (>= 2.2.2, < 4.0)
|
57
71
|
regexp_parser (>= 1.8, < 3.0)
|
58
|
-
rexml
|
59
|
-
rubocop-ast (>= 1.
|
72
|
+
rexml (>= 3.2.5, < 4.0)
|
73
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
60
74
|
ruby-progressbar (~> 1.7)
|
61
|
-
unicode-display_width (>=
|
62
|
-
rubocop-ast (1.
|
63
|
-
parser (>= 3.
|
64
|
-
rubocop-
|
65
|
-
rubocop (
|
66
|
-
|
67
|
-
rubocop
|
68
|
-
rubocop-
|
69
|
-
rubocop-
|
70
|
-
rubocop-
|
71
|
-
|
72
|
-
rubocop (
|
73
|
-
|
74
|
-
|
75
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
76
|
+
rubocop-ast (1.32.3)
|
77
|
+
parser (>= 3.3.1.0)
|
78
|
+
rubocop-capybara (2.21.0)
|
79
|
+
rubocop (~> 1.41)
|
80
|
+
rubocop-config-umbrellio (1.63.0.93)
|
81
|
+
rubocop (~> 1.63.0)
|
82
|
+
rubocop-performance (~> 1.21.0)
|
83
|
+
rubocop-rails (~> 2.24.0)
|
84
|
+
rubocop-rake (~> 0.6.0)
|
85
|
+
rubocop-rspec (~> 2.29.0)
|
86
|
+
rubocop-sequel (~> 0.3.3)
|
87
|
+
rubocop-factory_bot (2.26.1)
|
88
|
+
rubocop (~> 1.61)
|
89
|
+
rubocop-performance (1.21.1)
|
90
|
+
rubocop (>= 1.48.1, < 2.0)
|
91
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
92
|
+
rubocop-rails (2.24.1)
|
75
93
|
activesupport (>= 4.2.0)
|
76
94
|
rack (>= 1.1)
|
77
|
-
rubocop (>=
|
78
|
-
|
79
|
-
|
80
|
-
rubocop-rspec (2.2.0)
|
95
|
+
rubocop (>= 1.33.0, < 2.0)
|
96
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
97
|
+
rubocop-rake (0.6.0)
|
81
98
|
rubocop (~> 1.0)
|
82
|
-
|
83
|
-
|
99
|
+
rubocop-rspec (2.29.2)
|
100
|
+
rubocop (~> 1.40)
|
101
|
+
rubocop-capybara (~> 2.17)
|
102
|
+
rubocop-factory_bot (~> 2.22)
|
103
|
+
rubocop-rspec_rails (~> 2.28)
|
104
|
+
rubocop-rspec_rails (2.29.1)
|
105
|
+
rubocop (~> 1.61)
|
106
|
+
rubocop-sequel (0.3.4)
|
84
107
|
rubocop (~> 1.0)
|
85
|
-
ruby-progressbar (1.
|
86
|
-
|
87
|
-
simplecov (0.21.2)
|
108
|
+
ruby-progressbar (1.13.0)
|
109
|
+
simplecov (0.22.0)
|
88
110
|
docile (~> 1.1)
|
89
111
|
simplecov-html (~> 0.11)
|
90
112
|
simplecov_json_formatter (~> 0.1)
|
91
|
-
simplecov-html (0.
|
113
|
+
simplecov-html (0.13.1)
|
92
114
|
simplecov-lcov (0.8.0)
|
93
|
-
simplecov_json_formatter (0.1.
|
94
|
-
tzinfo (2.0.
|
115
|
+
simplecov_json_formatter (0.1.4)
|
116
|
+
tzinfo (2.0.6)
|
95
117
|
concurrent-ruby (~> 1.0)
|
96
|
-
unicode-display_width (2.
|
97
|
-
zeitwerk (2.4.2)
|
118
|
+
unicode-display_width (2.5.0)
|
98
119
|
|
99
120
|
PLATFORMS
|
100
121
|
ruby
|
@@ -113,4 +134,4 @@ DEPENDENCIES
|
|
113
134
|
simplecov-lcov
|
114
135
|
|
115
136
|
BUNDLED WITH
|
116
|
-
2.
|
137
|
+
2.4.22
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Memery [![Gem Version](https://badge.fury.io/rb/memery.svg)](https://badge.fury.io/rb/memery)
|
1
|
+
# Memery [![Gem Version](https://badge.fury.io/rb/memery.svg)](https://badge.fury.io/rb/memery) ![Build Status](https://github.com/tycooon/memery/actions/workflows/ci.yml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/tycooon/memery/badge.svg?branch=master)](https://coveralls.io/github/tycooon/memery?branch=master)
|
2
2
|
|
3
|
-
Memery is a Ruby gem
|
3
|
+
Memery is a Ruby gem that simplifies memoization of method return values. In Ruby, memoization typically looks like this:
|
4
4
|
|
5
5
|
```ruby
|
6
6
|
def user
|
@@ -8,7 +8,7 @@ def user
|
|
8
8
|
end
|
9
9
|
```
|
10
10
|
|
11
|
-
However, this approach
|
11
|
+
However, this approach fails if the calculated result can be `nil` or `false`, or if the method uses arguments. Additionally, multi-line methods require extra `begin`/`end` blocks:
|
12
12
|
|
13
13
|
```ruby
|
14
14
|
def user
|
@@ -20,7 +20,7 @@ def user
|
|
20
20
|
end
|
21
21
|
```
|
22
22
|
|
23
|
-
|
23
|
+
To handle these situations, memoization gems like Memery exist. The example above can be rewritten using Memery as follows:
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
memoize def user
|
@@ -32,7 +32,7 @@ end
|
|
32
32
|
|
33
33
|
## Installation
|
34
34
|
|
35
|
-
|
35
|
+
Add `gem "memery"` to your Gemfile.
|
36
36
|
|
37
37
|
## Usage
|
38
38
|
|
@@ -45,7 +45,7 @@ class A
|
|
45
45
|
42
|
46
46
|
end
|
47
47
|
|
48
|
-
#
|
48
|
+
# Alternatively:
|
49
49
|
# def call
|
50
50
|
# ...
|
51
51
|
# end
|
@@ -56,13 +56,13 @@ a = A.new
|
|
56
56
|
a.call # => 42
|
57
57
|
a.call # => 42
|
58
58
|
a.call # => 42
|
59
|
-
#
|
59
|
+
# "calculating" will only be printed once.
|
60
60
|
|
61
61
|
a.call { 1 } # => 42
|
62
|
-
#
|
62
|
+
# "calculating" will be printed again because passing a block disables memoization.
|
63
63
|
```
|
64
64
|
|
65
|
-
|
65
|
+
Memoization works with methods that take arguments. The memoization is based on these arguments using an internal hash, so the following will work as expected:
|
66
66
|
|
67
67
|
```ruby
|
68
68
|
class A
|
@@ -78,7 +78,7 @@ a = A.new
|
|
78
78
|
a.call(1, 5) # => 6
|
79
79
|
a.call(2, 15) # => 17
|
80
80
|
a.call(1, 5) # => 6
|
81
|
-
#
|
81
|
+
# "calculating" will be printed twice, once for each unique argument list.
|
82
82
|
```
|
83
83
|
|
84
84
|
For class methods:
|
@@ -98,10 +98,10 @@ end
|
|
98
98
|
B.call # => 42
|
99
99
|
B.call # => 42
|
100
100
|
B.call # => 42
|
101
|
-
#
|
101
|
+
# "calculating" will only be printed once.
|
102
102
|
```
|
103
103
|
|
104
|
-
|
104
|
+
### Conditional Memoization
|
105
105
|
|
106
106
|
```ruby
|
107
107
|
class A
|
@@ -136,7 +136,7 @@ a.call # => 42
|
|
136
136
|
# with `true` result of condition block.
|
137
137
|
```
|
138
138
|
|
139
|
-
|
139
|
+
### Memoization with Time-to-Live (TTL)
|
140
140
|
|
141
141
|
```ruby
|
142
142
|
class A
|
@@ -168,7 +168,7 @@ a.call # => 42
|
|
168
168
|
a.call # => 42
|
169
169
|
```
|
170
170
|
|
171
|
-
|
171
|
+
### Checking if a Method is Memoized
|
172
172
|
|
173
173
|
```ruby
|
174
174
|
class A
|
@@ -190,8 +190,9 @@ a.memoized?(:call) # => true
|
|
190
190
|
a.memoized?(:execute) # => false
|
191
191
|
```
|
192
192
|
|
193
|
-
##
|
194
|
-
|
193
|
+
## Differences from Other Gems
|
194
|
+
|
195
|
+
Memery is similar to [Memoist](https://github.com/matthewrudy/memoist), but it doesn't override methods. Instead, it uses Ruby 2's `Module.prepend` feature. This approach is cleaner, allowing you to inspect the original method body with `method(:x).super_method.source`, and it ensures that subclasses' methods function properly. If you redefine a memoized method in a subclass, it won't be memoized by default. You can memoize it normally without needing an awkward `identifier: ` argument, and it will just work:
|
195
196
|
|
196
197
|
```ruby
|
197
198
|
class A
|
@@ -217,9 +218,9 @@ b.instance_variable_get(:@_memery_memoized_values)
|
|
217
218
|
# => {:x_70318201388120=>{[1]=>2, [2]=>4, [3]=>6}, :x_70318184636620=>{[2]=>2}}
|
218
219
|
```
|
219
220
|
|
220
|
-
Note how both
|
221
|
+
Note how both methods' return values are cached separately without interfering with each other.
|
221
222
|
|
222
|
-
|
223
|
+
Another key difference is that Memery doesn't change the method's signature (no extra `reload` parameter). If you need an unmemoized result, simply create an unmemoized version of the method:
|
223
224
|
|
224
225
|
```ruby
|
225
226
|
memoize def users
|
@@ -231,19 +232,21 @@ def get_users
|
|
231
232
|
end
|
232
233
|
```
|
233
234
|
|
234
|
-
Alternatively, you can clear the
|
235
|
+
Alternatively, you can clear the entire instance's cache:
|
235
236
|
|
236
237
|
```ruby
|
237
238
|
a.clear_memery_cache!
|
238
239
|
```
|
239
240
|
|
240
|
-
|
241
|
+
You can also provide a block, though this approach is somewhat hacky:
|
241
242
|
|
242
243
|
```ruby
|
243
244
|
a.users {}
|
244
245
|
```
|
245
246
|
|
246
|
-
|
247
|
+
## Object Shape Optimization
|
248
|
+
|
249
|
+
In Ruby 3.2, a new optimization called "object shape" was introduced, which can have negative interactions with dynamically added instance variables. Memery minimizes this impact by introducing only one new instance variable after initialization (`@_memery_memoized_values`). If you need to ensure a specific object shape, you can call `clear_memery_cache!` in your initializer to set the instance variable ahead of time.
|
247
250
|
|
248
251
|
## Contributing
|
249
252
|
|
data/Rakefile
CHANGED
data/lib/memery/version.rb
CHANGED
data/lib/memery.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "ruby2_keywords"
|
4
|
-
|
5
3
|
require "memery/version"
|
6
4
|
|
7
5
|
module Memery
|
@@ -35,10 +33,12 @@ module Memery
|
|
35
33
|
extend ModuleMethods
|
36
34
|
|
37
35
|
module ClassMethods
|
38
|
-
def memoize(
|
36
|
+
def memoize(*method_names, condition: nil, ttl: nil)
|
39
37
|
prepend_memery_module!
|
40
|
-
|
41
|
-
|
38
|
+
method_names.each do |method_name|
|
39
|
+
define_memoized_method!(method_name, condition: condition, ttl: ttl)
|
40
|
+
end
|
41
|
+
method_names.length > 1 ? method_names : method_names.first
|
42
42
|
end
|
43
43
|
|
44
44
|
def memoized?(method_name)
|
@@ -80,7 +80,7 @@ module Memery
|
|
80
80
|
end
|
81
81
|
|
82
82
|
cache_store = (@_memery_memoized_values ||= {})
|
83
|
-
cache_key = original_arity.zero? ? method_key : [method_key, *args]
|
83
|
+
cache_key = original_arity.zero? ? method_key : [method_key, *args].hash
|
84
84
|
cache = cache_store[cache_key]
|
85
85
|
|
86
86
|
return cache.result if cache&.fresh?(ttl)
|
data/memery.gemspec
CHANGED
@@ -5,12 +5,12 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require "memery/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.required_ruby_version = ">= 2.
|
8
|
+
spec.required_ruby_version = ">= 2.7.0"
|
9
9
|
|
10
10
|
spec.name = "memery"
|
11
11
|
spec.version = Memery::VERSION
|
12
12
|
spec.authors = ["Yuri Smirnov"]
|
13
|
-
spec.email = ["
|
13
|
+
spec.email = ["tycoooon@gmail.com"]
|
14
14
|
|
15
15
|
spec.summary = "A gem for memoization."
|
16
16
|
spec.description = "Memery is a gem for memoization."
|
@@ -21,17 +21,4 @@ Gem::Specification.new do |spec|
|
|
21
21
|
f.match(%r{^(test|spec|features)/})
|
22
22
|
end
|
23
23
|
spec.require_paths = ["lib"]
|
24
|
-
|
25
|
-
spec.add_runtime_dependency "ruby2_keywords", "~> 0.0.2"
|
26
|
-
|
27
|
-
spec.add_development_dependency "activesupport"
|
28
|
-
spec.add_development_dependency "benchmark-ips"
|
29
|
-
spec.add_development_dependency "benchmark-memory"
|
30
|
-
spec.add_development_dependency "bundler"
|
31
|
-
spec.add_development_dependency "pry"
|
32
|
-
spec.add_development_dependency "rake"
|
33
|
-
spec.add_development_dependency "rspec"
|
34
|
-
spec.add_development_dependency "rubocop-config-umbrellio"
|
35
|
-
spec.add_development_dependency "simplecov"
|
36
|
-
spec.add_development_dependency "simplecov-lcov"
|
37
24
|
end
|
metadata
CHANGED
@@ -1,172 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Smirnov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: ruby2_keywords
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.2
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.2
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activesupport
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: benchmark-ips
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: benchmark-memory
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: bundler
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: pry
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rake
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rspec
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop-config-umbrellio
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: simplecov
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: simplecov-lcov
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
11
|
+
date: 2024-09-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
167
13
|
description: Memery is a gem for memoization.
|
168
14
|
email:
|
169
|
-
-
|
15
|
+
- tycoooon@gmail.com
|
170
16
|
executables: []
|
171
17
|
extensions: []
|
172
18
|
extra_rdoc_files: []
|
@@ -176,7 +22,6 @@ files:
|
|
176
22
|
- ".gitignore"
|
177
23
|
- ".rspec"
|
178
24
|
- ".rubocop.yml"
|
179
|
-
- CHANGELOG.md
|
180
25
|
- Gemfile
|
181
26
|
- Gemfile.lock
|
182
27
|
- LICENSE.txt
|
@@ -198,14 +43,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
198
43
|
requirements:
|
199
44
|
- - ">="
|
200
45
|
- !ruby/object:Gem::Version
|
201
|
-
version: 2.
|
46
|
+
version: 2.7.0
|
202
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
203
48
|
requirements:
|
204
49
|
- - ">="
|
205
50
|
- !ruby/object:Gem::Version
|
206
51
|
version: '0'
|
207
52
|
requirements: []
|
208
|
-
rubygems_version: 3.
|
53
|
+
rubygems_version: 3.1.6
|
209
54
|
signing_key:
|
210
55
|
specification_version: 4
|
211
56
|
summary: A gem for memoization.
|
data/CHANGELOG.md
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
## [Unreleased]
|
2
|
-
|
3
|
-
## [1.4.0] - 2021-03-15
|
4
|
-
### Fixed
|
5
|
-
- Fix compatibility with `ActiveSupport::Concern`. ([@tycooon] and [@AlexWayfer]) [#26]
|
6
|
-
|
7
|
-
## [1.3.0] - 2020-02-10
|
8
|
-
### Added
|
9
|
-
- Allow memoization after including module with Memery. ([@AlexWayfer]) [#23]
|
10
|
-
|
11
|
-
### Changed
|
12
|
-
- Make `memoize` return the method name to allow chaining. ([@JelF]) [#22]
|
13
|
-
|
14
|
-
### Fixed
|
15
|
-
- Fix warnings in Ruby 2.7. ([@AlexWayfer]) [#19], [#25]
|
16
|
-
|
17
|
-
## [1.2.0] - 2019-10-19
|
18
|
-
### Added
|
19
|
-
- Add `:ttl` option for `memoize` method ([@AlexWayfer]) [#11]
|
20
|
-
- Add benchmark script ([@AlexWayfer]) [#14]
|
21
|
-
- Add `.memoized?` method ([@AlexWayfer]) [#17]
|
22
|
-
|
23
|
-
## [1.1.0] - 2019-08-05
|
24
|
-
### Fixed
|
25
|
-
- Optimize speed and memory for cached values returns. ([@AlexWayfer]) [#10]
|
26
|
-
|
27
|
-
## [1.0.0] - 2018-08-31
|
28
|
-
### Added
|
29
|
-
- Add `:condition` option for `.memoize` method. ([@AlexWayfer]) [#7]
|
30
|
-
|
31
|
-
## [0.6.0] - 2018-04-20
|
32
|
-
### Added
|
33
|
-
- Readme example for memoizing class methods. ([@AlexWayfer]) [#3]
|
34
|
-
- Memery raises `ArgumentError` if method is not defined when you call `memoize`.
|
35
|
-
|
36
|
-
## [0.5.0] - 2017-06-12
|
37
|
-
- Initial public version.
|
38
|
-
|
39
|
-
[0.5.0]: https://github.com/tycooon/memery/tree/v0.5.0
|
40
|
-
[0.6.0]: https://github.com/tycooon/memery/compare/v0.5.0...v0.6.0
|
41
|
-
[1.0.0]: https://github.com/tycooon/memery/compare/v0.6.0...v1.0.0
|
42
|
-
[1.1.0]: https://github.com/tycooon/memery/compare/v1.0.0...v1.1.0
|
43
|
-
[1.2.0]: https://github.com/tycooon/memery/compare/v1.1.0...v1.2.0
|
44
|
-
[1.3.0]: https://github.com/tycooon/memery/compare/v1.2.0...v1.3.0
|
45
|
-
[1.4.0]: https://github.com/tycooon/memery/compare/v1.3.0...v1.4.0
|
46
|
-
[Unreleased]: https://github.com/tycooon/memery/compare/v1.4.0...HEAD
|
47
|
-
|
48
|
-
[@tycooon]: https://github.com/tycooon
|
49
|
-
[@AlexWayfer]: https://github.com/AlexWayfer
|
50
|
-
[@JelF]: https://github.com/JelF
|
51
|
-
|
52
|
-
[#3]: https://github.com/tycooon/memery/pull/3
|
53
|
-
[#7]: https://github.com/tycooon/memery/pull/7
|
54
|
-
[#10]: https://github.com/tycooon/memery/pull/10
|
55
|
-
[#11]: https://github.com/tycooon/memery/pull/11
|
56
|
-
[#14]: https://github.com/tycooon/memery/pull/14
|
57
|
-
[#17]: https://github.com/tycooon/memery/pull/17
|
58
|
-
[#19]: https://github.com/tycooon/memery/pull/19
|
59
|
-
[#22]: https://github.com/tycooon/memery/pull/22
|
60
|
-
[#23]: https://github.com/tycooon/memery/pull/23
|
61
|
-
[#25]: https://github.com/tycooon/memery/pull/25
|
62
|
-
[#26]: https://github.com/tycooon/memery/pull/26
|