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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44adb9e80172d8023dcf8e7b3919a3be0ff499af
4
- data.tar.gz: 08a06206541073c22a546ed0315cd4b4a54d0bc0
3
+ metadata.gz: 2e07af13388f61b41b40c25cea4be7bc7896430c
4
+ data.tar.gz: c9d05b304a9a4e48f79b38e4b9217ebabac954f0
5
5
  SHA512:
6
- metadata.gz: 5208fe912e0d3b62291ae86b544f6048a096d8a681b3dc3ce33ae3dd074ba7bfd3dc9a3fcd5c02bb2cea4485a7864f26c3dc652bac00aef06ba64696d6e5df1f
7
- data.tar.gz: d0f6454db79e4efa6bfa929698bdf93ceaa1ef5a80f65f67ac0b481380cc18c6718d36ed6346679ff4319ca3e916e98acc8aaf94f40a33b56d869f42470131b8
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
- options = { :namespace => Tml.config.cache[:namespace] || 'tml', :compress => Tml.config.cache[:compress].nil? ? true : Tml.config.cache[:compress]}
39
- @cache = Dalli::Client.new(Tml.config.cache[:host], options)
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[:host] ||= 'localhost'
42
- config[:port] ||= 6379
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
- if config[:host].index(':')
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
@@ -30,5 +30,5 @@
30
30
  #++
31
31
 
32
32
  module Tml
33
- VERSION = '4.4.3'
33
+ VERSION = '4.4.4'
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tml
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.3
4
+ version: 4.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Berkovich