cache_store_redis 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cache_store_redis/version.rb +1 -1
- data/lib/cache_store_redis.rb +17 -4
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7f103ea149842e7d49115c14cdcddf84961ab35
|
4
|
+
data.tar.gz: 30a2e3bb70f8a13f013d36bb975a82c16719ee9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7abfd13f8013f9a79a62e91e4df084b70bfbd72596e25bce358af0048fa5213cb2cae02f49966a28563152e8c6afda7ba920f53618cb51af36c4e8f2de2506f
|
7
|
+
data.tar.gz: f79d9d754f2bed4e790e63f02fca988e8c88df15f7920ec05ce3b28d107564df139b8783b8e4172fdf69aadab12bc767521c93e380c41c72887d9b52c88b86f3
|
data/lib/cache_store_redis.rb
CHANGED
@@ -6,17 +6,30 @@ require 'oj'
|
|
6
6
|
#This class is used for interacting with a redis based cache store.
|
7
7
|
class RedisCacheStore
|
8
8
|
|
9
|
-
def initialize(namespace = nil)
|
9
|
+
def initialize(namespace = nil, config = nil)
|
10
10
|
@namespace = namespace
|
11
|
-
|
11
|
+
if config == nil
|
12
|
+
@client = Redis.new
|
13
|
+
else
|
14
|
+
@client = Redis.new(config)
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
#This method is called to configure the connection to the cache store.
|
15
|
-
def configure(host = 'localhost', port = 6379, db = 'default', password = nil)
|
16
|
-
|
19
|
+
def configure(host = 'localhost', port = 6379, db = 'default', password = nil, driver: nil, url: nil)
|
20
|
+
if url != nil
|
21
|
+
config[:url] = url
|
22
|
+
config[:db] = db
|
23
|
+
else
|
24
|
+
config = { :host => host, :port => port, :db => db }
|
25
|
+
end
|
17
26
|
if password != nil
|
18
27
|
config[:password] = password
|
19
28
|
end
|
29
|
+
if driver != nil
|
30
|
+
config[:driver] = driver
|
31
|
+
end
|
32
|
+
|
20
33
|
@client = Redis.new(config)
|
21
34
|
end
|
22
35
|
|
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: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaughanbrittonsage
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -130,4 +130,3 @@ signing_key:
|
|
130
130
|
specification_version: 4
|
131
131
|
summary: This is the redis cache_store implementation.
|
132
132
|
test_files: []
|
133
|
-
has_rdoc:
|