cache_utils 0.2.2 → 0.2.3

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: d9a6c25fdbb65163d578dcefc7110e6785358f7d
4
- data.tar.gz: ddcac381586fcff4cf6126fd799066a3e8af2aec
3
+ metadata.gz: dc6ceea56f2b36fbfc0d166c32b2576e5d0759e3
4
+ data.tar.gz: 4a7c6e39bb3c388c520b26f38d91e3b84d355794
5
5
  SHA512:
6
- metadata.gz: 8318298669f27232bcb78297ee7403277cc1d7c268109552c323c2a99c2e5bd81d69d204c04b89e5cde438bc15e65481a18905bde99709b7e0e1212c790aabf4
7
- data.tar.gz: ea3781550309502dfc8236240577e2c36237d93a9a5d67f8df73f613f45abf400b1e2003f18d2531975cf4d58e6e27cad6ca526b12841dfb6f6d55e99b6a4eb1
6
+ metadata.gz: 2d0e20f026fd40fae62603b01c6ce278a26c59b5ca8c07e4c6e472d7d8390c178f82634c4eef4992fde6a2b253d16aa92c41cd79058d2bcc3bd09351eb88d8c9
7
+ data.tar.gz: 877cc9534be3318caa889ae22d43022df59daf0e67ed12d0a0136bd5aa3b6e0993daea3e3a5ac764fe4771e26f838ff6c71c8e86bd6741def34c138d981a6c6e
@@ -31,9 +31,11 @@ module CacheUtils
31
31
  return cached
32
32
  end
33
33
  Appsignal.increment_counter('cache_miss', 1) if defined?(Appsignal)
34
- fresh = yield
35
- $redis.set(key, fresh)
36
- fresh
34
+ if block_given?
35
+ fresh = yield
36
+ $redis.set(key, fresh)
37
+ fresh
38
+ end
37
39
  end
38
40
 
39
41
  def serialize_for_cache(object, options = {})
@@ -1,3 +1,3 @@
1
1
  module CacheUtils
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michele Finotto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-25 00:00:00.000000000 Z
11
+ date: 2017-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler