grape-app 0.8.2 → 0.8.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2653ff42bb7e4d7527dc37ee765b60771421264fed7f642da7d5e780dd320867
4
- data.tar.gz: 9b97f22526ad5c62d2c0ac80fd992befa2d6047714c11136f693ed64166c71e4
3
+ metadata.gz: 3327dc14503a28d7ea05a7c3f01f4350b4686ea180c3fd7a5daee5d44d5cdff4
4
+ data.tar.gz: 5eeb48e23593ea6d26aa37e0ae7b590cc7ccaa2c3a1c5c70302247c1a4f0eb97
5
5
  SHA512:
6
- metadata.gz: a053a2c7fb948f990c0f8e4a796d7a60e9225a190bbaa6ff9a04f87dd7eb2c23f6f182ca103bea31064de9dc29efb16cea2b013096d83ee0bed8e11161796a62
7
- data.tar.gz: c20d7146f3a8a4aa34ee74449db4b6991215558e78cc9347be3cd4d9cfdb34a517905c17685340ac7a53abe4f8ad6b27376b16f9ca911da7e55b72e089192ae3
6
+ metadata.gz: f13cf9a87bd44430d26f2ac32ca0f2d552d71fd87c20382a009ca19ee0e3c9a2678806096faf016761b03fdb7c5e6ca8259bb2ae07dffd9e5162081026a560d0
7
+ data.tar.gz: bd165a05e7d5a6a3603c22e25966d56d4bb4992f92ce4232c6008ec68d3404efd249d55e2dc5c9cae2d5c09dd246e42ba05f510c46056acfcfcf707cbbeae3f7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape-app (0.8.2)
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.4)
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.0)
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.76.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.1)
104
+ zeitwerk (2.2.2)
105
105
 
106
106
  PLATFORMS
107
107
  ruby
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'grape-app'
3
- s.version = '0.8.2'
3
+ s.version = '0.8.3'
4
4
  s.authors = ['Black Square Media Ltd']
5
5
  s.email = ['info@blacksquaremedia.com']
6
6
  s.summary = %(Standalone Grape API apps)
@@ -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)
@@ -39,7 +39,8 @@ class TestAPI < Grape::API::Instance
39
39
 
40
40
  get '/articles' do
41
41
  scope = Article.all
42
- fresh_when(scope, public: true)
42
+ opts = params[:public] ? { public: params[:public] } : {}
43
+ fresh_when(scope, **opts)
43
44
  scope.map(&:to_hash)
44
45
  end
45
46
 
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.2
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-20 00:00:00.000000000 Z
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.3
287
+ rubygems_version: 3.0.6
288
288
  signing_key:
289
289
  specification_version: 4
290
290
  summary: Standalone Grape API apps