garner 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/CHANGELOG.md +5 -0
- data/garner.gemspec +1 -1
- data/lib/garner/cache/identity.rb +2 -2
- data/lib/garner/version.rb +1 -1
- data/spec/garner/cache/identity_spec.rb +28 -6
- data/spec/garner/mixins/mongoid/identity_spec.rb +1 -1
- data/spec/integration/grape_spec.rb +1 -1
- metadata +46 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1fbbbf014d857014cf5f5246f56a076bacf9407
|
4
|
+
data.tar.gz: 18847c6a2f1b1d2d3e7b6c88cd02d262fb50109e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5e69065db013363358312b05741d77fc039dd5a0ad71793d88c06b7d406ad7b11e5504d33e2a57d4e13458aedfc2e098745d7b4478968591c74e2b98805baca
|
7
|
+
data.tar.gz: 3a20dcee04da2ac8c8a8eb8b43025152b2e77f37d5424e98173d2c7871359d01bee1a58b619321ed91c5294be0eb23781af09dece95f7add9dbe0d51b21dfe99
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/garner.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_development_dependency 'rake'
|
26
26
|
s.add_development_dependency 'rspec', '~> 3.1'
|
27
27
|
s.add_development_dependency 'bundler'
|
28
|
-
s.add_development_dependency 'grape', '~> 0.
|
28
|
+
s.add_development_dependency 'grape', '~> 0.16.2'
|
29
29
|
s.add_development_dependency 'sinatra'
|
30
30
|
s.add_development_dependency 'rack-test'
|
31
31
|
s.add_development_dependency 'mongoid', '>= 3.0.0'
|
@@ -11,8 +11,8 @@ module Garner
|
|
11
11
|
@key_hash = {}
|
12
12
|
|
13
13
|
# Set up options hash with defaults
|
14
|
-
@options_hash = Garner.config.global_cache_options || {}
|
15
|
-
@options_hash
|
14
|
+
@options_hash = Garner.config.global_cache_options.dup || {}
|
15
|
+
@options_hash[:expires_in] ||= Garner.config.expires_in
|
16
16
|
end
|
17
17
|
|
18
18
|
def fetch(&block)
|
data/lib/garner/version.rb
CHANGED
@@ -1,14 +1,36 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Garner::Cache::Identity do
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
context 'with global_cache_options defined' do
|
5
|
+
before do
|
6
|
+
Garner.configure { |config| config.global_cache_options = { foo: 'bar' } }
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'includes Garner.config.global_cache_options' do
|
10
|
+
expect(subject.options_hash[:foo]).to eq 'bar'
|
11
|
+
end
|
7
12
|
end
|
8
13
|
|
9
|
-
|
10
|
-
|
11
|
-
|
14
|
+
context 'with global_cache_options[:expires_in] defined ' do
|
15
|
+
before do
|
16
|
+
Garner.configure do |config|
|
17
|
+
config.global_cache_options = { expires_in: 5.minutes }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'includes Garner.config.global_cache_options[:expires_in]' do
|
22
|
+
expect(subject.options_hash[:expires_in]).to eq 5.minutes
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'with config.expires_in defined' do
|
27
|
+
before do
|
28
|
+
Garner.configure { |config| config.expires_in = 5.minutes }
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'includes Garner.config.expires_in' do
|
32
|
+
expect(subject.options_hash[:expires_in]).to eq 5.minutes
|
33
|
+
end
|
12
34
|
end
|
13
35
|
|
14
36
|
describe 'nocache' do
|
@@ -48,7 +48,7 @@ describe Garner::Mixins::Mongoid::Identity do
|
|
48
48
|
it 'sets klass to parent and includes the _type field' do
|
49
49
|
identity = subject.from_class_and_handle(Cheese, 'id')
|
50
50
|
expect(identity.klass).to eq Cheese
|
51
|
-
expect(identity.conditions[:_type]).to eq('
|
51
|
+
expect(identity.conditions[:_type]).to eq('Cheese')
|
52
52
|
expect(identity.conditions['$or']).to eq [
|
53
53
|
{ _id: 'id' },
|
54
54
|
{ _slugs: 'id' }
|
@@ -5,7 +5,7 @@ require 'grape'
|
|
5
5
|
describe 'Grape integration', type: :request do
|
6
6
|
class TestCachebuster < Grape::Middleware::Base
|
7
7
|
def after
|
8
|
-
@app_response[
|
8
|
+
@app_response.headers['Expires'] = Time.at(0).utc.to_s
|
9
9
|
@app_response
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: garner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Doubrovkine
|
@@ -9,244 +9,244 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-06-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: json
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: multi_json
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: 1.3.0
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 1.3.0
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: activesupport
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rake
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rspec
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- - ~>
|
88
|
+
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '3.1'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - ~>
|
95
|
+
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '3.1'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: bundler
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: grape
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- - ~>
|
116
|
+
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.
|
118
|
+
version: 0.16.2
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- - ~>
|
123
|
+
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
125
|
+
version: 0.16.2
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: sinatra
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- -
|
137
|
+
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: rack-test
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- -
|
144
|
+
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
type: :development
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- -
|
151
|
+
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: mongoid
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
|
-
- -
|
158
|
+
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: 3.0.0
|
161
161
|
type: :development
|
162
162
|
prerelease: false
|
163
163
|
version_requirements: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- -
|
165
|
+
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: 3.0.0
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
169
|
name: mongoid-slug
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
|
-
- -
|
172
|
+
- - ">="
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
type: :development
|
176
176
|
prerelease: false
|
177
177
|
version_requirements: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
|
-
- -
|
179
|
+
- - ">="
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
- !ruby/object:Gem::Dependency
|
183
183
|
name: activerecord
|
184
184
|
requirement: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
|
-
- -
|
186
|
+
- - ">="
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
type: :development
|
190
190
|
prerelease: false
|
191
191
|
version_requirements: !ruby/object:Gem::Requirement
|
192
192
|
requirements:
|
193
|
-
- -
|
193
|
+
- - ">="
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: '0'
|
196
196
|
- !ruby/object:Gem::Dependency
|
197
197
|
name: sqlite3
|
198
198
|
requirement: !ruby/object:Gem::Requirement
|
199
199
|
requirements:
|
200
|
-
- -
|
200
|
+
- - ">="
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: '0'
|
203
203
|
type: :development
|
204
204
|
prerelease: false
|
205
205
|
version_requirements: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
|
-
- -
|
207
|
+
- - ">="
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
- !ruby/object:Gem::Dependency
|
211
211
|
name: coveralls
|
212
212
|
requirement: !ruby/object:Gem::Requirement
|
213
213
|
requirements:
|
214
|
-
- -
|
214
|
+
- - ">="
|
215
215
|
- !ruby/object:Gem::Version
|
216
216
|
version: '0'
|
217
217
|
type: :development
|
218
218
|
prerelease: false
|
219
219
|
version_requirements: !ruby/object:Gem::Requirement
|
220
220
|
requirements:
|
221
|
-
- -
|
221
|
+
- - ">="
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '0'
|
224
224
|
- !ruby/object:Gem::Dependency
|
225
225
|
name: yard
|
226
226
|
requirement: !ruby/object:Gem::Requirement
|
227
227
|
requirements:
|
228
|
-
- -
|
228
|
+
- - ">="
|
229
229
|
- !ruby/object:Gem::Version
|
230
230
|
version: '0'
|
231
231
|
type: :development
|
232
232
|
prerelease: false
|
233
233
|
version_requirements: !ruby/object:Gem::Requirement
|
234
234
|
requirements:
|
235
|
-
- -
|
235
|
+
- - ">="
|
236
236
|
- !ruby/object:Gem::Version
|
237
237
|
version: '0'
|
238
238
|
- !ruby/object:Gem::Dependency
|
239
239
|
name: dalli
|
240
240
|
requirement: !ruby/object:Gem::Requirement
|
241
241
|
requirements:
|
242
|
-
- -
|
242
|
+
- - ">="
|
243
243
|
- !ruby/object:Gem::Version
|
244
244
|
version: '0'
|
245
245
|
type: :development
|
246
246
|
prerelease: false
|
247
247
|
version_requirements: !ruby/object:Gem::Requirement
|
248
248
|
requirements:
|
249
|
-
- -
|
249
|
+
- - ">="
|
250
250
|
- !ruby/object:Gem::Version
|
251
251
|
version: '0'
|
252
252
|
- !ruby/object:Gem::Dependency
|
@@ -276,11 +276,11 @@ extra_rdoc_files:
|
|
276
276
|
- README.md
|
277
277
|
- UPGRADING.md
|
278
278
|
files:
|
279
|
-
- .gitignore
|
280
|
-
- .rspec
|
281
|
-
- .rubocop.yml
|
282
|
-
- .rubocop_todo.yml
|
283
|
-
- .travis.yml
|
279
|
+
- ".gitignore"
|
280
|
+
- ".rspec"
|
281
|
+
- ".rubocop.yml"
|
282
|
+
- ".rubocop_todo.yml"
|
283
|
+
- ".travis.yml"
|
284
284
|
- CHANGELOG.md
|
285
285
|
- CONTRIBUTING.md
|
286
286
|
- Gemfile
|
@@ -361,17 +361,17 @@ require_paths:
|
|
361
361
|
- lib
|
362
362
|
required_ruby_version: !ruby/object:Gem::Requirement
|
363
363
|
requirements:
|
364
|
-
- -
|
364
|
+
- - ">="
|
365
365
|
- !ruby/object:Gem::Version
|
366
366
|
version: '0'
|
367
367
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
368
368
|
requirements:
|
369
|
-
- -
|
369
|
+
- - ">="
|
370
370
|
- !ruby/object:Gem::Version
|
371
371
|
version: '0'
|
372
372
|
requirements: []
|
373
373
|
rubyforge_project:
|
374
|
-
rubygems_version: 2.4
|
374
|
+
rubygems_version: 2.6.4
|
375
375
|
signing_key:
|
376
376
|
specification_version: 4
|
377
377
|
summary: Garner is a cache layer for Ruby and Rack applications, supporting model
|