mcmire-cache 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cache.rb CHANGED
@@ -50,14 +50,15 @@ class Cache
50
50
  def initialize(metal)
51
51
  @pid = ::Process.pid
52
52
  @config = Config.new
53
- if metal == :nothing
54
- @metal = nil
55
- client_class = 'Nothing'
56
- driver_class = 'Nothing'
57
- else
53
+ if metal != :nothing
58
54
  @metal = Cache === metal ? metal.metal : metal
55
+ end
56
+ if @metal
59
57
  client_class = @metal.class.to_s
60
58
  driver_class = client_class.gsub('::', '')
59
+ else
60
+ client_class = 'Nothing'
61
+ driver_class = 'Nothing'
61
62
  end
62
63
  filename = client_class.
63
64
  gsub(/([a-z])([A-Z]+)/) { [$1.downcase, $2.downcase].join('_') }.
data/lib/cache/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Cache
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
data/test/test_nothing.rb CHANGED
@@ -6,6 +6,10 @@ class TestNothing < TestCase
6
6
  :nothing
7
7
  end
8
8
 
9
+ def test_wrapped
10
+ assert_nothing_raised { Cache.new(Cache.new(:nothing)) }
11
+ end
12
+
9
13
  def test_get
10
14
  assert_equal nil, cache.get('hello')
11
15
  cache.set 'hello', 'world'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcmire-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-08-22 00:00:00.000000000 Z
14
+ date: 2012-11-16 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: Wraps memcached, redis(-namespace), memcache-client, dalli and handles
17
17
  their weirdnesses, including forking