coactive 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/coactive/loader.rb +1 -1
- data/lib/coactive/lookup.rb +6 -6
- data/lib/coactive/railtie.rb +9 -0
- data/lib/coactive/version.rb +1 -1
- data/lib/coactive.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec350eb0f4e954f1fa493547fcea1bbc8bef66b7968ae5cc56c8d4028136d84a
|
4
|
+
data.tar.gz: fb1fd1da81b027631dea81b1a03ee4295837c06bd1ef8332fb355529cf4120cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5238f3adc94100d21684d3fbec31d917e1ff69a08931a2b7fb11a9380f07b9257a0c17f958633f2cdd0477d3c3b2aa9de3cd97ca3aaa95d0aeac9ee10895f0
|
7
|
+
data.tar.gz: d71895d84b2ee93ddc5778e1406b8c3b1aee756eb31f0d01d84c2d4e84f1134595812dc34ab21e4c22ee7868c23e4a6134076ce236b9b04554b51b0002cd4943
|
data/CHANGELOG.md
CHANGED
data/lib/coactive/loader.rb
CHANGED
data/lib/coactive/lookup.rb
CHANGED
@@ -13,19 +13,19 @@ module Coactive
|
|
13
13
|
class_attribute :cache
|
14
14
|
self.cache = {}
|
15
15
|
|
16
|
-
def call(klass,
|
17
|
-
with_cache(klass,
|
18
|
-
lookup = lookups.detect { |lookup| lookup.callable?(
|
19
|
-
lookup.new(klass,
|
16
|
+
def call(klass, coactant)
|
17
|
+
with_cache(klass, coactant) do
|
18
|
+
lookup = lookups.detect { |lookup| lookup.callable?(coactant) }
|
19
|
+
lookup.new(klass, coactant).call if lookup
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
-
def with_cache(klass,
|
25
|
+
def with_cache(klass, coactant)
|
26
26
|
if klass.coactive_config.use_cache
|
27
27
|
self.cache[klass] ||= {}
|
28
|
-
self.cache[klass][
|
28
|
+
self.cache[klass][coactant] ||= yield
|
29
29
|
else
|
30
30
|
yield
|
31
31
|
end
|
data/lib/coactive/version.rb
CHANGED
data/lib/coactive.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coactive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshikazu Kaneta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- lib/coactive/lookups/base.rb
|
130
130
|
- lib/coactive/lookups/name.rb
|
131
131
|
- lib/coactive/lookups/object.rb
|
132
|
+
- lib/coactive/railtie.rb
|
132
133
|
- lib/coactive/version.rb
|
133
134
|
homepage: https://github.com/kanety/coactive
|
134
135
|
licenses: []
|