grape-rails-cache 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ed6145ae0b11da1d0d35a9611c67572a3ebd2c6
4
- data.tar.gz: c9e5405e3375107967457509aa4051a17363311b
3
+ metadata.gz: 2cf9010721ffbc4bba100223ecf6680073ac2336
4
+ data.tar.gz: 898a459110b5521b9829be56e56e5a4f7c9dae18
5
5
  SHA512:
6
- metadata.gz: 37d20990ba391b0c4b7e628f673da0c89285362bc66711366934324948a908ba4968828d3bbd09b631fc31fd5e2157367b1f474f6d0469de4167fdcaa1636bf5
7
- data.tar.gz: 35457c02458efced04c9aae8b29887b64c76f0096c72a859aecfcbf40f7af594729a71c600b091f6814c00612a15c05328b2633eaef291c24238ae450b2e3a9b
6
+ metadata.gz: ebef843153d47923866360da8b416b1dff79421d265b29e300fdd836a6aee28ace85447ef31a45ced8dff058256aae3c179db6200cab3036d2a1b4111192be20
7
+ data.tar.gz: bb976a2490ff7e435a601175bfa1557427263076474cb6550784b29add88671a5c2ad319e61892bcb286c4e4d6817e3c428dae522efe1abb1632c5b8a7eb8e52
@@ -1,22 +1,20 @@
1
- Copyright (c) 2013 Monterail.com
1
+ The MIT License (MIT)
2
2
 
3
- MIT License
3
+ Copyright (c) 2013-2014 Monterail.com LLC
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
15
14
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -43,14 +43,14 @@ module Grape
43
43
  # HTTP Cache
44
44
  cache_key = opts[:key]
45
45
 
46
+ # Set Cache-Control
47
+ expires_in(opts[:expires_in] || default_expire_time, public: true)
48
+
46
49
  if opts[:etag]
47
50
  cache_key += ActiveSupport::Cache.expand_cache_key(opts[:etag])
48
51
  compare_etag(opts[:etag]) # Check if client has fresh version
49
52
  end
50
53
 
51
- # Set Cache-Control
52
- expires_in(opts[:expires_in] || default_expire_time, public: true)
53
-
54
54
  # Try to fetch from server side cache
55
55
  ::Rails.cache.fetch(cache_key, raw: true, expires_in: opts[:expires_in]) do
56
56
  block.call.to_json
@@ -1,7 +1,7 @@
1
1
  module Grape
2
2
  module Rails
3
3
  module Cache
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-rails-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tymon Tobolski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-02 00:00:00.000000000 Z
11
+ date: 2014-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape
@@ -103,9 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.1.3
106
+ rubygems_version: 2.1.11
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: HTTP and server side cache integration for Grape and Rails
110
110
  test_files: []
111
- has_rdoc: