api-response-cache 0.4.0 → 0.4.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
  SHA256:
3
- metadata.gz: 42d4dc9cfef92cb3f4baaecdfa34051a6dd3b73ac2d2b3f597347e833a32e913
4
- data.tar.gz: 6ba96e207df137c01dc292efc41ce9c3faf9cc075f483dbcfb82144623c18329
3
+ metadata.gz: 16c4aae2148689e108dfcddc8ba1a82c5374b72f2c683a8e304e300ec66de6b6
4
+ data.tar.gz: ffafed6be7bb7f58c4efc5e465f49bcb99ee1800ec3ab8421bc474562850cd17
5
5
  SHA512:
6
- metadata.gz: ea83d1da2fb887f325a2c01a3ef2364818fa595cddc16a087e8812b9206d978cd33f9ef5ff01c3b79f8be9be45abb11b3f73bfe937d967478c308c7f66cfe30f
7
- data.tar.gz: 19b059aea1fb096b7d2bcd76d7d5b3642b7a00da108bcd3753e9c4261bd5ed423028944964c72013a683815ccb4728ac16058b36ff0e7691f2ab339d4c7410d6
6
+ metadata.gz: 8af83ad6abebf7112dc329d77555260ff188edb5dd9fe8de11f858f4dfcd9a8bcee22d656d12e820f713e35ab18506a99f99d6f2a0c1210a7c880bbf8924afc5
7
+ data.tar.gz: d699ac309400e21efded32a189a08bd85cbbab8c3b37c9ed7958056c7696dbfb892668efe901675a179c927e3233bbf7e7c4624e58f776e33a3ea081d4e3a5a5
@@ -9,7 +9,7 @@ module ApiResponseCache
9
9
 
10
10
  def around(controller)
11
11
  init(controller)
12
- if @request.get? && @response_cache.present? &&
12
+ if should_response_cache?
13
13
  log_info
14
14
  render_cached_response
15
15
  else
@@ -20,6 +20,10 @@ module ApiResponseCache
20
20
 
21
21
  protected
22
22
 
23
+ def should_response_cache?
24
+ @request.get? && @response_cache.present?
25
+ end
26
+
23
27
  def log_info
24
28
  processor = @processor_name.blue
25
29
  responder = Rainbow('API Response Cache').green
@@ -64,3 +68,4 @@ module ApiResponseCache
64
68
  end
65
69
  end
66
70
  end
71
+
@@ -1,3 +1,3 @@
1
1
  module ApiResponseCache
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
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.0
4
+ version: 0.4.1
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-11 00:00:00.000000000 Z
11
+ date: 2018-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow