catch_cache 0.0.3 → 0.0.4

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: aeae0742dd77cb93265bcae77e32f4d06154ab8e
4
- data.tar.gz: 07f73a137ef2cc8e22a55a592433de21a83cc5f1
3
+ metadata.gz: f429e2d8e44cc52686cc770cc9c77e2f2d177555
4
+ data.tar.gz: d6991666b892385092998cd57b9df36f094aaa56
5
5
  SHA512:
6
- metadata.gz: 67d510501ed20347dedb766b581ffc94313a0c70dd723891b27121598c2f5afa16607e273e3a4d097c55f7f889076d04531b1c3d17d009e2327a7ec97094380c
7
- data.tar.gz: c22cf4f5ce38cd65f555195f8a12993897f2a299f7756ccd0b25f54927e9e2e54785c4bbe12f40bc843e0905ac1f4ffd380ed15e6c6232e0add916070b0e14a7
6
+ metadata.gz: c9fc6fa5f4e6b6dadf079e991114d3d57dcb9e8e39fa0863102da6e09432c3005b8832db783c70de5b75e4018abd64e7185fe71722d9339e6302649e6468e4f4
7
+ data.tar.gz: d5b7c095a51dff602d1a4b4e972885e095501e453cd4e022c7cd9684f77b71f1a5f7979029f8446f0b8b4926e546deb38b872a352427d406fc78dabde5ec76b0
@@ -1,3 +1,7 @@
1
+ # 0.0.4
2
+
3
+ - Fix catching of errors in `#flush_cache!`
4
+
1
5
  # 0.0.3
2
6
 
3
7
  - `catch_then_cache` method must be available as an instance method as well
@@ -9,18 +9,18 @@ module CatchCache
9
9
  define_method(:flush_cache!) do
10
10
  key_callbacks = ClassMethods.key_callbacks
11
11
 
12
- begin
13
- key_callbacks.keys.each do |key|
14
- # Get the uniq id defined in the AR model
12
+ key_callbacks.keys.each do |key|
13
+ # Get the uniq id defined in the AR model
14
+ begin
15
15
  uniq_id = instance_exec(&key_callbacks[key])
16
16
  # Build the redis cache key
17
17
  cache_key = "#{key.to_s}_#{uniq_id}"
18
18
  redis = Redis.new
19
19
  # Flush the key by setting it to nil
20
20
  redis.set(cache_key, nil)
21
+ rescue NameError => e
22
+ # Nothing was flushed because of an error"
21
23
  end
22
- rescue NameError => e
23
- # Nothing was flushed because of an error"
24
24
  end
25
25
  end
26
26
 
@@ -1,3 +1,3 @@
1
1
  module CatchCache
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catch_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Marion dela Cruz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-12 00:00:00.000000000 Z
11
+ date: 2017-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis