CloudSesame 0.6.5 → 0.6.6
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/Gemfile.lock +1 -1
- data/cloud_sesame.gemspec +1 -1
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +6 -2
- data/lib/cloud_sesame/domain/client_module/caching.rb +2 -2
- data/lib/cloud_sesame/domain/client_module/caching/base.rb +7 -3
- data/lib/cloud_sesame/domain/client_module/caching/rails_cache.rb +1 -1
- data/lib/cloud_sesame/query/node/query.rb +1 -1
- data/spec/cloud_sesame/domain/client_module/caching/base_spec.rb +1 -1
- data/spec/cloud_sesame/domain/client_module/caching/no_cache_spec.rb +1 -1
- data/spec/cloud_sesame/domain/client_module/caching/rails_cache_spec.rb +1 -1
- data/spec/cloud_sesame/domain/client_module/caching_spec.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abce83b940d11489cc9207132fa660a000a0b015
|
4
|
+
data.tar.gz: 2118d371495f9053784308ace4aa407c9f79ce60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 934e078e5ba9f79ffd3b8119ade826f0837c59ef03aeb63ed16b1f906d174adc40cd6529745c92c391b228f24f307ca7b491bff2a8c65d04b656d242960e128e
|
7
|
+
data.tar.gz: 8e894da3fda36c571a95f2e746c74737b3c1c4bf53e9905e4c761919f73ad5a202b5829a156cfa45115cfa7ece5dd4b96b3749486965d0ec8ad1ff8fa4f8de8b
|
data/Gemfile.lock
CHANGED
data/cloud_sesame.gemspec
CHANGED
data/coverage/.last_run.json
CHANGED
data/coverage/.resultset.json
CHANGED
@@ -1655,7 +1655,7 @@
|
|
1655
1655
|
1,
|
1656
1656
|
null,
|
1657
1657
|
1,
|
1658
|
-
|
1658
|
+
17,
|
1659
1659
|
null,
|
1660
1660
|
null,
|
1661
1661
|
1,
|
@@ -2331,6 +2331,10 @@
|
|
2331
2331
|
null,
|
2332
2332
|
null,
|
2333
2333
|
1,
|
2334
|
+
1,
|
2335
|
+
null,
|
2336
|
+
null,
|
2337
|
+
1,
|
2334
2338
|
null,
|
2335
2339
|
1,
|
2336
2340
|
1,
|
@@ -2418,6 +2422,6 @@
|
|
2418
2422
|
null
|
2419
2423
|
]
|
2420
2424
|
},
|
2421
|
-
"timestamp":
|
2425
|
+
"timestamp": 1455637625
|
2422
2426
|
}
|
2423
2427
|
}
|
@@ -13,11 +13,11 @@ module CloudSesame
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def executor
|
16
|
-
@executor ||= Caching::NoCache.new(
|
16
|
+
@executor ||= Caching::NoCache.new(@searchable) { aws_client }
|
17
17
|
end
|
18
18
|
|
19
19
|
def executor=(executor)
|
20
|
-
@executor = executor.new(
|
20
|
+
@executor = executor.new(@searchable) { aws_client }
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
@@ -4,9 +4,13 @@ module CloudSesame
|
|
4
4
|
module Caching
|
5
5
|
class Base
|
6
6
|
|
7
|
-
def initialize(
|
8
|
-
@client = client
|
7
|
+
def initialize(searchable, &lazy_client)
|
9
8
|
@searchable = searchable
|
9
|
+
@lazy_client = lazy_client
|
10
|
+
end
|
11
|
+
|
12
|
+
def client
|
13
|
+
@client ||= @lazy_client.call
|
10
14
|
end
|
11
15
|
|
12
16
|
def fetch(_params)
|
@@ -16,7 +20,7 @@ module CloudSesame
|
|
16
20
|
private
|
17
21
|
|
18
22
|
def search(params)
|
19
|
-
|
23
|
+
client.search params
|
20
24
|
end
|
21
25
|
|
22
26
|
end
|
@@ -35,7 +35,7 @@ module CloudSesame
|
|
35
35
|
# =====================================
|
36
36
|
|
37
37
|
let(:client) { OpenStruct.new(search: nil) }
|
38
|
-
subject { RailsCache.new(
|
38
|
+
subject { RailsCache.new(Searchable) { client } }
|
39
39
|
|
40
40
|
shared_examples 'cache stored' do
|
41
41
|
it 'should cache the result' do
|
@@ -50,14 +50,18 @@ module CloudSesame
|
|
50
50
|
|
51
51
|
describe 'executor getter' do
|
52
52
|
it 'should default to Caching::NoCache' do
|
53
|
-
expect(Caching::NoCache).to receive(:new).with(subject.
|
53
|
+
expect(Caching::NoCache).to receive(:new).with(subject.searchable) do |_, &lazy_client|
|
54
|
+
expect(lazy_client.call).to eq subject.client
|
55
|
+
end.and_call_original
|
54
56
|
expect(subject.executor).to be_kind_of Caching::NoCache
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
58
60
|
describe 'executor setter' do
|
59
61
|
it 'should accept a caching module' do
|
60
|
-
expect(Caching::GoodCache).to receive(:new).with(subject.
|
62
|
+
expect(Caching::GoodCache).to receive(:new).with(subject.searchable) do |_, &lazy_client|
|
63
|
+
expect(lazy_client.call).to eq subject.client
|
64
|
+
end.and_call_original
|
61
65
|
subject.executor = Caching::GoodCache
|
62
66
|
expect(subject.executor).to be_kind_of Caching::GoodCache
|
63
67
|
end
|