memery 1.7.0 → 1.8.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 +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +72 -62
- data/lib/memery/version.rb +1 -1
- data/lib/memery.rb +15 -2
- data/memery.gemspec +1 -1
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47e227e027370bf461105392a87a9b241419c634c3cb2f179698a3d7791b85d8
|
4
|
+
data.tar.gz: 9600d9e22380f28b46ca445d235f8bd7e0d788ab26ac6daf9836b3f5de2d8908
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bcb999f11bf7bcdc1c6f670725b1800314ab73fca49e42dd27b4764998a211576a5ca0326f1e0b0576e563152dc515d8d91ff7e76d193af14867ecd9af2584e
|
7
|
+
data.tar.gz: 3921a52eaa2709ec13872c0c3eb12e0b3d38d9511605a52f34b3bce78de318b1ac2015c56d08c157f2f5b3d157d0802ab52605bb1ccdba9e1ab399b9d64bfd87
|
data/.github/workflows/ci.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,121 +1,131 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
memery (1.
|
4
|
+
memery (1.8.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
activesupport (
|
9
|
+
activesupport (8.0.2.1)
|
10
10
|
base64
|
11
11
|
benchmark (>= 0.3)
|
12
12
|
bigdecimal
|
13
|
-
concurrent-ruby (~> 1.0, >= 1.
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
14
14
|
connection_pool (>= 2.2.5)
|
15
15
|
drb
|
16
16
|
i18n (>= 1.6, < 2)
|
17
17
|
logger (>= 1.4.2)
|
18
18
|
minitest (>= 5.1)
|
19
|
-
mutex_m
|
20
19
|
securerandom (>= 0.3)
|
21
|
-
tzinfo (~> 2.0)
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
21
|
+
uri (>= 0.13.1)
|
22
|
+
ast (2.4.3)
|
23
|
+
base64 (0.3.0)
|
24
|
+
benchmark (0.4.1)
|
25
25
|
benchmark-ips (2.14.0)
|
26
26
|
benchmark-memory (0.2.0)
|
27
27
|
memory_profiler (~> 1)
|
28
|
-
bigdecimal (3.
|
28
|
+
bigdecimal (3.2.3)
|
29
29
|
coderay (1.1.3)
|
30
|
-
concurrent-ruby (1.3.
|
31
|
-
connection_pool (2.4
|
32
|
-
diff-lcs (1.
|
30
|
+
concurrent-ruby (1.3.5)
|
31
|
+
connection_pool (2.5.4)
|
32
|
+
diff-lcs (1.6.2)
|
33
33
|
docile (1.4.1)
|
34
|
-
drb (2.2.
|
35
|
-
i18n (1.14.
|
34
|
+
drb (2.2.3)
|
35
|
+
i18n (1.14.7)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
|
-
json (2.
|
38
|
-
language_server-protocol (3.17.0.
|
39
|
-
|
40
|
-
|
37
|
+
json (2.13.2)
|
38
|
+
language_server-protocol (3.17.0.5)
|
39
|
+
lint_roller (1.1.0)
|
40
|
+
logger (1.7.0)
|
41
|
+
memory_profiler (1.1.0)
|
41
42
|
method_source (1.1.0)
|
42
|
-
minitest (5.25.
|
43
|
-
|
44
|
-
|
45
|
-
parser (3.3.6.0)
|
43
|
+
minitest (5.25.5)
|
44
|
+
parallel (1.27.0)
|
45
|
+
parser (3.3.9.0)
|
46
46
|
ast (~> 2.4.1)
|
47
47
|
racc
|
48
|
+
prism (1.4.0)
|
48
49
|
pry (0.15.2)
|
49
50
|
coderay (~> 1.1)
|
50
51
|
method_source (~> 1.0)
|
51
52
|
racc (1.8.1)
|
52
|
-
rack (3.1
|
53
|
+
rack (3.2.1)
|
53
54
|
rainbow (3.1.1)
|
54
|
-
rake (13.
|
55
|
-
regexp_parser (2.
|
56
|
-
rspec (3.13.
|
55
|
+
rake (13.3.0)
|
56
|
+
regexp_parser (2.11.2)
|
57
|
+
rspec (3.13.1)
|
57
58
|
rspec-core (~> 3.13.0)
|
58
59
|
rspec-expectations (~> 3.13.0)
|
59
60
|
rspec-mocks (~> 3.13.0)
|
60
|
-
rspec-core (3.13.
|
61
|
+
rspec-core (3.13.5)
|
61
62
|
rspec-support (~> 3.13.0)
|
62
|
-
rspec-expectations (3.13.
|
63
|
+
rspec-expectations (3.13.5)
|
63
64
|
diff-lcs (>= 1.2.0, < 2.0)
|
64
65
|
rspec-support (~> 3.13.0)
|
65
|
-
rspec-mocks (3.13.
|
66
|
+
rspec-mocks (3.13.5)
|
66
67
|
diff-lcs (>= 1.2.0, < 2.0)
|
67
68
|
rspec-support (~> 3.13.0)
|
68
|
-
rspec-support (3.13.
|
69
|
-
rubocop (1.
|
69
|
+
rspec-support (3.13.5)
|
70
|
+
rubocop (1.75.8)
|
70
71
|
json (~> 2.3)
|
71
|
-
language_server-protocol (
|
72
|
+
language_server-protocol (~> 3.17.0.2)
|
73
|
+
lint_roller (~> 1.1.0)
|
72
74
|
parallel (~> 1.10)
|
73
75
|
parser (>= 3.3.0.2)
|
74
76
|
rainbow (>= 2.2.2, < 4.0)
|
75
77
|
regexp_parser (>= 2.9.3, < 3.0)
|
76
|
-
rubocop-ast (>= 1.
|
78
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
77
79
|
ruby-progressbar (~> 1.7)
|
78
80
|
unicode-display_width (>= 2.4.0, < 4.0)
|
79
|
-
rubocop-ast (1.
|
80
|
-
parser (>= 3.3.
|
81
|
-
|
82
|
-
|
83
|
-
rubocop
|
84
|
-
rubocop-
|
85
|
-
rubocop-
|
86
|
-
rubocop-
|
87
|
-
rubocop-
|
88
|
-
rubocop-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
rubocop (
|
93
|
-
|
94
|
-
|
81
|
+
rubocop-ast (1.46.0)
|
82
|
+
parser (>= 3.3.7.2)
|
83
|
+
prism (~> 1.4)
|
84
|
+
rubocop-config-umbrellio (1.75.0.104)
|
85
|
+
rubocop (~> 1.75.0)
|
86
|
+
rubocop-factory_bot (~> 2.27.0)
|
87
|
+
rubocop-performance (~> 1.25.0)
|
88
|
+
rubocop-rails (~> 2.32.0)
|
89
|
+
rubocop-rake (~> 0.7.0)
|
90
|
+
rubocop-rspec (~> 3.6.0)
|
91
|
+
rubocop-sequel (~> 0.4.0)
|
92
|
+
rubocop-factory_bot (2.27.1)
|
93
|
+
lint_roller (~> 1.1)
|
94
|
+
rubocop (~> 1.72, >= 1.72.1)
|
95
|
+
rubocop-performance (1.25.0)
|
96
|
+
lint_roller (~> 1.1)
|
97
|
+
rubocop (>= 1.75.0, < 2.0)
|
98
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
99
|
+
rubocop-rails (2.32.0)
|
95
100
|
activesupport (>= 4.2.0)
|
101
|
+
lint_roller (~> 1.1)
|
96
102
|
rack (>= 1.1)
|
97
|
-
rubocop (>= 1.
|
98
|
-
rubocop-ast (>= 1.
|
99
|
-
rubocop-rake (0.
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
rubocop (~> 1.
|
103
|
+
rubocop (>= 1.75.0, < 2.0)
|
104
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
105
|
+
rubocop-rake (0.7.1)
|
106
|
+
lint_roller (~> 1.1)
|
107
|
+
rubocop (>= 1.72.1)
|
108
|
+
rubocop-rspec (3.6.0)
|
109
|
+
lint_roller (~> 1.1)
|
110
|
+
rubocop (~> 1.72, >= 1.72.1)
|
111
|
+
rubocop-sequel (0.4.1)
|
112
|
+
lint_roller (~> 1.1)
|
113
|
+
rubocop (>= 1.72.1, < 2)
|
105
114
|
ruby-progressbar (1.13.0)
|
106
|
-
securerandom (0.
|
115
|
+
securerandom (0.4.1)
|
107
116
|
simplecov (0.22.0)
|
108
117
|
docile (~> 1.1)
|
109
118
|
simplecov-html (~> 0.11)
|
110
119
|
simplecov_json_formatter (~> 0.1)
|
111
|
-
simplecov-html (0.13.
|
112
|
-
simplecov-lcov (0.
|
120
|
+
simplecov-html (0.13.2)
|
121
|
+
simplecov-lcov (0.9.0)
|
113
122
|
simplecov_json_formatter (0.1.4)
|
114
123
|
tzinfo (2.0.6)
|
115
124
|
concurrent-ruby (~> 1.0)
|
116
|
-
unicode-display_width (3.1.
|
125
|
+
unicode-display_width (3.1.5)
|
117
126
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
118
127
|
unicode-emoji (4.0.4)
|
128
|
+
uri (1.0.3)
|
119
129
|
|
120
130
|
PLATFORMS
|
121
131
|
ruby
|
@@ -134,4 +144,4 @@ DEPENDENCIES
|
|
134
144
|
simplecov-lcov
|
135
145
|
|
136
146
|
BUNDLED WITH
|
137
|
-
2.
|
147
|
+
2.7.1
|
data/lib/memery/version.rb
CHANGED
data/lib/memery.rb
CHANGED
@@ -38,6 +38,10 @@ module Memery
|
|
38
38
|
|
39
39
|
module ClassMethods
|
40
40
|
def memoize(*method_names, condition: nil, ttl: nil)
|
41
|
+
if method_names.empty?
|
42
|
+
@_memery_memoize_next_method = { condition: condition, ttl: ttl }
|
43
|
+
return
|
44
|
+
end
|
41
45
|
prepend_memery_module!
|
42
46
|
method_names.each do |method_name|
|
43
47
|
define_memoized_method!(method_name, condition: condition, ttl: ttl)
|
@@ -52,6 +56,15 @@ module Memery
|
|
52
56
|
@_memery_module.private_method_defined?(method_name)
|
53
57
|
end
|
54
58
|
|
59
|
+
def method_added(name)
|
60
|
+
super
|
61
|
+
|
62
|
+
return unless @_memery_memoize_next_method
|
63
|
+
|
64
|
+
memoize(name, **@_memery_memoize_next_method)
|
65
|
+
@_memery_memoize_next_method = nil
|
66
|
+
end
|
67
|
+
|
55
68
|
private
|
56
69
|
|
57
70
|
def prepend_memery_module!
|
@@ -60,8 +73,8 @@ module Memery
|
|
60
73
|
prepend(@_memery_module)
|
61
74
|
end
|
62
75
|
|
63
|
-
def define_memoized_method!(method_name, **
|
64
|
-
@_memery_module.define_memoized_method!(self, method_name, **
|
76
|
+
def define_memoized_method!(method_name, **)
|
77
|
+
@_memery_module.define_memoized_method!(self, method_name, **)
|
65
78
|
end
|
66
79
|
|
67
80
|
module MemoizationModule
|
data/memery.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Smirnov
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Memery is a gem for memoization.
|
14
13
|
email:
|
@@ -35,7 +34,6 @@ homepage: https://github.com/tycooon/memery
|
|
35
34
|
licenses:
|
36
35
|
- MIT
|
37
36
|
metadata: {}
|
38
|
-
post_install_message:
|
39
37
|
rdoc_options: []
|
40
38
|
require_paths:
|
41
39
|
- lib
|
@@ -43,15 +41,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
41
|
requirements:
|
44
42
|
- - ">="
|
45
43
|
- !ruby/object:Gem::Version
|
46
|
-
version: 3.
|
44
|
+
version: 3.2.0
|
47
45
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
46
|
requirements:
|
49
47
|
- - ">="
|
50
48
|
- !ruby/object:Gem::Version
|
51
49
|
version: '0'
|
52
50
|
requirements: []
|
53
|
-
rubygems_version: 3.
|
54
|
-
signing_key:
|
51
|
+
rubygems_version: 3.7.1
|
55
52
|
specification_version: 4
|
56
53
|
summary: A gem for memoization.
|
57
54
|
test_files: []
|