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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cachetastic (3.5.1)
4
+ cachetastic (3.5.2)
5
5
  activesupport
6
6
  configatron
7
7
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Cachetastic
2
- VERSION = "3.5.2"
2
+ VERSION = "3.5.3"
3
3
  end
@@ -1,7 +1,4 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
-
3
- class CarCache < Cachetastic::Cache
4
- end
1
+ require 'spec_helper'
5
2
 
6
3
  describe Cachetastic::Adapters do
7
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  class AnimalCache < Cachetastic::Cache
4
4
  end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Cachetastic::Adapters::LocalMemory do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Cachetastic::Adapters::Memcached do
4
4
 
@@ -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
@@ -17,5 +17,8 @@ RSpec.configure do |config|
17
17
 
18
18
  end
19
19
 
20
+ class CarCache < Cachetastic::Cache
21
+ end
22
+
20
23
  class Cachetastic::BlockError < StandardError
21
24
  end
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.2
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