cachetastic 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -143,7 +143,7 @@ Example:
|
|
143
143
|
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_class</span>
|
144
144
|
40: <span class="ruby-identifier">n</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>
|
145
145
|
41: <span class="ruby-identifier">n</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"Class"</span>
|
146
|
-
42: <span class="ruby-
|
146
|
+
42: <span class="ruby-identifier">n</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">'::'</span>, <span class="ruby-value str">'_'</span>)
|
147
147
|
43: <span class="ruby-identifier">c_name</span> = <span class="ruby-node">"Cachetastic::Cacheable::#{n}Cache"</span>
|
148
148
|
44: <span class="ruby-keyword kw">begin</span>
|
149
149
|
45: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">c_name</span>.<span class="ruby-identifier">constantize</span>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Mon, 19 Jan 2009 16:39:02 -0500
|
data/test/cacheable_test.rb
CHANGED
@@ -17,12 +17,24 @@ class Person
|
|
17
17
|
|
18
18
|
end
|
19
19
|
|
20
|
+
module Me
|
21
|
+
class You
|
22
|
+
include Cachetastic::Cacheable
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
20
26
|
class Unknown
|
21
27
|
include Cachetastic::Cacheable
|
22
28
|
end
|
23
29
|
|
24
30
|
class CacheableTest < Test::Unit::TestCase
|
25
31
|
|
32
|
+
def test_cache_classes_work_with_modules
|
33
|
+
assert !Cachetastic::Cacheable.const_defined?("Me_YouCache")
|
34
|
+
assert Me::You.cache_class == Cachetastic::Cacheable::Me_YouCache
|
35
|
+
assert Cachetastic::Cacheable.const_defined?("Me_YouCache")
|
36
|
+
end
|
37
|
+
|
26
38
|
def test_cache_classes_are_auto_genned
|
27
39
|
assert !Cachetastic::Cacheable.const_defined?("PersonCache")
|
28
40
|
assert Person.cache_class == Cachetastic::Cacheable::PersonCache
|
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: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markbates
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-19 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|