tml 4.4.3 → 4.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tml/cache_adapters/memcache.rb +3 -2
- data/lib/tml/cache_adapters/redis.rb +12 -8
- data/lib/tml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e07af13388f61b41b40c25cea4be7bc7896430c
|
4
|
+
data.tar.gz: c9d05b304a9a4e48f79b38e4b9217ebabac954f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1369334f7c7f1bbfcb269f8af6e1f8325b37ce9c15d0ec2c97a5bf18b71c06011865e9a3fc777c8247c0752bd1ac534c38f87611f963afafa4493dded031d7b8
|
7
|
+
data.tar.gz: fc82f9eed90fd0ae94afea07651efd26c5ac8eee4feb017b95150b43ca0fc08d2503a324500dd78c2d3e160575a83bbc45d552bac25b25257b6e2dae3e412b0f
|
@@ -35,8 +35,9 @@ require 'dalli' if defined?(Dalli)
|
|
35
35
|
class Tml::CacheAdapters::Memcache < Tml::Cache
|
36
36
|
|
37
37
|
def initialize
|
38
|
-
|
39
|
-
|
38
|
+
config = Tml.config.cache
|
39
|
+
options = { :namespace => config[:namespace] || 'tml', :compress => config[:compress].nil? ? true : config[:compress] }
|
40
|
+
@cache = Dalli::Client.new(config[:host], options)
|
40
41
|
end
|
41
42
|
|
42
43
|
def cache_name
|
@@ -38,16 +38,20 @@ class Tml::CacheAdapters::Redis < Tml::Cache
|
|
38
38
|
def initialize
|
39
39
|
config = Tml.config.cache
|
40
40
|
|
41
|
-
config
|
42
|
-
|
41
|
+
if config.adapter_config
|
42
|
+
@cache = ::Redis.new(config.adapter_config)
|
43
|
+
else
|
44
|
+
config[:host] ||= 'localhost'
|
45
|
+
config[:port] ||= 6379
|
46
|
+
|
47
|
+
if config[:host].index(':')
|
48
|
+
parts = config[:host].split(':')
|
49
|
+
config[:host] = parts.first
|
50
|
+
config[:port] = parts.last
|
51
|
+
end
|
43
52
|
|
44
|
-
|
45
|
-
parts = config[:host].split(':')
|
46
|
-
config[:host] = parts.first
|
47
|
-
config[:port] = parts.last
|
53
|
+
@cache = ::Redis.new(config)
|
48
54
|
end
|
49
|
-
|
50
|
-
@cache = ::Redis.new(config)
|
51
55
|
end
|
52
56
|
|
53
57
|
def cache_name
|
data/lib/tml/version.rb
CHANGED