memery 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +95 -63
- data/lib/memery.rb +19 -8
- data/lib/memery/version.rb +1 -1
- data/memery.gemspec +3 -0
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9deb1312add2edf331f0e4b5ff2b196c95f7de899d6ae15ee01e9d4e43fca950
|
4
|
+
data.tar.gz: f228b03ab8ed0a286075a13f045a53337780c75d4eb9b015b285dfc3c48c3913
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8da63cbd319881210877b295f5791132ae80848758954e4ea0615baaf82bcee5fa06c5b93b4dd9a524af7efabad749a65caf428680673e7f68dea625fc806bf7
|
7
|
+
data.tar.gz: 57806aadb6b7bd61520d068e1c3244836dc6c89c4ce550f8881adfee7eea139b6a07e5dddc4d5de072917693dd34596b49db5114716c9f0dc792023879d69c38
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [1.4.0] - 2021-03-15
|
4
|
+
### Fixed
|
5
|
+
- Fix compatibility with `ActiveSupport::Concern`. ([@tycooon] and [@AlexWayfer]) [#26]
|
6
|
+
|
3
7
|
## [1.3.0] - 2020-02-10
|
4
8
|
### Added
|
5
9
|
- Allow memoization after including module with Memery. ([@AlexWayfer]) [#23]
|
@@ -54,3 +58,4 @@
|
|
54
58
|
[#22]: https://github.com/tycooon/memery/pull/22
|
55
59
|
[#23]: https://github.com/tycooon/memery/pull/23
|
56
60
|
[#25]: https://github.com/tycooon/memery/pull/25
|
61
|
+
[#26]: https://github.com/tycooon/memery/pull/26
|
data/Gemfile.lock
CHANGED
@@ -1,89 +1,121 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
memery (1.
|
4
|
+
memery (1.4.0)
|
5
5
|
ruby2_keywords (~> 0.0.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
10
|
+
activesupport (6.1.3)
|
11
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
|
+
ast (2.4.2)
|
17
|
+
benchmark-ips (2.8.4)
|
12
18
|
benchmark-memory (0.1.2)
|
13
19
|
memory_profiler (~> 0.9)
|
14
|
-
coderay (1.1.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
coderay (1.1.3)
|
21
|
+
concurrent-ruby (1.1.8)
|
22
|
+
coveralls (0.7.2)
|
23
|
+
multi_json (~> 1.3)
|
24
|
+
rest-client (= 1.6.7)
|
25
|
+
simplecov (>= 0.7)
|
26
|
+
term-ansicolor (= 1.2.2)
|
27
|
+
thor (= 0.18.1)
|
28
|
+
diff-lcs (1.4.4)
|
29
|
+
docile (1.3.5)
|
30
|
+
i18n (1.8.9)
|
31
|
+
concurrent-ruby (~> 1.0)
|
25
32
|
memory_profiler (0.9.14)
|
26
|
-
method_source (0.
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
33
|
+
method_source (1.0.0)
|
34
|
+
mime-types (3.3.1)
|
35
|
+
mime-types-data (~> 3.2015)
|
36
|
+
mime-types-data (3.2021.0225)
|
37
|
+
minitest (5.14.4)
|
38
|
+
multi_json (1.15.0)
|
39
|
+
parallel (1.20.1)
|
40
|
+
parser (3.0.0.0)
|
41
|
+
ast (~> 2.4.1)
|
42
|
+
pry (0.14.0)
|
43
|
+
coderay (~> 1.1)
|
44
|
+
method_source (~> 1.0)
|
45
|
+
rack (2.2.3)
|
34
46
|
rainbow (3.0.0)
|
35
|
-
rake (13.0.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
rspec
|
41
|
-
rspec-
|
42
|
-
|
47
|
+
rake (13.0.3)
|
48
|
+
regexp_parser (2.1.1)
|
49
|
+
rest-client (1.6.7)
|
50
|
+
mime-types (>= 1.16)
|
51
|
+
rexml (3.2.4)
|
52
|
+
rspec (3.10.0)
|
53
|
+
rspec-core (~> 3.10.0)
|
54
|
+
rspec-expectations (~> 3.10.0)
|
55
|
+
rspec-mocks (~> 3.10.0)
|
56
|
+
rspec-core (3.10.1)
|
57
|
+
rspec-support (~> 3.10.0)
|
58
|
+
rspec-expectations (3.10.1)
|
43
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
-
rspec-support (~> 3.
|
45
|
-
rspec-mocks (3.
|
60
|
+
rspec-support (~> 3.10.0)
|
61
|
+
rspec-mocks (3.10.2)
|
46
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
-
rspec-support (~> 3.
|
48
|
-
rspec-support (3.
|
49
|
-
rubocop (
|
50
|
-
jaro_winkler (~> 1.5.1)
|
63
|
+
rspec-support (~> 3.10.0)
|
64
|
+
rspec-support (3.10.2)
|
65
|
+
rubocop (1.11.0)
|
51
66
|
parallel (~> 1.10)
|
52
|
-
parser (>=
|
67
|
+
parser (>= 3.0.0.0)
|
53
68
|
rainbow (>= 2.2.2, < 4.0)
|
69
|
+
regexp_parser (>= 1.8, < 3.0)
|
70
|
+
rexml
|
71
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
54
72
|
ruby-progressbar (~> 1.7)
|
55
|
-
unicode-display_width (>= 1.4.0, <
|
56
|
-
rubocop-
|
57
|
-
|
58
|
-
|
59
|
-
rubocop
|
60
|
-
rubocop-
|
61
|
-
|
62
|
-
rubocop (
|
63
|
-
|
73
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
74
|
+
rubocop-ast (1.4.1)
|
75
|
+
parser (>= 2.7.1.5)
|
76
|
+
rubocop-config-umbrellio (1.11.0.40)
|
77
|
+
rubocop (= 1.11.0)
|
78
|
+
rubocop-performance (= 1.10.0)
|
79
|
+
rubocop-rails (= 2.9.1)
|
80
|
+
rubocop-rake (= 0.5.1)
|
81
|
+
rubocop-rspec (= 2.2.0)
|
82
|
+
rubocop-sequel (= 0.2.0)
|
83
|
+
rubocop-performance (1.10.0)
|
84
|
+
rubocop (>= 0.90.0, < 2.0)
|
85
|
+
rubocop-ast (>= 0.4.0)
|
86
|
+
rubocop-rails (2.9.1)
|
87
|
+
activesupport (>= 4.2.0)
|
64
88
|
rack (>= 1.1)
|
65
|
-
rubocop (>= 0.
|
66
|
-
rubocop-
|
67
|
-
rubocop
|
68
|
-
|
69
|
-
|
70
|
-
|
89
|
+
rubocop (>= 0.90.0, < 2.0)
|
90
|
+
rubocop-rake (0.5.1)
|
91
|
+
rubocop
|
92
|
+
rubocop-rspec (2.2.0)
|
93
|
+
rubocop (~> 1.0)
|
94
|
+
rubocop-ast (>= 1.1.0)
|
95
|
+
rubocop-sequel (0.2.0)
|
96
|
+
rubocop (~> 1.0)
|
97
|
+
ruby-progressbar (1.11.0)
|
98
|
+
ruby2_keywords (0.0.4)
|
99
|
+
simplecov (0.21.2)
|
71
100
|
docile (~> 1.1)
|
72
|
-
|
73
|
-
|
74
|
-
simplecov-html (0.
|
75
|
-
|
76
|
-
term-ansicolor (1.
|
77
|
-
tins (~>
|
78
|
-
thor (
|
79
|
-
tins (
|
80
|
-
|
81
|
-
|
101
|
+
simplecov-html (~> 0.11)
|
102
|
+
simplecov_json_formatter (~> 0.1)
|
103
|
+
simplecov-html (0.12.3)
|
104
|
+
simplecov_json_formatter (0.1.2)
|
105
|
+
term-ansicolor (1.2.2)
|
106
|
+
tins (~> 0.8)
|
107
|
+
thor (0.18.1)
|
108
|
+
tins (0.13.2)
|
109
|
+
tzinfo (2.0.4)
|
110
|
+
concurrent-ruby (~> 1.0)
|
111
|
+
unicode-display_width (2.0.0)
|
112
|
+
zeitwerk (2.4.2)
|
82
113
|
|
83
114
|
PLATFORMS
|
84
115
|
ruby
|
85
116
|
|
86
117
|
DEPENDENCIES
|
118
|
+
activesupport
|
87
119
|
benchmark-ips
|
88
120
|
benchmark-memory
|
89
121
|
bundler
|
@@ -96,4 +128,4 @@ DEPENDENCIES
|
|
96
128
|
simplecov
|
97
129
|
|
98
130
|
BUNDLED WITH
|
99
|
-
2.
|
131
|
+
2.2.11
|
data/lib/memery.rb
CHANGED
@@ -11,11 +11,24 @@ module Memery
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
OUR_BLOCK = lambda do
|
15
|
+
extend(ClassMethods)
|
16
|
+
include(InstanceMethods)
|
17
|
+
extend ModuleMethods if instance_of?(Module)
|
18
|
+
end
|
19
|
+
|
20
|
+
private_constant :OUR_BLOCK
|
21
|
+
|
14
22
|
module ModuleMethods
|
15
|
-
def included(base)
|
16
|
-
base.
|
17
|
-
|
18
|
-
|
23
|
+
def included(base = nil, &block)
|
24
|
+
if base.nil? && block
|
25
|
+
super do
|
26
|
+
instance_exec(&block)
|
27
|
+
instance_exec(&OUR_BLOCK)
|
28
|
+
end
|
29
|
+
else
|
30
|
+
base.instance_exec(&OUR_BLOCK)
|
31
|
+
end
|
19
32
|
end
|
20
33
|
end
|
21
34
|
|
@@ -32,16 +45,14 @@ module Memery
|
|
32
45
|
return false unless defined?(@_memery_module)
|
33
46
|
|
34
47
|
@_memery_module.method_defined?(method_name) ||
|
35
|
-
|
48
|
+
@_memery_module.private_method_defined?(method_name)
|
36
49
|
end
|
37
50
|
|
38
51
|
private
|
39
52
|
|
40
53
|
def prepend_memery_module!
|
41
54
|
return if defined?(@_memery_module)
|
42
|
-
@_memery_module = Module.new
|
43
|
-
extend MemoizationModule
|
44
|
-
end
|
55
|
+
@_memery_module = Module.new { extend MemoizationModule }
|
45
56
|
prepend @_memery_module
|
46
57
|
end
|
47
58
|
|
data/lib/memery/version.rb
CHANGED
data/memery.gemspec
CHANGED
@@ -5,6 +5,8 @@ $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.5.0"
|
9
|
+
|
8
10
|
spec.name = "memery"
|
9
11
|
spec.version = Memery::VERSION
|
10
12
|
spec.authors = ["Yuri Smirnov"]
|
@@ -22,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
22
24
|
|
23
25
|
spec.add_runtime_dependency "ruby2_keywords", "~> 0.0.2"
|
24
26
|
|
27
|
+
spec.add_development_dependency "activesupport"
|
25
28
|
spec.add_development_dependency "benchmark-ips"
|
26
29
|
spec.add_development_dependency "benchmark-memory"
|
27
30
|
spec.add_development_dependency "bundler"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Smirnov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby2_keywords
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
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'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: benchmark-ips
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,7 +190,7 @@ homepage: https://github.com/tycooon/memery
|
|
176
190
|
licenses:
|
177
191
|
- MIT
|
178
192
|
metadata: {}
|
179
|
-
post_install_message:
|
193
|
+
post_install_message:
|
180
194
|
rdoc_options: []
|
181
195
|
require_paths:
|
182
196
|
- lib
|
@@ -184,15 +198,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
198
|
requirements:
|
185
199
|
- - ">="
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
201
|
+
version: 2.5.0
|
188
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
203
|
requirements:
|
190
204
|
- - ">="
|
191
205
|
- !ruby/object:Gem::Version
|
192
206
|
version: '0'
|
193
207
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
195
|
-
signing_key:
|
208
|
+
rubygems_version: 3.2.14
|
209
|
+
signing_key:
|
196
210
|
specification_version: 4
|
197
211
|
summary: A gem for memoization.
|
198
212
|
test_files: []
|