lite-memoize 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +17 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +41 -34
- data/lib/lite/memoize/alias.rb +0 -2
- data/lib/lite/memoize/instance.rb +2 -2
- data/lib/lite/memoize/klass.rb +1 -1
- data/lib/lite/memoize/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1bed3353173a17cfd361b54629f1cd4a4174f95ad5e757c9c71a058a61355c9
|
4
|
+
data.tar.gz: 0a7a50e56a3fb2a4094b0bd3383a68e5f121ffaf3717cf78778a264dd779bdac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37129e4677527b7c111da8e628bc7ff4fc12b52b3ace6e5beb9bcf8c44239969ea65dc3218e1e50138887702e78991f0b1efb83655c405074367dff30aeeeb44
|
7
|
+
data.tar.gz: 5bd93062875c442c8a84110c574cc068e9970ebd4eb2619e085df34b706c86a1161ed94e479af76938e43b2c18e2ef1908b9d741529c7994896456f9405f8663
|
data/.rubocop.yml
CHANGED
@@ -2,11 +2,14 @@ require:
|
|
2
2
|
- rubocop-performance
|
3
3
|
- rubocop-rspec
|
4
4
|
AllCops:
|
5
|
-
TargetRubyVersion: 2.
|
5
|
+
TargetRubyVersion: 2.7
|
6
|
+
NewCops: enable
|
6
7
|
DisplayCopNames: true
|
7
8
|
DisplayStyleGuide: true
|
8
|
-
|
9
|
-
|
9
|
+
Gemspec/RequiredRubyVersion:
|
10
|
+
Enabled: false
|
11
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
12
|
+
Enabled: true
|
10
13
|
Layout/EmptyLinesAroundBlockBody:
|
11
14
|
Exclude:
|
12
15
|
- 'spec/**/**/*'
|
@@ -14,6 +17,14 @@ Layout/EmptyLinesAroundClassBody:
|
|
14
17
|
EnforcedStyle: empty_lines_except_namespace
|
15
18
|
Layout/EmptyLinesAroundModuleBody:
|
16
19
|
EnforcedStyle: empty_lines_except_namespace
|
20
|
+
Layout/LineLength:
|
21
|
+
Max: 100
|
22
|
+
Layout/SpaceAroundMethodCallOperator:
|
23
|
+
Enabled: true
|
24
|
+
Lint/RaiseException:
|
25
|
+
Enabled: true
|
26
|
+
Lint/StructNewOverride:
|
27
|
+
Enabled: true
|
17
28
|
Metrics/BlockLength:
|
18
29
|
Exclude:
|
19
30
|
- 'spec/**/**/*'
|
@@ -24,11 +35,13 @@ Naming/FileName:
|
|
24
35
|
Enabled: false
|
25
36
|
Naming/MemoizedInstanceVariableName:
|
26
37
|
Enabled: false
|
27
|
-
Naming/
|
38
|
+
Naming/MethodParameterName:
|
28
39
|
Enabled: false
|
29
40
|
Style/AccessModifierDeclarations:
|
30
41
|
Enabled: false
|
31
42
|
Style/Documentation:
|
32
43
|
Enabled: false
|
44
|
+
Style/DocumentDynamicEvalDefinition:
|
45
|
+
Enabled: false
|
33
46
|
Style/ExpandPathArguments:
|
34
47
|
Enabled: false
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,8 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.0.4] - 2021-05-07
|
10
|
+
### Changed
|
11
|
+
- Performance bind call
|
12
|
+
|
9
13
|
## [1.0.3] - 2019-08-13
|
10
14
|
### Added
|
15
|
+
- Added ruby 2.7 support
|
11
16
|
- Added clear alias from clear_cache on Alias
|
12
17
|
|
13
18
|
## [1.0.2] - 2019-08-07
|
data/Gemfile.lock
CHANGED
@@ -1,52 +1,59 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lite-memoize (1.0.
|
4
|
+
lite-memoize (1.0.4)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
9
|
+
ast (2.4.2)
|
10
10
|
colorize (0.8.1)
|
11
|
-
diff-lcs (1.
|
12
|
-
fasterer (0.
|
11
|
+
diff-lcs (1.4.4)
|
12
|
+
fasterer (0.9.0)
|
13
13
|
colorize (~> 0.7)
|
14
|
-
ruby_parser (>= 3.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
ast (~> 2.4.0)
|
14
|
+
ruby_parser (>= 3.14.1)
|
15
|
+
parallel (1.20.1)
|
16
|
+
parser (3.0.1.1)
|
17
|
+
ast (~> 2.4.1)
|
19
18
|
rainbow (3.0.0)
|
20
|
-
rake (
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
rspec-
|
25
|
-
|
26
|
-
rspec-
|
27
|
-
rspec-
|
19
|
+
rake (13.0.3)
|
20
|
+
regexp_parser (2.1.1)
|
21
|
+
rexml (3.2.5)
|
22
|
+
rspec (3.10.0)
|
23
|
+
rspec-core (~> 3.10.0)
|
24
|
+
rspec-expectations (~> 3.10.0)
|
25
|
+
rspec-mocks (~> 3.10.0)
|
26
|
+
rspec-core (3.10.1)
|
27
|
+
rspec-support (~> 3.10.0)
|
28
|
+
rspec-expectations (3.10.1)
|
28
29
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
-
rspec-support (~> 3.
|
30
|
-
rspec-mocks (3.
|
30
|
+
rspec-support (~> 3.10.0)
|
31
|
+
rspec-mocks (3.10.2)
|
31
32
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-support (3.
|
34
|
-
rubocop (
|
35
|
-
jaro_winkler (~> 1.5.1)
|
33
|
+
rspec-support (~> 3.10.0)
|
34
|
+
rspec-support (3.10.2)
|
35
|
+
rubocop (1.14.0)
|
36
36
|
parallel (~> 1.10)
|
37
|
-
parser (>=
|
37
|
+
parser (>= 3.0.0.0)
|
38
38
|
rainbow (>= 2.2.2, < 4.0)
|
39
|
+
regexp_parser (>= 1.8, < 3.0)
|
40
|
+
rexml
|
41
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
39
42
|
ruby-progressbar (~> 1.7)
|
40
|
-
unicode-display_width (>= 1.4.0, <
|
41
|
-
rubocop-
|
42
|
-
|
43
|
-
rubocop-
|
44
|
-
rubocop (>=
|
45
|
-
|
46
|
-
|
43
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
44
|
+
rubocop-ast (1.5.0)
|
45
|
+
parser (>= 3.0.1.1)
|
46
|
+
rubocop-performance (1.11.3)
|
47
|
+
rubocop (>= 1.7.0, < 2.0)
|
48
|
+
rubocop-ast (>= 0.4.0)
|
49
|
+
rubocop-rspec (2.3.0)
|
50
|
+
rubocop (~> 1.0)
|
51
|
+
rubocop-ast (>= 1.1.0)
|
52
|
+
ruby-progressbar (1.11.0)
|
53
|
+
ruby_parser (3.15.1)
|
47
54
|
sexp_processor (~> 4.9)
|
48
|
-
sexp_processor (4.
|
49
|
-
unicode-display_width (
|
55
|
+
sexp_processor (4.15.2)
|
56
|
+
unicode-display_width (2.0.0)
|
50
57
|
|
51
58
|
PLATFORMS
|
52
59
|
ruby
|
@@ -62,4 +69,4 @@ DEPENDENCIES
|
|
62
69
|
rubocop-rspec
|
63
70
|
|
64
71
|
BUNDLED WITH
|
65
|
-
2.
|
72
|
+
2.2.17
|
data/lib/lite/memoize/alias.rb
CHANGED
@@ -41,7 +41,6 @@ module Lite
|
|
41
41
|
|
42
42
|
class << self
|
43
43
|
|
44
|
-
# rubocop:disable Lint/NestedMethodDefinition
|
45
44
|
def extended(extender)
|
46
45
|
Lite::Memoize::Alias.memoist_eval(extender) do
|
47
46
|
return if singleton_class.method_defined?(:memoized_methods)
|
@@ -51,7 +50,6 @@ module Lite
|
|
51
50
|
end
|
52
51
|
end
|
53
52
|
end
|
54
|
-
# rubocop:enable Lint/NestedMethodDefinition
|
55
53
|
|
56
54
|
def memoized_ivar_for(method_name, as = nil)
|
57
55
|
"@#{memoized_prefix(as)}_#{escape_punctuation(method_name)}"
|
@@ -26,11 +26,11 @@ module Lite
|
|
26
26
|
store.delete(key)
|
27
27
|
end
|
28
28
|
|
29
|
-
# :
|
29
|
+
# rubocop:disable Style/ExplicitBlockArgument
|
30
30
|
def each
|
31
31
|
store.each { |key, val| yield(key, val) }
|
32
32
|
end
|
33
|
-
# :
|
33
|
+
# rubocop:enable Style/ExplicitBlockArgument
|
34
34
|
|
35
35
|
def empty?
|
36
36
|
store.empty?
|
data/lib/lite/memoize/klass.rb
CHANGED
@@ -12,7 +12,7 @@ module Lite
|
|
12
12
|
define_method(method_name) do |*args|
|
13
13
|
key = self.class.caller_key(args, as: as || method_name)
|
14
14
|
|
15
|
-
self.class.store[key] ||= inner_method.
|
15
|
+
self.class.store[key] ||= inner_method.bind_call(self, *args)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
data/lib/lite/memoize/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite-memoize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email:
|
113
113
|
- j.gomez@drexed.com
|
114
114
|
executables: []
|
@@ -151,7 +151,7 @@ homepage: http://drexed.github.io/lite-memoize
|
|
151
151
|
licenses:
|
152
152
|
- MIT
|
153
153
|
metadata: {}
|
154
|
-
post_install_message:
|
154
|
+
post_install_message:
|
155
155
|
rdoc_options: []
|
156
156
|
require_paths:
|
157
157
|
- lib
|
@@ -166,8 +166,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
|
-
rubygems_version: 3.
|
170
|
-
signing_key:
|
169
|
+
rubygems_version: 3.2.17
|
170
|
+
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: Cache and memoization helpers for ruby Ruby classes
|
173
173
|
test_files: []
|