cache_store_redis 2.2.0 → 2.2.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: d0f374c4d132bae6c04d9ee020e80b1cb4096195bc3f3cc20fd99384af725742
4
- data.tar.gz: b719b7f0ace91c081c205e70ce4b92b84c590d1900aa1b816f8c7b9af8fc282b
3
+ metadata.gz: 2ac2b7e94e04f13213f7c012bab907ca6987b3c1a0399dac8a3a2743885ba43b
4
+ data.tar.gz: c621d64fe04f7c0168b86260fc33a8637780b0a68f3b396f24cbc200077a1383
5
5
  SHA512:
6
- metadata.gz: c842cde90f293a67ee5a4f20c377ea8599b182ad2d9f2b4991201d8b1b6eae7f949323fe0cdf5c6326f9d03eb36bce239ef00b0b0190c1953e35e68da79b9ddf
7
- data.tar.gz: d966f962f08cbcf76e47bae98c09f913fa30803351dd969219b27ce7f4583b8171245548d6e738e5681fe351ed9b362fe97cd67609229c8de5885920335b6649
6
+ metadata.gz: d221218738c6f3037f97725c67c4ff7c1e93b6848c1cb10c0012f75c27f1c35441588bc6d3447f8342971a4806720d6cf0faf43f8d2b0111e64e9f32c31abd12
7
+ data.tar.gz: 368af535622a69e737adebf8fe4a444657de30b444156a523719843e73d8459d5a64adb1f976a1883bd162b61f72fb3a4648458f4e711919e4083db9a66c1f47
@@ -15,14 +15,12 @@ class RedisCacheStore
15
15
  @enable_stats = false
16
16
  end
17
17
 
18
- def connection_pool
19
- @connection_pool
20
- end
18
+ attr_reader :connection_pool
21
19
 
22
20
  # This method is called to configure the connection to the cache store.
23
21
  def configure(host = 'localhost',
24
22
  port = 6379,
25
- db = 'default',
23
+ db = 0,
26
24
  password = nil,
27
25
  driver: nil,
28
26
  url: nil,
@@ -49,12 +47,10 @@ class RedisCacheStore
49
47
  def clean
50
48
  connection_pool.shutdown
51
49
  end
52
- alias_method :shutdown, :clean
50
+ alias shutdown clean
53
51
 
54
- def with_client
55
- connection_pool.with_connection do |connection|
56
- yield connection
57
- end
52
+ def with_client(&block)
53
+ connection_pool.with_connection(&block)
58
54
  end
59
55
 
60
56
  # This method is called to set a value within this cache store by it's key.
@@ -66,10 +62,10 @@ class RedisCacheStore
66
62
  k = build_key(key)
67
63
 
68
64
  v = if value.nil? || (value.is_a?(String) && value.strip.empty?)
69
- nil
70
- else
71
- serialize(value)
72
- end
65
+ nil
66
+ else
67
+ serialize(value)
68
+ end
73
69
 
74
70
  expiry_int = Integer(expires_in)
75
71
  expire_value = expiry_int.positive? ? expiry_int : Integer(DEFAULT_TTL)
@@ -91,7 +87,7 @@ class RedisCacheStore
91
87
  # @param &block [Block] This block is provided to hydrate this cache store with the value for the request key
92
88
  # when it is not found.
93
89
  # @return [Object] The value for the specified unique key within the cache store.
94
- def get(key, expires_in = 0, &block)
90
+ def get(key, expires_in = 0)
95
91
  k = build_key(key)
96
92
 
97
93
  value = with_client do |client|
@@ -1,3 +1,3 @@
1
1
  module CacheStoreRedis
2
- VERSION = '2.2.0'
2
+ VERSION = '2.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_store_redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaughanbrittonsage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-24 00:00:00.000000000 Z
11
+ date: 2023-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  requirements: []
159
- rubygems_version: 3.1.2
159
+ rubygems_version: 3.3.5
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: This is the redis cache_store implementation.