simple_cacheable 1.1.5 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +9 -0
- data/README.md +1 -1
- data/cacheable.gemspec +0 -1
- data/lib/cacheable.rb +1 -0
- data/lib/cacheable/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +25 -15
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ cacheable
|
|
4
4
|
cacheable is a simple cache implementation based on activerecord, it is
|
5
5
|
extracted from [rails-bestpractices.com][1].
|
6
6
|
|
7
|
-
it supports activerecord >= 3.0.0
|
7
|
+
it supports activerecord >= 3.0.0, works on 1.9.2, 1.9.3 and jruby.
|
8
8
|
|
9
9
|
Introduction
|
10
10
|
------------
|
data/cacheable.gemspec
CHANGED
@@ -15,7 +15,6 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.add_dependency("rails", ">= 3.0.0")
|
16
16
|
s.add_development_dependency("rspec")
|
17
17
|
s.add_development_dependency("mocha")
|
18
|
-
s.add_development_dependency("sqlite3-ruby")
|
19
18
|
|
20
19
|
s.files = `git ls-files`.split("\n")
|
21
20
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/cacheable.rb
CHANGED
@@ -64,6 +64,7 @@ module Cacheable
|
|
64
64
|
association = reflect_on_association(association_name)
|
65
65
|
if :belongs_to == association.macro
|
66
66
|
polymorphic = association.options[:polymorphic]
|
67
|
+
polymorphic ||= false
|
67
68
|
class_eval <<-EOF
|
68
69
|
def cached_#{association_name}
|
69
70
|
Rails.cache.fetch belong_association_cache_key("#{association_name}", #{polymorphic}) do
|
data/lib/cacheable/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_cacheable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.0.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rspec
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: mocha
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,18 +53,12 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: sqlite3-ruby
|
49
|
-
requirement: &70220191414500 !ruby/object:Gem::Requirement
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
57
|
none: false
|
51
58
|
requirements:
|
52
59
|
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: *70220191414500
|
58
62
|
description: a simple cache implementation based on activerecord
|
59
63
|
email:
|
60
64
|
- flyerhzm@gmail.com
|
@@ -89,15 +93,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
93
|
- - ! '>='
|
90
94
|
- !ruby/object:Gem::Version
|
91
95
|
version: '0'
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
hash: -1878933439133819997
|
92
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
100
|
none: false
|
94
101
|
requirements:
|
95
102
|
- - ! '>='
|
96
103
|
- !ruby/object:Gem::Version
|
97
104
|
version: '0'
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
hash: -1878933439133819997
|
98
108
|
requirements: []
|
99
109
|
rubyforge_project:
|
100
|
-
rubygems_version: 1.8.
|
110
|
+
rubygems_version: 1.8.24
|
101
111
|
signing_key:
|
102
112
|
specification_version: 3
|
103
113
|
summary: a simple cache implementation based on activerecord
|