cachetastic 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/doc/classes/ActiveRecord/Base.html +188 -0
- data/doc/classes/CGI/Session/CachetasticStore.html +124 -0
- data/doc/classes/Cachetastic/Adapters/Base.html +331 -0
- data/doc/classes/Cachetastic/Adapters/Drb.html +332 -0
- data/doc/classes/Cachetastic/Adapters/File.html +248 -0
- data/doc/classes/Cachetastic/Adapters/FileBase.html +309 -0
- data/doc/classes/Cachetastic/Adapters/HtmlFile.html +224 -0
- data/doc/classes/Cachetastic/Adapters/LocalMemory.html +346 -0
- data/doc/classes/Cachetastic/Adapters/Memcache.html +498 -0
- data/doc/classes/Cachetastic/Cacheable.html +264 -0
- data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +287 -0
- data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +200 -0
- data/doc/classes/Cachetastic/Caches/Base.html +672 -0
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +179 -0
- data/doc/classes/Cachetastic/Caches/MackSessionCache.html +119 -0
- data/doc/classes/Cachetastic/Caches/PageCache.html +121 -0
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +154 -0
- data/doc/classes/Cachetastic/Connection.html +212 -0
- data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +146 -0
- data/doc/classes/Cachetastic/Logger.html +189 -0
- data/doc/classes/Object.html +152 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +207 -0
- data/doc/files/lib/adapters/cachetastic_adapters_base_rb.html +139 -0
- data/doc/files/lib/adapters/cachetastic_adapters_drb_rb.html +115 -0
- data/doc/files/lib/adapters/cachetastic_adapters_file_base_rb.html +109 -0
- data/doc/files/lib/adapters/cachetastic_adapters_file_rb.html +121 -0
- data/doc/files/lib/adapters/cachetastic_adapters_html_file_rb.html +137 -0
- data/doc/files/lib/adapters/cachetastic_adapters_local_memory_rb.html +109 -0
- data/doc/files/lib/adapters/cachetastic_adapters_memcache_rb.html +127 -0
- data/doc/files/lib/adapters/cachetastic_adapters_store_object_rb.html +101 -0
- data/doc/files/lib/caches/cachetastic_caches_base_rb.html +108 -0
- data/doc/files/lib/caches/cachetastic_caches_mack_session_cache_rb.html +107 -0
- data/doc/files/lib/caches/cachetastic_caches_page_cache_rb.html +109 -0
- data/doc/files/lib/caches/cachetastic_caches_rails_session_cache_rb.html +107 -0
- data/doc/files/lib/cachetastic_cacheable_rb.html +101 -0
- data/doc/files/lib/cachetastic_connection_rb.html +107 -0
- data/doc/files/lib/cachetastic_logger_rb.html +107 -0
- data/doc/files/lib/cachetastic_rb.html +222 -0
- data/doc/files/lib/errors/cachetastic_errors_unsupported_adapter_rb.html +101 -0
- data/doc/files/lib/rails_extensions/cachetastic_active_record_base_rb.html +101 -0
- data/doc/files/lib/rails_extensions/cgi_session_cachetastic_store_rb.html +109 -0
- data/doc/files/lib/ruby_extensions/object_rb.html +101 -0
- data/doc/fr_class_index.html +47 -0
- data/doc/fr_file_index.html +47 -0
- data/doc/fr_method_index.html +100 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/cachetastic.rb +21 -23
- data/lib/cachetastic_cacheable.rb +202 -0
- data/lib/rails_extensions/cachetastic_active_record_base.rb +12 -39
- data/lib/ruby_extensions/object.rb +8 -0
- data/test/active_record_test.rb +8 -8
- data/test/cacheable_test.rb +72 -0
- metadata +52 -2
- data/lib/helpers/cachetastic_helpers_active_record.rb +0 -46
@@ -0,0 +1,188 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: ActiveRecord::Base</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">ActiveRecord::Base</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/rails_extensions/cachetastic_active_record_base_rb.html">
|
59
|
+
lib/rails_extensions/cachetastic_active_record_base.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="../Object.html">
|
69
|
+
Object
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000002">cachetastic_key</a>
|
92
|
+
<a href="#M000003">get_from_cache</a>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
|
99
|
+
<!-- if includes -->
|
100
|
+
<div id="includes">
|
101
|
+
<h3 class="section-bar">Included Modules</h3>
|
102
|
+
|
103
|
+
<div id="includes-list">
|
104
|
+
<span class="include-name"><a href="../Cachetastic/Cacheable.html">Cachetastic::Cacheable</a></span>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div id="section">
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<!-- if method_list -->
|
118
|
+
<div id="methods">
|
119
|
+
<h3 class="section-bar">Public Class methods</h3>
|
120
|
+
|
121
|
+
<div id="method-M000003" class="method-detail">
|
122
|
+
<a name="M000003"></a>
|
123
|
+
|
124
|
+
<div class="method-heading">
|
125
|
+
<a href="#M000003" class="method-signature">
|
126
|
+
<span class="method-name">get_from_cache</span><span class="method-args">(key, self_populate = false)</span>
|
127
|
+
</a>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div class="method-description">
|
131
|
+
<p><a class="source-toggle" href="#"
|
132
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
133
|
+
<div class="method-source-code" id="M000003-source">
|
134
|
+
<pre>
|
135
|
+
<span class="ruby-comment cmt"># File lib/rails_extensions/cachetastic_active_record_base.rb, line 9</span>
|
136
|
+
9: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_from_cache</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">self_populate</span> = <span class="ruby-keyword kw">false</span>)
|
137
|
+
10: <span class="ruby-identifier">res</span> = <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
|
138
|
+
11: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">self_populate</span>
|
139
|
+
12: <span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">constantize</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">key</span>)
|
140
|
+
13: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">nil?</span>
|
141
|
+
14: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">cache_self</span>
|
142
|
+
15: <span class="ruby-keyword kw">end</span>
|
143
|
+
16: <span class="ruby-keyword kw">end</span>
|
144
|
+
17: <span class="ruby-identifier">res</span>
|
145
|
+
18: <span class="ruby-keyword kw">end</span>
|
146
|
+
</pre>
|
147
|
+
</div>
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
152
|
+
|
153
|
+
<div id="method-M000002" class="method-detail">
|
154
|
+
<a name="M000002"></a>
|
155
|
+
|
156
|
+
<div class="method-heading">
|
157
|
+
<a href="#M000002" class="method-signature">
|
158
|
+
<span class="method-name">cachetastic_key</span><span class="method-args">()</span>
|
159
|
+
</a>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div class="method-description">
|
163
|
+
<p><a class="source-toggle" href="#"
|
164
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
165
|
+
<div class="method-source-code" id="M000002-source">
|
166
|
+
<pre>
|
167
|
+
<span class="ruby-comment cmt"># File lib/rails_extensions/cachetastic_active_record_base.rb, line 5</span>
|
168
|
+
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cachetastic_key</span>
|
169
|
+
6: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">id</span>
|
170
|
+
7: <span class="ruby-keyword kw">end</span>
|
171
|
+
</pre>
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
|
177
|
+
</div>
|
178
|
+
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
|
183
|
+
<div id="validator-badges">
|
184
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
</body>
|
188
|
+
</html>
|
@@ -0,0 +1,124 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: CGI::Session::CachetasticStore</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">CGI::Session::CachetasticStore</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/rails_extensions/cgi_session_cachetastic_store_rb.html">
|
59
|
+
lib/rails_extensions/cgi_session_cachetastic_store.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="../../Object.html">
|
69
|
+
Object
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
Allows Rails to use Cachetastic for it‘s session store. The setting
|
86
|
+
below needs to happen AFTER the gem has been required, obviously! In Rails
|
87
|
+
1.2.6 this is AFTER the initializer block.
|
88
|
+
</p>
|
89
|
+
<pre>
|
90
|
+
ActionController::Base.session_store = :cachetastic_store
|
91
|
+
</pre>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
<!-- if includes -->
|
103
|
+
|
104
|
+
<div id="section">
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<!-- if method_list -->
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
|
118
|
+
|
119
|
+
<div id="validator-badges">
|
120
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
</body>
|
124
|
+
</html>
|
@@ -0,0 +1,331 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Cachetastic::Adapters::Base</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Cachetastic::Adapters::Base</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/adapters/cachetastic_adapters_base_rb.html">
|
59
|
+
lib/adapters/cachetastic_adapters_base.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="../../Object.html">
|
69
|
+
Object
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
This class is the interface used to develop adapters for stores. Stores are
|
86
|
+
where the data is actually held. These could be local memory, memcached, a
|
87
|
+
database, the file system, etc… If you implement this API, then you
|
88
|
+
should be able to plug in different stores for your caches without having
|
89
|
+
to change any of your code.
|
90
|
+
</p>
|
91
|
+
<h3>Methods that need to be implemented:</h3>
|
92
|
+
<ul>
|
93
|
+
<li>setup - used to setup the implementation of the adapter.
|
94
|
+
|
95
|
+
</li>
|
96
|
+
<li>set(key, object, expiry) - sets an object into the store using the given
|
97
|
+
key and the expiry time.
|
98
|
+
|
99
|
+
</li>
|
100
|
+
<li>get(key) - returns an object from the store for a given key.
|
101
|
+
|
102
|
+
</li>
|
103
|
+
<li>delete(key, delay) - deletes an object from the store for a given key. If
|
104
|
+
the store supports it, a delay can be used.
|
105
|
+
|
106
|
+
</li>
|
107
|
+
<li>expire_all - expires all objects in the store for a given cache.
|
108
|
+
|
109
|
+
</li>
|
110
|
+
<li><a href="Base.html#M000035">stats</a> - returns statistics for the store.
|
111
|
+
|
112
|
+
</li>
|
113
|
+
<li>valid? - used to test whether or not the store is still valid. If this
|
114
|
+
returns false a <a href="Base.html#M000033">new</a> instance of the adapter
|
115
|
+
is created by <a href="../Connection.html">Cachetastic::Connection</a>
|
116
|
+
|
117
|
+
</li>
|
118
|
+
</ul>
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div id="method-list">
|
126
|
+
<h3 class="section-bar">Methods</h3>
|
127
|
+
|
128
|
+
<div class="name-list">
|
129
|
+
<a href="#M000034">debug?</a>
|
130
|
+
<a href="#M000036">get_options</a>
|
131
|
+
<a href="#M000033">new</a>
|
132
|
+
<a href="#M000035">stats</a>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
</div>
|
137
|
+
|
138
|
+
|
139
|
+
<!-- if includes -->
|
140
|
+
|
141
|
+
<div id="section">
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<div id="attribute-list">
|
148
|
+
<h3 class="section-bar">Attributes</h3>
|
149
|
+
|
150
|
+
<div class="name-list">
|
151
|
+
<table>
|
152
|
+
<tr class="top-aligned-row context-row">
|
153
|
+
<td class="context-item-name">all_options</td>
|
154
|
+
<td class="context-item-value"> [R] </td>
|
155
|
+
<td class="context-item-desc"></td>
|
156
|
+
</tr>
|
157
|
+
<tr class="top-aligned-row context-row">
|
158
|
+
<td class="context-item-name">logger</td>
|
159
|
+
<td class="context-item-value"> [R] </td>
|
160
|
+
<td class="context-item-desc"></td>
|
161
|
+
</tr>
|
162
|
+
<tr class="top-aligned-row context-row">
|
163
|
+
<td class="context-item-name">logging</td>
|
164
|
+
<td class="context-item-value"> [R] </td>
|
165
|
+
<td class="context-item-desc"></td>
|
166
|
+
</tr>
|
167
|
+
<tr class="top-aligned-row context-row">
|
168
|
+
<td class="context-item-name">name</td>
|
169
|
+
<td class="context-item-value"> [R] </td>
|
170
|
+
<td class="context-item-desc"></td>
|
171
|
+
</tr>
|
172
|
+
<tr class="top-aligned-row context-row">
|
173
|
+
<td class="context-item-name">servers</td>
|
174
|
+
<td class="context-item-value"> [R] </td>
|
175
|
+
<td class="context-item-desc"></td>
|
176
|
+
</tr>
|
177
|
+
<tr class="top-aligned-row context-row">
|
178
|
+
<td class="context-item-name">store_options</td>
|
179
|
+
<td class="context-item-value"> [R] </td>
|
180
|
+
<td class="context-item-desc"></td>
|
181
|
+
</tr>
|
182
|
+
</table>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<!-- if method_list -->
|
189
|
+
<div id="methods">
|
190
|
+
<h3 class="section-bar">Public Class methods</h3>
|
191
|
+
|
192
|
+
<div id="method-M000036" class="method-detail">
|
193
|
+
<a name="M000036"></a>
|
194
|
+
|
195
|
+
<div class="method-heading">
|
196
|
+
<a href="#M000036" class="method-signature">
|
197
|
+
<span class="method-name">get_options</span><span class="method-args">(name)</span>
|
198
|
+
</a>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
<p>
|
203
|
+
Merges options for the store in the configuration file with the
|
204
|
+
cachetastic_default_options found in the configuration file, and returns
|
205
|
+
the results. Options need to be specified in the configuration file as the
|
206
|
+
methodized name of the cache with _options attached at the end. Examples:
|
207
|
+
</p>
|
208
|
+
<pre>
|
209
|
+
Cachetastic::Caches::PageCache # => cachetastic_caches_page_cache_options
|
210
|
+
MyAwesomeCache # => my_awesome_cache_options
|
211
|
+
</pre>
|
212
|
+
<p><a class="source-toggle" href="#"
|
213
|
+
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
214
|
+
<div class="method-source-code" id="M000036-source">
|
215
|
+
<pre>
|
216
|
+
<span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_base.rb, line 68</span>
|
217
|
+
68: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_options</span>(<span class="ruby-identifier">name</span>)
|
218
|
+
69: <span class="ruby-identifier">options</span> = (<span class="ruby-identifier">app_config</span>.<span class="ruby-identifier">cachetastic_default_options</span> <span class="ruby-operator">||</span> {})
|
219
|
+
70: <span class="ruby-identifier">options</span> = {<span class="ruby-value str">"adapter"</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"local_memory"</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
220
|
+
71: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">app_config</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">methodize</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"_options"</span>) <span class="ruby-operator">||</span> {})
|
221
|
+
72: <span class="ruby-identifier">options</span>
|
222
|
+
73: <span class="ruby-keyword kw">end</span>
|
223
|
+
</pre>
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
<div id="method-M000033" class="method-detail">
|
229
|
+
<a name="M000033"></a>
|
230
|
+
|
231
|
+
<div class="method-heading">
|
232
|
+
<a href="#M000033" class="method-signature">
|
233
|
+
<span class="method-name">new</span><span class="method-args">(name)</span>
|
234
|
+
</a>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div class="method-description">
|
238
|
+
<p><a class="source-toggle" href="#"
|
239
|
+
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
240
|
+
<div class="method-source-code" id="M000033-source">
|
241
|
+
<pre>
|
242
|
+
<span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_base.rb, line 24</span>
|
243
|
+
24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>)
|
244
|
+
25: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
|
245
|
+
26: <span class="ruby-identifier">configure</span>
|
246
|
+
27: <span class="ruby-identifier">setup</span>
|
247
|
+
28: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debug?</span>
|
248
|
+
29: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">:self</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inspect</span>)
|
249
|
+
30: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">:options</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">all_options</span>.<span class="ruby-identifier">inspect</span>)
|
250
|
+
31: <span class="ruby-keyword kw">end</span>
|
251
|
+
32: <span class="ruby-keyword kw">end</span>
|
252
|
+
</pre>
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
258
|
+
|
259
|
+
<div id="method-M000034" class="method-detail">
|
260
|
+
<a name="M000034"></a>
|
261
|
+
|
262
|
+
<div class="method-heading">
|
263
|
+
<a href="#M000034" class="method-signature">
|
264
|
+
<span class="method-name">debug?</span><span class="method-args">()</span>
|
265
|
+
</a>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
<div class="method-description">
|
269
|
+
<p>
|
270
|
+
Returns true/or falsed based on whether or not the debug setting is set to
|
271
|
+
true in the configuration file. If the config setting is set, then false is
|
272
|
+
returned.
|
273
|
+
</p>
|
274
|
+
<p><a class="source-toggle" href="#"
|
275
|
+
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
276
|
+
<div class="method-source-code" id="M000034-source">
|
277
|
+
<pre>
|
278
|
+
<span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_base.rb, line 43</span>
|
279
|
+
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug?</span>
|
280
|
+
44: <span class="ruby-identifier">ivar_cache</span>(<span class="ruby-identifier">:debug</span>) <span class="ruby-keyword kw">do</span>
|
281
|
+
45: (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">"debug"</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>)
|
282
|
+
46: <span class="ruby-keyword kw">end</span>
|
283
|
+
47: <span class="ruby-keyword kw">end</span>
|
284
|
+
</pre>
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
</div>
|
288
|
+
|
289
|
+
<div id="method-M000035" class="method-detail">
|
290
|
+
<a name="M000035"></a>
|
291
|
+
|
292
|
+
<div class="method-heading">
|
293
|
+
<a href="#M000035" class="method-signature">
|
294
|
+
<span class="method-name">stats</span><span class="method-args">()</span>
|
295
|
+
</a>
|
296
|
+
</div>
|
297
|
+
|
298
|
+
<div class="method-description">
|
299
|
+
<p><a class="source-toggle" href="#"
|
300
|
+
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
301
|
+
<div class="method-source-code" id="M000035-source">
|
302
|
+
<pre>
|
303
|
+
<span class="ruby-comment cmt"># File lib/adapters/cachetastic_adapters_base.rb, line 49</span>
|
304
|
+
49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
|
305
|
+
50: <span class="ruby-identifier">cache_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">camelize</span>
|
306
|
+
51: <span class="ruby-identifier">adapter_type</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'Cachetastic::Adapters::'</span>, <span class="ruby-value str">''</span>)
|
307
|
+
52: <span class="ruby-identifier">s</span> = <span class="ruby-node">"Cache: #{cache_name}\nStore Type: #{adapter_type}\n"</span>
|
308
|
+
53: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">servers</span>
|
309
|
+
54: <span class="ruby-identifier">servers</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">servers</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">','</span>)
|
310
|
+
55: <span class="ruby-identifier">s</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"Servers: #{servers}"</span>
|
311
|
+
56: <span class="ruby-keyword kw">end</span>
|
312
|
+
57: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">s</span>
|
313
|
+
58: <span class="ruby-keyword kw">end</span>
|
314
|
+
</pre>
|
315
|
+
</div>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
|
320
|
+
</div>
|
321
|
+
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
|
326
|
+
<div id="validator-badges">
|
327
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
</body>
|
331
|
+
</html>
|