cachetastic 3.5.2 → 3.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/cachetastic/adapters/redis.rb +7 -2
- data/lib/cachetastic/version.rb +1 -1
- data/spec/cachetastic/adapters/base_spec.rb +1 -4
- data/spec/cachetastic/adapters/file_spec.rb +1 -1
- data/spec/cachetastic/adapters/local_memory_spec.rb +1 -1
- data/spec/cachetastic/adapters/memcached_spec.rb +1 -1
- data/spec/cachetastic/adapters/redis_spec.rb +29 -0
- data/spec/spec_helper.rb +3 -0
- metadata +3 -1
data/Gemfile.lock
CHANGED
@@ -6,12 +6,17 @@ module Cachetastic
|
|
6
6
|
define_accessor(:redis_host)
|
7
7
|
define_accessor(:redis_options)
|
8
8
|
define_accessor(:delete_delay)
|
9
|
+
super
|
9
10
|
self.redis_host ||= "redis://localhost:6379/"
|
11
|
+
parsed_url = URI.parse(self.redis_host)
|
10
12
|
self.redis_options = ::Redis::Client::DEFAULTS.merge({
|
11
13
|
db: "cachetastic",
|
12
|
-
url: self.redis_host
|
14
|
+
url: self.redis_host,
|
15
|
+
scheme: parsed_url.scheme,
|
16
|
+
host: parsed_url.host,
|
17
|
+
port: parsed_url.port,
|
18
|
+
password: parsed_url.password
|
13
19
|
})
|
14
|
-
super(klass)
|
15
20
|
self.marshal_method = :yaml if self.marshal_method == :none
|
16
21
|
connection
|
17
22
|
end
|
data/lib/cachetastic/version.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Cachetastic::Adapters::Redis do
|
4
|
+
|
5
|
+
describe "connection" do
|
6
|
+
|
7
|
+
it "respects the configatron.defaults.redis_host option" do
|
8
|
+
configatron.temp do
|
9
|
+
configatron.cachetastic.defaults.redis_host = "redis://example.com:1234/"
|
10
|
+
::Redis.should_receive(:new).with({
|
11
|
+
url: "redis://example.com:1234/",
|
12
|
+
scheme: "redis",
|
13
|
+
host: "example.com",
|
14
|
+
port: 1234,
|
15
|
+
path: nil,
|
16
|
+
timeout: 5.0,
|
17
|
+
password: nil,
|
18
|
+
db: "cachetastic",
|
19
|
+
driver: nil,
|
20
|
+
id: nil,
|
21
|
+
tcp_keepalive: 0
|
22
|
+
})
|
23
|
+
adapter = Cachetastic::Adapters::Redis.new(CarCache)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cachetastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- spec/cachetastic/adapters/file_spec.rb
|
90
90
|
- spec/cachetastic/adapters/local_memory_spec.rb
|
91
91
|
- spec/cachetastic/adapters/memcached_spec.rb
|
92
|
+
- spec/cachetastic/adapters/redis_spec.rb
|
92
93
|
- spec/cachetastic/cache_spec.rb
|
93
94
|
- spec/cachetastic/cacheable_spec.rb
|
94
95
|
- spec/cachetastic/logger_spec.rb
|
@@ -124,6 +125,7 @@ test_files:
|
|
124
125
|
- spec/cachetastic/adapters/file_spec.rb
|
125
126
|
- spec/cachetastic/adapters/local_memory_spec.rb
|
126
127
|
- spec/cachetastic/adapters/memcached_spec.rb
|
128
|
+
- spec/cachetastic/adapters/redis_spec.rb
|
127
129
|
- spec/cachetastic/cache_spec.rb
|
128
130
|
- spec/cachetastic/cacheable_spec.rb
|
129
131
|
- spec/cachetastic/logger_spec.rb
|