api-response-cache 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/api-response-cache.gemspec +1 -1
- data/lib/api_response_cache/api_cache_handler.rb +4 -3
- data/lib/api_response_cache/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9127ce0b56c2dbfd7336589c2ec2e26b3ca2997bc1aa4e0099ad4396e4dc713
|
4
|
+
data.tar.gz: 28b202ac6d5faec27df4a096711758c7e9d39ba98c15b0915cad3e6e138c37b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1d5d63d22e337b68eda2cc4996d26eddf33621df0e16c58f9e236dc9b14f98caa505764b89d0b9719bcdf18f76d90388e2dc526133c29a0a184399a0b3edad3
|
7
|
+
data.tar.gz: a2ebc0a03432439298c47fb47d1b6c56b9b6f2cbadefdab9d71ab31eb5164ce2ba8a630f64dbc7cb4f63f822d205535d28e5c35b24eba6e01533bc42a112eb5b
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ If you want to change config create file at ```config/initializers/api_response_
|
|
16
16
|
```
|
17
17
|
ApiResponseCache.configure do |config|
|
18
18
|
config.refresh_by_request_params = false # true to saperate cache by request params
|
19
|
+
config.cache_by_headers = ['header-key'] # optional this need when saperate cache with header only
|
19
20
|
end
|
20
21
|
```
|
21
22
|
|
@@ -42,5 +43,5 @@ ApiResponseCache.clear
|
|
42
43
|
|
43
44
|
|
44
45
|
## TO DO
|
45
|
-
- [ ]
|
46
|
-
- [ ]
|
46
|
+
- [ ] Block check in contoller
|
47
|
+
- [ ] Block check in config
|
data/api-response-cache.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
spec.required_ruby_version = '>= 2.1.0'
|
34
34
|
|
35
|
-
spec.add_runtime_dependency 'rainbow', '~> 2'
|
35
|
+
spec.add_runtime_dependency 'rainbow', '~> 3.0', '>= 2.2.2'
|
36
36
|
|
37
37
|
spec.add_development_dependency "bundler", "~> 1.16"
|
38
38
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -45,9 +45,10 @@ module ApiResponseCache
|
|
45
45
|
end
|
46
46
|
|
47
47
|
if ApiResponseCache.configuration.cache_by_headers.present?
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
headers = ApiResponseCache.configuration.cache_by_headers.map do |header|
|
49
|
+
@request.headers[header].to_s
|
50
|
+
end
|
51
|
+
headers_cache_path = headers.join('-')
|
51
52
|
@cache_path = "#{@cache_path}/#{headers_cache_path}"
|
52
53
|
end
|
53
54
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-response-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uysim Ty
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -16,14 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.2.2
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
29
|
+
version: '3.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.2.2
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|