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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16c4aae2148689e108dfcddc8ba1a82c5374b72f2c683a8e304e300ec66de6b6
4
- data.tar.gz: ffafed6be7bb7f58c4efc5e465f49bcb99ee1800ec3ab8421bc474562850cd17
3
+ metadata.gz: b9127ce0b56c2dbfd7336589c2ec2e26b3ca2997bc1aa4e0099ad4396e4dc713
4
+ data.tar.gz: 28b202ac6d5faec27df4a096711758c7e9d39ba98c15b0915cad3e6e138c37b1
5
5
  SHA512:
6
- metadata.gz: 8af83ad6abebf7112dc329d77555260ff188edb5dd9fe8de11f858f4dfcd9a8bcee22d656d12e820f713e35ab18506a99f99d6f2a0c1210a7c880bbf8924afc5
7
- data.tar.gz: d699ac309400e21efded32a189a08bd85cbbab8c3b37c9ed7958056c7696dbfb892668efe901675a179c927e3233bbf7e7c4624e58f776e33a3ea081d4e3a5a5
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
- - [ ] Clear cache
46
- - [ ] Expire cache
46
+ - [ ] Block check in contoller
47
+ - [ ] Block check in config
@@ -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
- cache_by_headers = ApiResponseCache.configuration.cache_by_headers
49
- headers = @request.headers.select{ |key, value| cache_by_headers.include?(key) }
50
- headers_cache_path = headers.to_json
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
 
@@ -1,3 +1,3 @@
1
1
  module ApiResponseCache
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
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.1
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-06-12 00:00:00.000000000 Z
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: '2'
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: '2'
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