thermos 0.6.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thermos/beverage.rb +15 -14
- data/lib/thermos/refill_job.rb +8 -6
- data/lib/thermos/version.rb +1 -1
- data/lib/thermos.rb +39 -22
- data/test/dependencies_test.rb +61 -61
- data/test/dummy/app/models/category.rb +1 -1
- data/test/dummy/config/application.rb +3 -3
- data/test/dummy/config/boot.rb +3 -3
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +3 -3
- data/test/dummy/config/environments/production.rb +4 -4
- data/test/dummy/config/environments/test.rb +1 -1
- data/test/dummy/config/initializers/assets.rb +1 -1
- data/test/dummy/config/initializers/session_store.rb +1 -1
- data/test/dummy/db/schema.rb +20 -20
- data/test/filter_test.rb +16 -16
- data/test/queue_test.rb +9 -9
- data/test/test_helper.rb +6 -6
- data/test/thermos_test.rb +38 -38
- metadata +64 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8436d0765dee9eafadbbb9994cce8aaed1e5746d96bc735fccdf55a945dcb4a8
|
4
|
+
data.tar.gz: 19fd374d31d2885979d791ab9dc0bfe021c9c61053b97ed4f96a0a5d862afa75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd71bd6038960d9c556b3d55b697a6126d14573bb12ddc131e52a592629e39cc15e054c54cb0ee44aaf90a7b9879a43fc72571a9920c3ceae7b3a0721fb09cc2
|
7
|
+
data.tar.gz: 6de309fc56d581825c7497cd137595769ca81eff2298f9ba791b5809511bf1281e9b7376feac34849592c660605c9f53b5304e751f3e53df55cea8d377bf5413
|
data/lib/thermos/beverage.rb
CHANGED
@@ -60,26 +60,27 @@ module Thermos
|
|
60
60
|
def generate_deps(model, deps, root = nil, path = nil)
|
61
61
|
deps.reduce([]) do |acc, dep|
|
62
62
|
if dep.is_a? Symbol
|
63
|
-
acc <<
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
)
|
63
|
+
acc << Dependency.new(
|
64
|
+
model: root || model,
|
65
|
+
ref: model.reflect_on_association(dep),
|
66
|
+
path: path || dep,
|
67
|
+
)
|
69
68
|
elsif dep.is_a? Array
|
70
69
|
dep.each do |d|
|
71
|
-
acc <<
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
)
|
70
|
+
acc << Dependency.new(
|
71
|
+
model: root || model,
|
72
|
+
ref: model.reflect_on_association(d),
|
73
|
+
path: path || d,
|
74
|
+
)
|
77
75
|
end
|
78
76
|
elsif dep.is_a? Hash
|
79
77
|
dep.each do |k, v|
|
80
78
|
ref = model.reflect_on_association(k)
|
81
|
-
acc <<
|
82
|
-
|
79
|
+
acc << Dependency.new(
|
80
|
+
model: root || model,
|
81
|
+
ref: ref,
|
82
|
+
path: path || k,
|
83
|
+
)
|
83
84
|
acc.concat(generate_deps(ref.class_name.constantize, v, model, dep))
|
84
85
|
end
|
85
86
|
end
|
data/lib/thermos/refill_job.rb
CHANGED
@@ -10,9 +10,10 @@ module Thermos
|
|
10
10
|
def refill_primary_caches(model)
|
11
11
|
BeverageStorage.instance.beverages.each do |beverage|
|
12
12
|
if beverage.model == model.class && beverage.should_fill?(model)
|
13
|
-
Thermos::RebuildCacheJob
|
14
|
-
|
15
|
-
|
13
|
+
Thermos::RebuildCacheJob.set(queue: beverage.queue).perform_later(
|
14
|
+
beverage.key,
|
15
|
+
model.send(beverage.lookup_key),
|
16
|
+
)
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -22,9 +23,10 @@ module Thermos
|
|
22
23
|
beverage
|
23
24
|
.lookup_keys_for_dep_model(model)
|
24
25
|
.each do |lookup_key|
|
25
|
-
Thermos::RebuildCacheJob
|
26
|
-
|
27
|
-
|
26
|
+
Thermos::RebuildCacheJob.set(queue: beverage.queue).perform_later(
|
27
|
+
beverage.key,
|
28
|
+
lookup_key,
|
29
|
+
)
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
data/lib/thermos/version.rb
CHANGED
data/lib/thermos.rb
CHANGED
@@ -1,37 +1,54 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
3
|
+
require "thermos/beverage"
|
4
|
+
require "thermos/beverage_storage"
|
5
|
+
require "thermos/dependency"
|
6
|
+
require "thermos/notifier"
|
7
|
+
require "thermos/refill_job"
|
8
|
+
require "thermos/rebuild_cache_job"
|
9
9
|
|
10
10
|
module Thermos
|
11
|
-
def self.keep_warm(
|
11
|
+
def self.keep_warm(
|
12
|
+
key:,
|
13
|
+
model:,
|
14
|
+
id:,
|
15
|
+
deps: [],
|
16
|
+
lookup_key: nil,
|
17
|
+
filter: nil,
|
18
|
+
queue: nil,
|
19
|
+
&block
|
20
|
+
)
|
12
21
|
fill(
|
13
|
-
key: key,
|
14
|
-
model: model,
|
15
|
-
deps: deps,
|
16
|
-
lookup_key: lookup_key,
|
17
|
-
filter: filter,
|
18
|
-
queue: queue,
|
22
|
+
key: key,
|
23
|
+
model: model,
|
24
|
+
deps: deps,
|
25
|
+
lookup_key: lookup_key,
|
26
|
+
filter: filter,
|
27
|
+
queue: queue,
|
19
28
|
&block
|
20
29
|
)
|
21
30
|
drink(key: key, id: id)
|
22
31
|
end
|
23
32
|
|
24
|
-
def self.fill(
|
33
|
+
def self.fill(
|
34
|
+
key:,
|
35
|
+
model:,
|
36
|
+
deps: [],
|
37
|
+
lookup_key: nil,
|
38
|
+
filter: nil,
|
39
|
+
queue: nil,
|
40
|
+
&block
|
41
|
+
)
|
25
42
|
BeverageStorage.instance.add_beverage(
|
26
43
|
Beverage.new(
|
27
|
-
key: key,
|
28
|
-
model: model,
|
29
|
-
deps: deps,
|
30
|
-
action: block,
|
31
|
-
lookup_key: lookup_key,
|
32
|
-
filter: filter,
|
33
|
-
queue: queue
|
34
|
-
)
|
44
|
+
key: key,
|
45
|
+
model: model,
|
46
|
+
deps: deps,
|
47
|
+
action: block,
|
48
|
+
lookup_key: lookup_key,
|
49
|
+
filter: filter,
|
50
|
+
queue: queue,
|
51
|
+
),
|
35
52
|
)
|
36
53
|
end
|
37
54
|
|
data/test/dependencies_test.rb
CHANGED
@@ -1,58 +1,58 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class DependenciesTest < ActiveSupport::TestCase
|
4
4
|
self.use_transactional_tests = true
|
5
5
|
teardown :clear_cache
|
6
6
|
|
7
|
-
test
|
7
|
+
test "rebuilds the cache on has_many model change" do
|
8
8
|
mock = Minitest::Mock.new
|
9
9
|
category = categories(:baseball)
|
10
10
|
category_item = category_items(:baseball_glove)
|
11
11
|
|
12
|
-
Thermos.fill(key:
|
12
|
+
Thermos.fill(key: "key", model: Category, deps: [:category_items]) do |id|
|
13
13
|
mock.call(id)
|
14
14
|
end
|
15
15
|
|
16
16
|
mock.expect(:call, 1, [category.id])
|
17
|
-
assert_equal 1, Thermos.drink(key:
|
17
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
18
18
|
mock.verify
|
19
19
|
|
20
20
|
mock.expect(:call, 2, [category.id])
|
21
|
-
category_item.update!(name:
|
21
|
+
category_item.update!(name: "foo")
|
22
22
|
mock.verify
|
23
23
|
|
24
24
|
mock.expect(:call, 3, [category.id])
|
25
|
-
assert_equal 2, Thermos.drink(key:
|
25
|
+
assert_equal 2, Thermos.drink(key: "key", id: category.id)
|
26
26
|
assert_raises(MockExpectationError) { mock.verify }
|
27
27
|
end
|
28
28
|
|
29
|
-
test
|
29
|
+
test "does not rebuild the cache for an unrelated has_many model change" do
|
30
30
|
mock = Minitest::Mock.new
|
31
31
|
category = categories(:baseball)
|
32
32
|
category_item = CategoryItem.create(category: nil)
|
33
33
|
|
34
|
-
Thermos.fill(key:
|
34
|
+
Thermos.fill(key: "key", model: Category, deps: [:category_items]) do |id|
|
35
35
|
mock.call(id)
|
36
36
|
end
|
37
37
|
|
38
38
|
mock.expect(:call, 1, [category.id])
|
39
|
-
assert_equal 1, Thermos.drink(key:
|
39
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
40
40
|
mock.verify
|
41
41
|
|
42
42
|
mock.expect(:call, 2, [category.id])
|
43
|
-
category_item.update!(name:
|
43
|
+
category_item.update!(name: "foo")
|
44
44
|
assert_raises(MockExpectationError) { mock.verify }
|
45
45
|
|
46
46
|
mock.expect(:call, 3, [category.id])
|
47
|
-
assert_equal 1, Thermos.drink(key:
|
47
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
48
48
|
assert_raises(MockExpectationError) { mock.verify }
|
49
49
|
end
|
50
50
|
|
51
|
-
test
|
51
|
+
test "re-builds the cache for new has_many records" do
|
52
52
|
mock = Minitest::Mock.new
|
53
53
|
category = categories(:baseball)
|
54
54
|
|
55
|
-
Thermos.fill(key:
|
55
|
+
Thermos.fill(key: "key", model: Category, deps: [:category_items]) do |id|
|
56
56
|
mock.call(id)
|
57
57
|
end
|
58
58
|
|
@@ -61,17 +61,17 @@ class DependenciesTest < ActiveSupport::TestCase
|
|
61
61
|
mock.verify
|
62
62
|
|
63
63
|
mock.expect(:call, 2, [category.id])
|
64
|
-
assert_equal 1, Thermos.drink(key:
|
64
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
65
65
|
assert_raises(MockExpectationError) { mock.verify }
|
66
66
|
end
|
67
67
|
|
68
|
-
test
|
68
|
+
test "re-builds the cache for has_many record changes when filter condition is met" do
|
69
69
|
mock = Minitest::Mock.new
|
70
70
|
category = categories(:baseball)
|
71
71
|
filter = ->(model) { model.ball? }
|
72
72
|
|
73
73
|
Thermos.fill(
|
74
|
-
key:
|
74
|
+
key: "key",
|
75
75
|
model: Category,
|
76
76
|
deps: [:category_items],
|
77
77
|
filter: filter,
|
@@ -81,82 +81,82 @@ class DependenciesTest < ActiveSupport::TestCase
|
|
81
81
|
CategoryItem.create!(category: category)
|
82
82
|
mock.verify
|
83
83
|
|
84
|
-
category.update!(name:
|
84
|
+
category.update!(name: "hockey")
|
85
85
|
|
86
86
|
mock.expect(:call, 1, [category.id])
|
87
87
|
CategoryItem.create!(category: category)
|
88
88
|
assert_raises(MockExpectationError) { mock.verify }
|
89
89
|
end
|
90
90
|
|
91
|
-
test
|
91
|
+
test "rebuilds the cache on belongs_to model change" do
|
92
92
|
mock = Minitest::Mock.new
|
93
93
|
category = categories(:baseball)
|
94
94
|
store = stores(:sports)
|
95
95
|
|
96
|
-
Thermos.fill(key:
|
96
|
+
Thermos.fill(key: "key", model: Category, deps: [:store]) do |id|
|
97
97
|
mock.call(id)
|
98
98
|
end
|
99
99
|
|
100
100
|
mock.expect(:call, 1, [category.id])
|
101
|
-
assert_equal 1, Thermos.drink(key:
|
101
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
102
102
|
mock.verify
|
103
103
|
|
104
104
|
mock.expect(:call, 2, [category.id])
|
105
|
-
store.update!(name:
|
105
|
+
store.update!(name: "foo")
|
106
106
|
mock.verify
|
107
107
|
|
108
108
|
mock.expect(:call, 3, [category.id])
|
109
|
-
assert_equal 2, Thermos.drink(key:
|
109
|
+
assert_equal 2, Thermos.drink(key: "key", id: category.id)
|
110
110
|
assert_raises(MockExpectationError) { mock.verify }
|
111
111
|
end
|
112
112
|
|
113
|
-
test
|
113
|
+
test "does not rebuild the cache for an unrelated belongs_to model change" do
|
114
114
|
mock = Minitest::Mock.new
|
115
115
|
category = categories(:baseball)
|
116
116
|
store = Store.create!
|
117
117
|
|
118
|
-
Thermos.fill(key:
|
118
|
+
Thermos.fill(key: "key", model: Category, deps: [:store]) do |id|
|
119
119
|
mock.call(id)
|
120
120
|
end
|
121
121
|
|
122
122
|
mock.expect(:call, 1, [category.id])
|
123
|
-
assert_equal 1, Thermos.drink(key:
|
123
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
124
124
|
mock.verify
|
125
125
|
|
126
126
|
mock.expect(:call, 2, [category.id])
|
127
|
-
store.update!(name:
|
127
|
+
store.update!(name: "foo")
|
128
128
|
assert_raises(MockExpectationError) { mock.verify }
|
129
129
|
|
130
130
|
mock.expect(:call, 3, [category.id])
|
131
|
-
assert_equal 1, Thermos.drink(key:
|
131
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
132
132
|
assert_raises(MockExpectationError) { mock.verify }
|
133
133
|
end
|
134
134
|
|
135
|
-
test
|
135
|
+
test "re-builds the cache for new belongs_to records" do
|
136
136
|
mock = Minitest::Mock.new
|
137
137
|
category = categories(:baseball)
|
138
138
|
|
139
|
-
Thermos.fill(key:
|
139
|
+
Thermos.fill(key: "key", model: Category, deps: [:store]) do |id|
|
140
140
|
mock.call(id)
|
141
141
|
end
|
142
142
|
|
143
143
|
mock.expect(:call, 1, [category.id])
|
144
144
|
mock.expect(:call, 1, [category.id])
|
145
|
-
Store.create!(name:
|
145
|
+
Store.create!(name: "foo", categories: [category])
|
146
146
|
mock.verify
|
147
147
|
|
148
148
|
mock.expect(:call, 2, [category.id])
|
149
|
-
assert_equal 1, Thermos.drink(key:
|
149
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
150
150
|
assert_raises(MockExpectationError) { mock.verify }
|
151
151
|
end
|
152
152
|
|
153
|
-
test
|
153
|
+
test "re-builds the cache for belongs_to record changes when filter condition is met" do
|
154
154
|
mock = Minitest::Mock.new
|
155
155
|
category = categories(:baseball)
|
156
156
|
filter = ->(model) { model.ball? }
|
157
157
|
|
158
158
|
Thermos.fill(
|
159
|
-
key:
|
159
|
+
key: "key",
|
160
160
|
model: Category,
|
161
161
|
deps: [:store],
|
162
162
|
filter: filter,
|
@@ -164,65 +164,65 @@ class DependenciesTest < ActiveSupport::TestCase
|
|
164
164
|
|
165
165
|
mock.expect(:call, 1, [category.id])
|
166
166
|
mock.expect(:call, 1, [category.id])
|
167
|
-
Store.create!(name:
|
167
|
+
Store.create!(name: "foo", categories: [category])
|
168
168
|
mock.verify
|
169
169
|
|
170
|
-
category.update!(name:
|
170
|
+
category.update!(name: "hockey")
|
171
171
|
|
172
172
|
mock.expect(:call, 2, [category.id])
|
173
|
-
Store.create!(name:
|
173
|
+
Store.create!(name: "bar", categories: [category])
|
174
174
|
assert_raises(MockExpectationError) { mock.verify }
|
175
175
|
end
|
176
176
|
|
177
|
-
test
|
177
|
+
test "rebuilds the cache on has_many through model change" do
|
178
178
|
mock = Minitest::Mock.new
|
179
179
|
category = categories(:baseball)
|
180
180
|
product = products(:glove)
|
181
181
|
|
182
|
-
Thermos.fill(key:
|
182
|
+
Thermos.fill(key: "key", model: Category, deps: [:products]) do |id|
|
183
183
|
mock.call(id)
|
184
184
|
end
|
185
185
|
|
186
186
|
mock.expect(:call, 1, [category.id])
|
187
|
-
assert_equal 1, Thermos.drink(key:
|
187
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
188
188
|
mock.verify
|
189
189
|
|
190
190
|
mock.expect(:call, 2, [category.id])
|
191
|
-
product.update!(name:
|
191
|
+
product.update!(name: "foo")
|
192
192
|
mock.verify
|
193
193
|
|
194
194
|
mock.expect(:call, 3, [category.id])
|
195
|
-
assert_equal 2, Thermos.drink(key:
|
195
|
+
assert_equal 2, Thermos.drink(key: "key", id: category.id)
|
196
196
|
assert_raises(MockExpectationError) { mock.verify }
|
197
197
|
end
|
198
198
|
|
199
|
-
test
|
199
|
+
test "does not rebuild the cache for an unrelated has_many through model change" do
|
200
200
|
mock = Minitest::Mock.new
|
201
201
|
category = categories(:baseball)
|
202
202
|
product = Product.create!
|
203
203
|
|
204
|
-
Thermos.fill(key:
|
204
|
+
Thermos.fill(key: "key", model: Category, deps: [:products]) do |id|
|
205
205
|
mock.call(id)
|
206
206
|
end
|
207
207
|
|
208
208
|
mock.expect(:call, 1, [category.id])
|
209
|
-
assert_equal 1, Thermos.drink(key:
|
209
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
210
210
|
mock.verify
|
211
211
|
|
212
212
|
mock.expect(:call, 2, [category.id])
|
213
|
-
product.update!(name:
|
213
|
+
product.update!(name: "foo")
|
214
214
|
assert_raises(MockExpectationError) { mock.verify }
|
215
215
|
|
216
216
|
mock.expect(:call, 3, [category.id])
|
217
|
-
assert_equal 1, Thermos.drink(key:
|
217
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
218
218
|
assert_raises(MockExpectationError) { mock.verify }
|
219
219
|
end
|
220
220
|
|
221
|
-
test
|
221
|
+
test "re-builds the cache for new has_many through records" do
|
222
222
|
mock = Minitest::Mock.new
|
223
223
|
category = categories(:baseball)
|
224
224
|
|
225
|
-
Thermos.fill(key:
|
225
|
+
Thermos.fill(key: "key", model: Category, deps: [:products]) do |id|
|
226
226
|
mock.call(id)
|
227
227
|
end
|
228
228
|
|
@@ -231,17 +231,17 @@ class DependenciesTest < ActiveSupport::TestCase
|
|
231
231
|
mock.verify
|
232
232
|
|
233
233
|
mock.expect(:call, 2, [category.id])
|
234
|
-
assert_equal 1, Thermos.drink(key:
|
234
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
235
235
|
assert_raises(MockExpectationError) { mock.verify }
|
236
236
|
end
|
237
237
|
|
238
|
-
test
|
238
|
+
test "re-builds the cache for has_many through record changes when filter condition is met" do
|
239
239
|
mock = Minitest::Mock.new
|
240
240
|
category = categories(:baseball)
|
241
241
|
filter = ->(model) { model.ball? }
|
242
242
|
|
243
243
|
Thermos.fill(
|
244
|
-
key:
|
244
|
+
key: "key",
|
245
245
|
model: Category,
|
246
246
|
deps: [:products],
|
247
247
|
filter: filter,
|
@@ -251,56 +251,56 @@ class DependenciesTest < ActiveSupport::TestCase
|
|
251
251
|
Product.create!(categories: [category])
|
252
252
|
mock.verify
|
253
253
|
|
254
|
-
category.update!(name:
|
254
|
+
category.update!(name: "hockey")
|
255
255
|
|
256
256
|
mock.expect(:call, 2, [category.id])
|
257
257
|
Product.create!(categories: [category])
|
258
258
|
assert_raises(MockExpectationError) { mock.verify }
|
259
259
|
end
|
260
260
|
|
261
|
-
test
|
261
|
+
test "handles indirect associations" do
|
262
262
|
mock = Minitest::Mock.new
|
263
263
|
category = categories(:baseball)
|
264
264
|
store = category.store
|
265
265
|
|
266
266
|
Thermos.fill(
|
267
|
-
key:
|
267
|
+
key: "key",
|
268
268
|
model: Store,
|
269
269
|
deps: [categories: [:products]],
|
270
270
|
) { |id| mock.call(id) }
|
271
271
|
|
272
272
|
mock.expect(:call, 1, [store.id])
|
273
|
-
category.update!(name:
|
273
|
+
category.update!(name: "foo")
|
274
274
|
mock.verify
|
275
275
|
|
276
276
|
mock.expect(:call, 2, [store.id])
|
277
|
-
assert_equal 1, Thermos.drink(key:
|
277
|
+
assert_equal 1, Thermos.drink(key: "key", id: store.id)
|
278
278
|
assert_raises(MockExpectationError) { mock.verify }
|
279
279
|
Product.create!(categories: [category])
|
280
280
|
mock.verify
|
281
281
|
|
282
282
|
mock.expect(:call, 3, [store.id])
|
283
|
-
assert_equal 2, Thermos.drink(key:
|
283
|
+
assert_equal 2, Thermos.drink(key: "key", id: store.id)
|
284
284
|
assert_raises(MockExpectationError) { mock.verify }
|
285
285
|
end
|
286
286
|
|
287
|
-
test
|
287
|
+
test "only rebuilds cache for stated dependencies, even if another cache has an associated model of the primary" do
|
288
288
|
category_mock = Minitest::Mock.new
|
289
289
|
product_mock = Minitest::Mock.new
|
290
290
|
category = categories(:baseball)
|
291
291
|
product = products(:glove)
|
292
292
|
|
293
|
-
Thermos.fill(key:
|
293
|
+
Thermos.fill(key: "category_key", model: Category) do |id|
|
294
294
|
category_mock.call(id)
|
295
295
|
end
|
296
296
|
|
297
|
-
Thermos.fill(key:
|
297
|
+
Thermos.fill(key: "product_key", model: Product) do |id|
|
298
298
|
product_mock.call(id)
|
299
299
|
end
|
300
300
|
|
301
301
|
category_mock.expect(:call, 2, [category.id])
|
302
302
|
product_mock.expect(:call, 2, [product.id])
|
303
|
-
product.update!(name:
|
303
|
+
product.update!(name: "foo")
|
304
304
|
assert_raises(MockExpectationError) { category_mock.verify }
|
305
305
|
product_mock.verify
|
306
306
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require File.expand_path(
|
1
|
+
require File.expand_path("../boot", __FILE__)
|
2
2
|
|
3
|
-
require
|
3
|
+
require "rails/all"
|
4
4
|
|
5
5
|
Bundler.require(*Rails.groups)
|
6
|
-
require
|
6
|
+
require "thermos"
|
7
7
|
|
8
8
|
module Dummy
|
9
9
|
class Application < Rails::Application
|
data/test/dummy/config/boot.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Set up gems listed in the Gemfile.
|
2
|
-
ENV[
|
2
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../../Gemfile", __FILE__)
|
3
3
|
|
4
|
-
require
|
5
|
-
$LOAD_PATH.unshift File.expand_path(
|
4
|
+
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
5
|
+
$LOAD_PATH.unshift File.expand_path("../../../../lib", __FILE__)
|
@@ -25,16 +25,16 @@ Rails.application.configure do
|
|
25
25
|
# Debug mode disables concatenation and preprocessing of assets.
|
26
26
|
# This option may cause significant delays in view rendering with a large
|
27
27
|
# number of complex assets.
|
28
|
-
config.assets.debug = true
|
28
|
+
# config.assets.debug = true
|
29
29
|
|
30
30
|
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
31
31
|
# yet still be able to expire them through the digest params.
|
32
|
-
config.assets.digest = true
|
32
|
+
# config.assets.digest = true
|
33
33
|
|
34
34
|
# Adds additional error checking when serving assets at runtime.
|
35
35
|
# Checks for improperly declared sprockets dependencies.
|
36
36
|
# Raises helpful error messages.
|
37
|
-
config.assets.raise_runtime_errors = true
|
37
|
+
# config.assets.raise_runtime_errors = true
|
38
38
|
|
39
39
|
# Raises error for missing translations
|
40
40
|
# config.action_view.raise_on_missing_translations = true
|
@@ -22,19 +22,19 @@ Rails.application.configure do
|
|
22
22
|
|
23
23
|
# Disable serving static files from the `/public` folder by default since
|
24
24
|
# Apache or NGINX already handles this.
|
25
|
-
config.serve_static_files = ENV[
|
25
|
+
config.serve_static_files = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
26
26
|
|
27
27
|
# Compress JavaScripts and CSS.
|
28
|
-
config.assets.js_compressor = :uglifier
|
28
|
+
# config.assets.js_compressor = :uglifier
|
29
29
|
|
30
30
|
# config.assets.css_compressor = :sass
|
31
31
|
|
32
32
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
33
|
-
config.assets.compile = false
|
33
|
+
# config.assets.compile = false
|
34
34
|
|
35
35
|
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
36
36
|
# yet still be able to expire them through the digest params.
|
37
|
-
config.assets.digest = true
|
37
|
+
# config.assets.digest = true
|
38
38
|
|
39
39
|
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
40
40
|
|
@@ -14,7 +14,7 @@ Rails.application.configure do
|
|
14
14
|
|
15
15
|
# Configure static file server for tests with Cache-Control for performance.
|
16
16
|
config.serve_static_files = true
|
17
|
-
config.static_cache_control =
|
17
|
+
config.static_cache_control = "public, max-age=3600"
|
18
18
|
|
19
19
|
# Show full error reports and disable caching.
|
20
20
|
config.consider_all_requests_local = true
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
# Version of your assets, change this if you want to expire all your assets.
|
4
|
-
Rails.application.config.assets.version = '1.0'
|
4
|
+
# Rails.application.config.assets.version = '1.0'
|
5
5
|
|
6
6
|
# Add additional assets to the asset load path
|
7
7
|
# Rails.application.config.assets.paths << Emoji.images_path
|
data/test/dummy/db/schema.rb
CHANGED
@@ -10,31 +10,31 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version: 2016_03_26_174530) do
|
14
|
-
create_table
|
15
|
-
t.string
|
16
|
-
t.integer
|
17
|
-
t.datetime
|
18
|
-
t.datetime
|
13
|
+
ActiveRecord::Schema[7.0].define(version: 2016_03_26_174530) do
|
14
|
+
create_table "categories", force: :cascade do |t|
|
15
|
+
t.string "name"
|
16
|
+
t.integer "store_id"
|
17
|
+
t.datetime "created_at", precision: nil, null: false
|
18
|
+
t.datetime "updated_at", precision: nil, null: false
|
19
19
|
end
|
20
20
|
|
21
|
-
create_table
|
22
|
-
t.string
|
23
|
-
t.integer
|
24
|
-
t.integer
|
25
|
-
t.datetime
|
26
|
-
t.datetime
|
21
|
+
create_table "category_items", force: :cascade do |t|
|
22
|
+
t.string "name"
|
23
|
+
t.integer "category_id"
|
24
|
+
t.integer "product_id"
|
25
|
+
t.datetime "created_at", precision: nil, null: false
|
26
|
+
t.datetime "updated_at", precision: nil, null: false
|
27
27
|
end
|
28
28
|
|
29
|
-
create_table
|
30
|
-
t.string
|
31
|
-
t.datetime
|
32
|
-
t.datetime
|
29
|
+
create_table "products", force: :cascade do |t|
|
30
|
+
t.string "name"
|
31
|
+
t.datetime "created_at", precision: nil, null: false
|
32
|
+
t.datetime "updated_at", precision: nil, null: false
|
33
33
|
end
|
34
34
|
|
35
|
-
create_table
|
36
|
-
t.string
|
37
|
-
t.datetime
|
38
|
-
t.datetime
|
35
|
+
create_table "stores", force: :cascade do |t|
|
36
|
+
t.string "name"
|
37
|
+
t.datetime "created_at", precision: nil, null: false
|
38
|
+
t.datetime "updated_at", precision: nil, null: false
|
39
39
|
end
|
40
40
|
end
|
data/test/filter_test.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class FilterTest < ActiveSupport::TestCase
|
4
4
|
self.use_transactional_tests = true
|
5
5
|
teardown :clear_cache
|
6
6
|
|
7
|
-
test
|
7
|
+
test "allows filtering for which records should be rebuilt" do
|
8
8
|
mock = Minitest::Mock.new
|
9
9
|
category = categories(:baseball)
|
10
|
-
filter = ->(model) { model.name.match(
|
10
|
+
filter = ->(model) { model.name.match("ball") }
|
11
11
|
Thermos.fill(
|
12
|
-
key:
|
12
|
+
key: "key",
|
13
13
|
model: Category,
|
14
|
-
lookup_key:
|
14
|
+
lookup_key: "name",
|
15
15
|
filter: filter,
|
16
16
|
) { |name| mock.call(name) }
|
17
17
|
|
18
|
-
mock.expect(:call, 1, [
|
19
|
-
category.update!(name:
|
18
|
+
mock.expect(:call, 1, ["basketball"])
|
19
|
+
category.update!(name: "basketball")
|
20
20
|
mock.verify
|
21
21
|
|
22
|
-
mock.expect(:call, 1, [
|
23
|
-
category.update!(name:
|
22
|
+
mock.expect(:call, 1, ["hockey"])
|
23
|
+
category.update!(name: "hockey")
|
24
24
|
assert_raises(MockExpectationError) { mock.verify }
|
25
25
|
end
|
26
26
|
|
27
|
-
test
|
27
|
+
test "allows filtering based on the beverage when multiple beverages are configured and only one of them has a filter" do
|
28
28
|
mock = Minitest::Mock.new
|
29
29
|
store = stores(:supermarket)
|
30
30
|
category = categories(:baseball)
|
@@ -34,19 +34,19 @@ class FilterTest < ActiveSupport::TestCase
|
|
34
34
|
filter = ->(model) { model.ball? }
|
35
35
|
|
36
36
|
Thermos.fill(
|
37
|
-
key:
|
37
|
+
key: "key",
|
38
38
|
model: Category,
|
39
|
-
lookup_key:
|
39
|
+
lookup_key: "name",
|
40
40
|
filter: filter,
|
41
41
|
) { |name| mock.call(name) }
|
42
42
|
|
43
|
-
Thermos.fill(key:
|
43
|
+
Thermos.fill(key: "key_2", model: Store, lookup_key: "name") do |name|
|
44
44
|
mock.call(name)
|
45
45
|
end
|
46
46
|
|
47
|
-
mock.expect(:call, 1, [
|
48
|
-
store.update!(name:
|
49
|
-
assert_equal 1, Thermos.drink(key:
|
47
|
+
mock.expect(:call, 1, ["groceries"])
|
48
|
+
store.update!(name: "groceries")
|
49
|
+
assert_equal 1, Thermos.drink(key: "key_2", id: "groceries")
|
50
50
|
mock.verify
|
51
51
|
end
|
52
52
|
end
|
data/test/queue_test.rb
CHANGED
@@ -1,36 +1,36 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class QueueTest < ActiveSupport::TestCase
|
4
4
|
include ActiveJob::TestHelper
|
5
5
|
self.use_transactional_tests = true
|
6
6
|
teardown :clear_cache
|
7
7
|
|
8
|
-
test
|
8
|
+
test "uses the default background queue by default" do
|
9
9
|
mock = Minitest::Mock.new
|
10
10
|
category = categories(:baseball)
|
11
11
|
|
12
|
-
Thermos.fill(key:
|
12
|
+
Thermos.fill(key: "key", model: Category) { |id| mock.call(id) }
|
13
13
|
|
14
14
|
mock.expect(:call, 1, [category.id])
|
15
|
-
assert_performed_with(job: Thermos::RebuildCacheJob, queue:
|
16
|
-
category.update!(name:
|
15
|
+
assert_performed_with(job: Thermos::RebuildCacheJob, queue: "default") do
|
16
|
+
category.update!(name: "foo")
|
17
17
|
end
|
18
18
|
mock.verify
|
19
19
|
end
|
20
20
|
|
21
|
-
test
|
21
|
+
test "can specify a preferred queue name for the cache filling" do
|
22
22
|
mock = Minitest::Mock.new
|
23
23
|
category = categories(:baseball)
|
24
24
|
|
25
|
-
Thermos.fill(key:
|
25
|
+
Thermos.fill(key: "key", model: Category, queue: "low_priority") do |id|
|
26
26
|
mock.call(id)
|
27
27
|
end
|
28
28
|
|
29
29
|
mock.expect(:call, 1, [category.id])
|
30
30
|
assert_performed_with(
|
31
31
|
job: Thermos::RebuildCacheJob,
|
32
|
-
queue:
|
33
|
-
) { category.update!(name:
|
32
|
+
queue: "low_priority",
|
33
|
+
) { category.update!(name: "foo") }
|
34
34
|
mock.verify
|
35
35
|
end
|
36
36
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# Configure Rails Environment
|
2
|
-
ENV[
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
3
|
|
4
|
-
require File.expand_path(
|
4
|
+
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
|
5
5
|
ActiveRecord::Migrator.migrations_paths = [
|
6
|
-
File.expand_path(
|
6
|
+
File.expand_path("../../test/dummy/db/migrate", __FILE__),
|
7
7
|
]
|
8
|
-
require
|
8
|
+
require "rails/test_help"
|
9
9
|
|
10
10
|
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
11
11
|
# to be shown.
|
12
12
|
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
13
|
-
require
|
13
|
+
require "minitest/mock"
|
14
14
|
|
15
15
|
# Load support files
|
16
16
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
@@ -18,7 +18,7 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
18
18
|
# Load fixtures from the engine
|
19
19
|
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
20
20
|
ActiveSupport::TestCase.fixture_path =
|
21
|
-
File.expand_path(
|
21
|
+
File.expand_path("../fixtures", __FILE__)
|
22
22
|
ActionDispatch::IntegrationTest.fixture_path =
|
23
23
|
ActiveSupport::TestCase.fixture_path
|
24
24
|
ActiveSupport::TestCase.fixtures :all
|
data/test/thermos_test.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
require
|
1
|
+
require "test_helper"
|
2
2
|
|
3
3
|
class ThermosTest < ActiveSupport::TestCase
|
4
4
|
self.use_transactional_tests = true
|
5
5
|
teardown :clear_cache
|
6
6
|
|
7
|
-
test
|
7
|
+
test "keeps the cache warm using fill / drink" do
|
8
8
|
mock = Minitest::Mock.new
|
9
9
|
|
10
|
-
Thermos.fill(key:
|
10
|
+
Thermos.fill(key: "key", model: Category) { |id| mock.call(id) }
|
11
11
|
|
12
12
|
mock.expect(:call, 1, [1])
|
13
|
-
assert_equal 1, Thermos.drink(key:
|
13
|
+
assert_equal 1, Thermos.drink(key: "key", id: 1)
|
14
14
|
mock.verify
|
15
15
|
|
16
16
|
mock.expect(:call, 2, [1])
|
17
|
-
assert_equal 1, Thermos.drink(key:
|
17
|
+
assert_equal 1, Thermos.drink(key: "key", id: 1)
|
18
18
|
assert_raises(MockExpectationError) { mock.verify }
|
19
19
|
end
|
20
20
|
|
21
|
-
test
|
21
|
+
test "keeps the cache warm using keep_warm" do
|
22
22
|
mock = Minitest::Mock.new
|
23
23
|
|
24
24
|
mock.expect(:call, 1, [1])
|
25
25
|
response =
|
26
|
-
Thermos.keep_warm(key:
|
26
|
+
Thermos.keep_warm(key: "key", model: Category, id: 1) do |id|
|
27
27
|
mock.call(id)
|
28
28
|
end
|
29
29
|
assert_equal 1, response
|
@@ -31,7 +31,7 @@ class ThermosTest < ActiveSupport::TestCase
|
|
31
31
|
|
32
32
|
mock.expect(:call, 2, [1])
|
33
33
|
response =
|
34
|
-
Thermos.keep_warm(key:
|
34
|
+
Thermos.keep_warm(key: "key", model: Category, id: 1) do |id|
|
35
35
|
mock.call(id)
|
36
36
|
end
|
37
37
|
assert_equal 1, response
|
@@ -39,75 +39,75 @@ class ThermosTest < ActiveSupport::TestCase
|
|
39
39
|
end
|
40
40
|
|
41
41
|
# primary model changes
|
42
|
-
test
|
42
|
+
test "rebuilds the cache on primary model change" do
|
43
43
|
mock = Minitest::Mock.new
|
44
44
|
category = categories(:baseball)
|
45
45
|
|
46
|
-
Thermos.fill(key:
|
46
|
+
Thermos.fill(key: "key", model: Category) { |id| mock.call(id) }
|
47
47
|
|
48
48
|
mock.expect(:call, 1, [category.id])
|
49
|
-
assert_equal 1, Thermos.drink(key:
|
49
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
50
50
|
mock.verify
|
51
51
|
|
52
52
|
mock.expect(:call, 2, [category.id])
|
53
|
-
category.update!(name:
|
53
|
+
category.update!(name: "foo")
|
54
54
|
mock.verify
|
55
55
|
|
56
56
|
mock.expect(:call, 3, [category.id])
|
57
|
-
assert_equal 2, Thermos.drink(key:
|
57
|
+
assert_equal 2, Thermos.drink(key: "key", id: category.id)
|
58
58
|
assert_raises(MockExpectationError) { mock.verify }
|
59
59
|
end
|
60
60
|
|
61
|
-
test
|
61
|
+
test "does not rebuild the cache on rolled back primary model change" do
|
62
62
|
mock = Minitest::Mock.new
|
63
63
|
category = categories(:baseball)
|
64
64
|
|
65
|
-
Thermos.fill(key:
|
65
|
+
Thermos.fill(key: "key", model: Category) { |id| mock.call(id) }
|
66
66
|
|
67
67
|
mock.expect(:call, 1, [category.id])
|
68
|
-
assert_equal 1, Thermos.drink(key:
|
68
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
69
69
|
mock.verify
|
70
70
|
|
71
71
|
mock.expect(:call, 2, [category.id])
|
72
72
|
ActiveRecord::Base.transaction do
|
73
|
-
category.update!(name:
|
73
|
+
category.update!(name: "foo")
|
74
74
|
raise ActiveRecord::Rollback
|
75
75
|
end
|
76
76
|
assert_raises(MockExpectationError) { mock.verify }
|
77
77
|
|
78
78
|
mock.expect(:call, 3, [category.id])
|
79
|
-
assert_equal 1, Thermos.drink(key:
|
79
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
80
80
|
assert_raises(MockExpectationError) { mock.verify }
|
81
81
|
end
|
82
82
|
|
83
|
-
test
|
83
|
+
test "does not rebuild the cache for an unrelated primary model change" do
|
84
84
|
mock = Minitest::Mock.new
|
85
85
|
category = categories(:baseball)
|
86
|
-
other_category = Category.create!(name:
|
86
|
+
other_category = Category.create!(name: "bar")
|
87
87
|
|
88
|
-
Thermos.fill(key:
|
88
|
+
Thermos.fill(key: "key", model: Category) { |id| mock.call(id) }
|
89
89
|
|
90
90
|
mock.expect(:call, 2, [other_category.id])
|
91
|
-
assert_equal 2, Thermos.drink(key:
|
91
|
+
assert_equal 2, Thermos.drink(key: "key", id: other_category.id)
|
92
92
|
mock.verify
|
93
93
|
|
94
94
|
mock.expect(:call, 1, [category.id])
|
95
|
-
category.update!(name:
|
95
|
+
category.update!(name: "foo")
|
96
96
|
mock.verify
|
97
97
|
|
98
98
|
mock.expect(:call, 3, [other_category.id])
|
99
|
-
assert_equal 2, Thermos.drink(key:
|
99
|
+
assert_equal 2, Thermos.drink(key: "key", id: other_category.id)
|
100
100
|
assert_raises(MockExpectationError) { mock.verify }
|
101
101
|
end
|
102
102
|
|
103
|
-
test
|
103
|
+
test "does not rebuild the cache on primary model destroy" do
|
104
104
|
mock = Minitest::Mock.new
|
105
105
|
category = categories(:baseball)
|
106
106
|
|
107
|
-
Thermos.fill(key:
|
107
|
+
Thermos.fill(key: "key", model: Category) { |id| mock.call(id) }
|
108
108
|
|
109
109
|
mock.expect(:call, 1, [category.id])
|
110
|
-
assert_equal 1, Thermos.drink(key:
|
110
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.id)
|
111
111
|
mock.verify
|
112
112
|
|
113
113
|
mock.expect(:call, 2, [category.id])
|
@@ -115,19 +115,19 @@ class ThermosTest < ActiveSupport::TestCase
|
|
115
115
|
assert_raises(MockExpectationError) { mock.verify }
|
116
116
|
end
|
117
117
|
|
118
|
-
test
|
118
|
+
test "pre-builds cache for new primary model records" do
|
119
119
|
mock = Minitest::Mock.new
|
120
120
|
|
121
|
-
Thermos.fill(key:
|
121
|
+
Thermos.fill(key: "key", model: Category, lookup_key: "name") do |name|
|
122
122
|
mock.call(name)
|
123
123
|
end
|
124
124
|
|
125
|
-
mock.expect(:call, 1, [
|
126
|
-
Category.create!(name:
|
125
|
+
mock.expect(:call, 1, ["foo"])
|
126
|
+
Category.create!(name: "foo")
|
127
127
|
mock.verify
|
128
128
|
|
129
|
-
mock.expect(:call, 2, [
|
130
|
-
assert_equal 1, Thermos.drink(key:
|
129
|
+
mock.expect(:call, 2, ["foo"])
|
130
|
+
assert_equal 1, Thermos.drink(key: "key", id: "foo")
|
131
131
|
assert_raises(MockExpectationError) { mock.verify }
|
132
132
|
end
|
133
133
|
|
@@ -135,20 +135,20 @@ class ThermosTest < ActiveSupport::TestCase
|
|
135
135
|
mock = Minitest::Mock.new
|
136
136
|
category = categories(:baseball)
|
137
137
|
|
138
|
-
Thermos.fill(key:
|
138
|
+
Thermos.fill(key: "key", model: Category, lookup_key: :name) do |id|
|
139
139
|
mock.call(id)
|
140
140
|
end
|
141
141
|
|
142
142
|
mock.expect(:call, 1, [category.name])
|
143
|
-
assert_equal 1, Thermos.drink(key:
|
143
|
+
assert_equal 1, Thermos.drink(key: "key", id: category.name)
|
144
144
|
mock.verify
|
145
145
|
|
146
|
-
mock.expect(:call, 2, [
|
147
|
-
category.update!(name:
|
146
|
+
mock.expect(:call, 2, ["foo"])
|
147
|
+
category.update!(name: "foo")
|
148
148
|
mock.verify
|
149
149
|
|
150
150
|
mock.expect(:call, 3, [category.name])
|
151
|
-
assert_equal 2, Thermos.drink(key:
|
151
|
+
assert_equal 2, Thermos.drink(key: "key", id: category.name)
|
152
152
|
assert_raises(MockExpectationError) { mock.verify }
|
153
153
|
end
|
154
154
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thermos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Thal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.0.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 7.1.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 6.0.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 7.1.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rake
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: psych
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "<"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 4.0.0
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 4.0.0
|
75
89
|
description: |
|
76
90
|
Thermos is a library for caching in rails that re-warms caches
|
77
91
|
in the background based on model changes.
|
@@ -156,71 +170,71 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
170
|
requirements:
|
157
171
|
- - ">="
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
173
|
+
version: 2.7.0
|
160
174
|
- - "<"
|
161
175
|
- !ruby/object:Gem::Version
|
162
|
-
version: 2.
|
176
|
+
version: 3.2.0
|
163
177
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
178
|
requirements:
|
165
179
|
- - ">="
|
166
180
|
- !ruby/object:Gem::Version
|
167
181
|
version: '0'
|
168
182
|
requirements: []
|
169
|
-
rubygems_version: 3.
|
183
|
+
rubygems_version: 3.1.6
|
170
184
|
signing_key:
|
171
185
|
specification_version: 4
|
172
186
|
summary: Always-warm, auto-rebuilding rails caching without timers or touching.
|
173
187
|
test_files:
|
174
|
-
- test/
|
175
|
-
- test/thermos_test.rb
|
188
|
+
- test/test_helper.rb
|
176
189
|
- test/dependencies_test.rb
|
177
|
-
- test/
|
178
|
-
- test/
|
179
|
-
- test/
|
180
|
-
- test/
|
181
|
-
- test/
|
182
|
-
- test/
|
190
|
+
- test/thermos_test.rb
|
191
|
+
- test/queue_test.rb
|
192
|
+
- test/fixtures/stores.yml
|
193
|
+
- test/fixtures/categories.yml
|
194
|
+
- test/fixtures/products.yml
|
195
|
+
- test/fixtures/category_items.yml
|
196
|
+
- test/dummy/db/schema.rb
|
197
|
+
- test/dummy/db/migrate/20160325214744_create_categories.rb
|
198
|
+
- test/dummy/db/migrate/20160326174530_create_stores.rb
|
199
|
+
- test/dummy/db/migrate/20160325214849_create_products.rb
|
200
|
+
- test/dummy/db/migrate/20160325220006_create_category_items.rb
|
183
201
|
- test/dummy/config/database.yml
|
184
|
-
- test/dummy/config/secrets.yml
|
185
|
-
- test/dummy/config/environment.rb
|
186
|
-
- test/dummy/config/routes.rb
|
187
|
-
- test/dummy/config/locales/en.yml
|
188
|
-
- test/dummy/config/environments/development.rb
|
189
|
-
- test/dummy/config/environments/test.rb
|
190
|
-
- test/dummy/config/environments/production.rb
|
191
|
-
- test/dummy/config/boot.rb
|
192
|
-
- test/dummy/config/initializers/assets.rb
|
193
202
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
203
|
+
- test/dummy/config/initializers/assets.rb
|
204
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
205
|
+
- test/dummy/config/initializers/mime_types.rb
|
194
206
|
- test/dummy/config/initializers/inflections.rb
|
195
207
|
- test/dummy/config/initializers/session_store.rb
|
196
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
197
208
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
198
|
-
- test/dummy/config/initializers/
|
199
|
-
- test/dummy/config/
|
200
|
-
- test/dummy/
|
201
|
-
- test/dummy/
|
202
|
-
- test/dummy/
|
203
|
-
- test/dummy/
|
204
|
-
- test/dummy/
|
205
|
-
- test/dummy/
|
206
|
-
- test/dummy/
|
207
|
-
- test/dummy/
|
208
|
-
- test/dummy/
|
209
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
210
|
+
- test/dummy/config/environment.rb
|
211
|
+
- test/dummy/config/locales/en.yml
|
212
|
+
- test/dummy/config/boot.rb
|
213
|
+
- test/dummy/config/environments/test.rb
|
214
|
+
- test/dummy/config/environments/production.rb
|
215
|
+
- test/dummy/config/environments/development.rb
|
216
|
+
- test/dummy/config/application.rb
|
217
|
+
- test/dummy/config/secrets.yml
|
218
|
+
- test/dummy/config/routes.rb
|
219
|
+
- test/dummy/README.rdoc
|
220
|
+
- test/dummy/config.ru
|
221
|
+
- test/dummy/app/helpers/application_helper.rb
|
222
|
+
- test/dummy/app/controllers/application_controller.rb
|
223
|
+
- test/dummy/app/models/product.rb
|
209
224
|
- test/dummy/app/models/category_item.rb
|
210
225
|
- test/dummy/app/models/store.rb
|
211
226
|
- test/dummy/app/models/category.rb
|
212
|
-
- test/dummy/app/
|
213
|
-
- test/dummy/app/
|
214
|
-
- test/dummy/app/
|
227
|
+
- test/dummy/app/views/layouts/application.html.erb
|
228
|
+
- test/dummy/app/assets/stylesheets/application.css
|
229
|
+
- test/dummy/app/assets/javascripts/application.js
|
230
|
+
- test/dummy/app/assets/config/manifest.js
|
215
231
|
- test/dummy/Rakefile
|
216
|
-
- test/dummy/
|
217
|
-
- test/dummy/
|
232
|
+
- test/dummy/public/500.html
|
233
|
+
- test/dummy/public/404.html
|
234
|
+
- test/dummy/public/favicon.ico
|
235
|
+
- test/dummy/public/422.html
|
218
236
|
- test/dummy/bin/rails
|
219
237
|
- test/dummy/bin/rake
|
220
|
-
- test/dummy/
|
221
|
-
- test/
|
222
|
-
- test/
|
223
|
-
- test/fixtures/products.yml
|
224
|
-
- test/fixtures/category_items.yml
|
225
|
-
- test/fixtures/stores.yml
|
226
|
-
- test/queue_test.rb
|
238
|
+
- test/dummy/bin/setup
|
239
|
+
- test/dummy/bin/bundle
|
240
|
+
- test/filter_test.rb
|