grape-app 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/grape-app.gemspec +1 -1
- data/lib/grape/app/helpers/caching.rb +1 -1
- data/spec/grape/app/helpers/caching_spec.rb +8 -1
- data/spec/spec_helper.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3327dc14503a28d7ea05a7c3f01f4350b4686ea180c3fd7a5daee5d44d5cdff4
|
4
|
+
data.tar.gz: 5eeb48e23593ea6d26aa37e0ae7b590cc7ccaa2c3a1c5c70302247c1a4f0eb97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f13cf9a87bd44430d26f2ac32ca0f2d552d71fd87c20382a009ca19ee0e3c9a2678806096faf016761b03fdb7c5e6ca8259bb2ae07dffd9e5162081026a560d0
|
7
|
+
data.tar.gz: bd165a05e7d5a6a3603c22e25966d56d4bb4992f92ce4232c6008ec68d3404efd249d55e2dc5c9cae2d5c09dd246e42ba05f510c46056acfcfcf707cbbeae3f7
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
grape-app (0.8.
|
4
|
+
grape-app (0.8.3)
|
5
5
|
activesupport
|
6
6
|
grape (>= 1.2)
|
7
7
|
grape-entity
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
thread_safe (~> 0.3, >= 0.3.1)
|
38
38
|
diff-lcs (1.3)
|
39
39
|
equalizer (0.0.11)
|
40
|
-
grape (1.2.
|
40
|
+
grape (1.2.5)
|
41
41
|
activesupport
|
42
42
|
builder
|
43
43
|
mustermann-grape (~> 1.0.0)
|
@@ -56,7 +56,7 @@ GEM
|
|
56
56
|
mustermann (1.0.3)
|
57
57
|
mustermann-grape (1.0.0)
|
58
58
|
mustermann (~> 1.0.0)
|
59
|
-
parallel (1.19.
|
59
|
+
parallel (1.19.1)
|
60
60
|
parser (2.6.5.0)
|
61
61
|
ast (~> 2.4.0)
|
62
62
|
rack (2.0.7)
|
@@ -82,7 +82,7 @@ GEM
|
|
82
82
|
diff-lcs (>= 1.2.0, < 2.0)
|
83
83
|
rspec-support (~> 3.9.0)
|
84
84
|
rspec-support (3.9.0)
|
85
|
-
rubocop (0.
|
85
|
+
rubocop (0.77.0)
|
86
86
|
jaro_winkler (~> 1.5.1)
|
87
87
|
parallel (~> 1.10)
|
88
88
|
parser (>= 2.6)
|
@@ -101,7 +101,7 @@ GEM
|
|
101
101
|
coercible (~> 1.0)
|
102
102
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
103
103
|
equalizer (~> 0.0, >= 0.0.9)
|
104
|
-
zeitwerk (2.2.
|
104
|
+
zeitwerk (2.2.2)
|
105
105
|
|
106
106
|
PLATFORMS
|
107
107
|
ruby
|
data/grape-app.gemspec
CHANGED
@@ -24,7 +24,7 @@ module Grape::App::Helpers::Caching
|
|
24
24
|
etag = ActiveSupport::Digest.hexdigest(ActiveSupport::Cache.expand_cache_key(etag))
|
25
25
|
header 'ETag', etag
|
26
26
|
header 'Last-Modified', last_modified.httpdate if last_modified
|
27
|
-
cache_control(cache_control)
|
27
|
+
cache_control(cache_control) unless cache_control.empty?
|
28
28
|
|
29
29
|
if_modified_since = headers['If-Modified-Since']
|
30
30
|
if_modified_since = Time.rfc2822(if_modified_since) rescue nil if if_modified_since # rubocop:disable Style/RescueModifier
|
@@ -9,7 +9,6 @@ RSpec.describe Grape::App::Helpers::Caching do
|
|
9
9
|
get '/articles'
|
10
10
|
expect(last_response.status).to eq(200)
|
11
11
|
expect(last_response.headers).to include(
|
12
|
-
'Cache-Control' => 'public',
|
13
12
|
'Content-Type' => 'application/json',
|
14
13
|
'ETag' => '975ca8804565c1a569450d61090b2743',
|
15
14
|
'Last-Modified' => 'Fri, 05 Jan 2018 11:25:20 GMT',
|
@@ -31,6 +30,14 @@ RSpec.describe Grape::App::Helpers::Caching do
|
|
31
30
|
expect(last_response.status).to eq(200)
|
32
31
|
end
|
33
32
|
|
33
|
+
it 'should support cache-control' do
|
34
|
+
get '/articles?public=true'
|
35
|
+
expect(last_response.status).to eq(200)
|
36
|
+
expect(last_response.headers).to include(
|
37
|
+
'Cache-Control' => 'public',
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
34
41
|
it 'should handle stale? (with cache-control)' do
|
35
42
|
get '/articles/1'
|
36
43
|
expect(last_response.status).to eq(200)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Black Square Media Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -284,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
284
284
|
- !ruby/object:Gem::Version
|
285
285
|
version: '0'
|
286
286
|
requirements: []
|
287
|
-
rubygems_version: 3.0.
|
287
|
+
rubygems_version: 3.0.6
|
288
288
|
signing_key:
|
289
289
|
specification_version: 4
|
290
290
|
summary: Standalone Grape API apps
|