cachetastic 1.7.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +31 -44
- data/bin/cachetastic_drb_server +115 -0
- data/doc/classes/ActiveRecord/Base.html +16 -16
- data/doc/classes/CGI/Session/CachetasticStore.html +2 -2
- data/doc/classes/Cachetastic/Adapters/Base.html +74 -67
- data/doc/classes/Cachetastic/Adapters/Drb.html +11 -11
- data/doc/classes/Cachetastic/Adapters/File.html +5 -5
- data/doc/classes/Cachetastic/Adapters/FileBase.html +45 -45
- data/doc/classes/Cachetastic/Adapters/HtmlFile.html +23 -23
- data/doc/classes/Cachetastic/Adapters/LocalMemory.html +51 -51
- data/doc/classes/Cachetastic/Adapters/Memcache.html +89 -89
- data/doc/classes/Cachetastic/Cacheable.html +22 -22
- data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +23 -23
- data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +23 -23
- data/doc/classes/Cachetastic/Caches/Base.html +170 -199
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +9 -9
- data/doc/classes/Cachetastic/Caches/MackSessionCache.html +2 -2
- data/doc/classes/Cachetastic/Caches/PageCache.html +2 -2
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +9 -9
- data/doc/classes/Cachetastic/Connection.html +5 -5
- data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +9 -9
- data/doc/classes/Cachetastic/Logger.html +23 -24
- data/doc/classes/Object.html +41 -3
- data/doc/created.rid +1 -1
- data/doc/files/README.html +33 -52
- data/doc/files/lib/{adapters/cachetastic_adapters_base_rb.html → cachetastic/adapters/base_rb.html} +6 -6
- data/doc/files/lib/{adapters/cachetastic_adapters_drb_rb.html → cachetastic/adapters/drb_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_file_base_rb.html → cachetastic/adapters/file_base_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_file_rb.html → cachetastic/adapters/file_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_html_file_rb.html → cachetastic/adapters/html_file_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_local_memory_rb.html → cachetastic/adapters/local_memory_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_memcache_rb.html → cachetastic/adapters/memcache_rb.html} +5 -5
- data/doc/files/lib/{cachetastic_cacheable_rb.html → cachetastic/adapters/store_object_rb.html} +5 -5
- data/doc/files/lib/{ruby_extensions/object_rb.html → cachetastic/cacheable_rb.html} +4 -4
- data/doc/files/lib/{caches/cachetastic_caches_base_rb.html → cachetastic/caches/base_rb.html} +5 -5
- data/doc/files/lib/{cachetastic_connection_rb.html → cachetastic/caches/mack_session_cache_rb.html} +6 -6
- data/doc/files/lib/{caches/cachetastic_caches_page_cache_rb.html → cachetastic/caches/page_cache_rb.html} +5 -5
- data/doc/files/lib/{caches/cachetastic_caches_rails_session_cache_rb.html → cachetastic/caches/rails_session_cache_rb.html} +5 -5
- data/doc/files/lib/{caches/cachetastic_caches_mack_session_cache_rb.html → cachetastic/connection_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_store_object_rb.html → cachetastic/errors/unsupported_adapter_rb.html} +5 -5
- data/doc/files/lib/{cachetastic_logger_rb.html → cachetastic/logger_rb.html} +5 -5
- data/doc/files/lib/{rails_extensions/cachetastic_active_record_base_rb.html → cachetastic/rails_extensions/active_record_base_rb.html} +5 -5
- data/doc/files/lib/{rails_extensions/cgi_session_cachetastic_store_rb.html → cachetastic/rails_extensions/cgi_session_store_rb.html} +5 -5
- data/doc/files/lib/cachetastic/ruby_extensions/object_rb.html +101 -0
- data/doc/files/lib/cachetastic_rb.html +34 -53
- data/doc/fr_file_index.html +19 -19
- data/doc/fr_method_index.html +63 -62
- data/lib/cachetastic.rb +35 -22
- data/lib/{adapters/cachetastic_adapters_base.rb → cachetastic/adapters/base.rb} +23 -30
- data/lib/{adapters/cachetastic_adapters_drb.rb → cachetastic/adapters/drb.rb} +2 -2
- data/lib/{adapters/cachetastic_adapters_file.rb → cachetastic/adapters/file.rb} +0 -0
- data/lib/{adapters/cachetastic_adapters_file_base.rb → cachetastic/adapters/file_base.rb} +1 -1
- data/lib/{adapters/cachetastic_adapters_html_file.rb → cachetastic/adapters/html_file.rb} +0 -0
- data/lib/{adapters/cachetastic_adapters_local_memory.rb → cachetastic/adapters/local_memory.rb} +0 -0
- data/lib/{adapters/cachetastic_adapters_memcache.rb → cachetastic/adapters/memcache.rb} +3 -3
- data/lib/{adapters/cachetastic_adapters_store_object.rb → cachetastic/adapters/store_object.rb} +0 -0
- data/lib/{cachetastic_cacheable.rb → cachetastic/cacheable.rb} +0 -0
- data/lib/{caches/cachetastic_caches_base.rb → cachetastic/caches/base.rb} +11 -13
- data/lib/{caches/cachetastic_caches_mack_session_cache.rb → cachetastic/caches/mack_session_cache.rb} +0 -0
- data/lib/{caches/cachetastic_caches_page_cache.rb → cachetastic/caches/page_cache.rb} +0 -0
- data/lib/{caches/cachetastic_caches_rails_session_cache.rb → cachetastic/caches/rails_session_cache.rb} +0 -0
- data/lib/{cachetastic_connection.rb → cachetastic/connection.rb} +1 -1
- data/lib/{errors/cachetastic_errors_unsupported_adapter.rb → cachetastic/errors/unsupported_adapter.rb} +0 -0
- data/lib/cachetastic/logger.rb +49 -0
- data/lib/{rails_extensions/cachetastic_active_record_base.rb → cachetastic/rails_extensions/active_record_base.rb} +0 -0
- data/lib/{rails_extensions/cgi_session_cachetastic_store.rb → cachetastic/rails_extensions/cgi_session_store.rb} +0 -0
- data/lib/{ruby_extensions → cachetastic/ruby_extensions}/object.rb +0 -0
- data/test/config.rb +30 -0
- data/test/drb_adapter_test.rb +14 -0
- data/test/memcache_adapter_test.rb +14 -0
- data/test/test_helper.rb +8 -22
- metadata +58 -47
- data/doc/files/lib/errors/cachetastic_errors_unsupported_adapter_rb.html +0 -101
- data/lib/cachetastic_logger.rb +0 -44
- data/test/config.yml +0 -71
- data/test/data_mapper_test.rb +0 -9
@@ -55,8 +55,8 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../../files/lib/adapters/
|
59
|
-
lib/adapters/
|
58
|
+
<a href="../../../files/lib/cachetastic/adapters/memcache_rb.html">
|
59
|
+
lib/cachetastic/adapters/memcache.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -114,18 +114,18 @@ backing. The configuration for this should look something like this:
|
|
114
114
|
<h3 class="section-bar">Methods</h3>
|
115
115
|
|
116
116
|
<div class="name-list">
|
117
|
-
<a href="#
|
118
|
-
<a href="#
|
119
|
-
<a href="#
|
120
|
-
<a href="#
|
121
|
-
<a href="#
|
122
|
-
<a href="#
|
123
|
-
<a href="#
|
124
|
-
<a href="#
|
125
|
-
<a href="#
|
126
|
-
<a href="#
|
127
|
-
<a href="#
|
128
|
-
<a href="#
|
117
|
+
<a href="#M000009">delete</a>
|
118
|
+
<a href="#M000011">expire_all</a>
|
119
|
+
<a href="#M000010">get</a>
|
120
|
+
<a href="#M000018">get_version</a>
|
121
|
+
<a href="#M000017">increment_version</a>
|
122
|
+
<a href="#M000012">inspect</a>
|
123
|
+
<a href="#M000015">namespace</a>
|
124
|
+
<a href="#M000016">ns_versions</a>
|
125
|
+
<a href="#M000008">set</a>
|
126
|
+
<a href="#M000007">setup</a>
|
127
|
+
<a href="#M000014">stats</a>
|
128
|
+
<a href="#M000013">valid?</a>
|
129
129
|
</div>
|
130
130
|
</div>
|
131
131
|
|
@@ -165,21 +165,21 @@ backing. The configuration for this should look something like this:
|
|
165
165
|
<div id="methods">
|
166
166
|
<h3 class="section-bar">Public Instance methods</h3>
|
167
167
|
|
168
|
-
<div id="method-
|
169
|
-
<a name="
|
168
|
+
<div id="method-M000009" class="method-detail">
|
169
|
+
<a name="M000009"></a>
|
170
170
|
|
171
171
|
<div class="method-heading">
|
172
|
-
<a href="#
|
172
|
+
<a href="#M000009" class="method-signature">
|
173
173
|
<span class="method-name">delete</span><span class="method-args">(key, delay = 0)</span>
|
174
174
|
</a>
|
175
175
|
</div>
|
176
176
|
|
177
177
|
<div class="method-description">
|
178
178
|
<p><a class="source-toggle" href="#"
|
179
|
-
onclick="toggleCode('
|
180
|
-
<div class="method-source-code" id="
|
179
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
180
|
+
<div class="method-source-code" id="M000009-source">
|
181
181
|
<pre>
|
182
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
182
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 31</span>
|
183
183
|
31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">delay</span> = <span class="ruby-value">0</span>)
|
184
184
|
32: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">conn</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">delay</span>)
|
185
185
|
33: <span class="ruby-keyword kw">end</span>
|
@@ -188,21 +188,21 @@ backing. The configuration for this should look something like this:
|
|
188
188
|
</div>
|
189
189
|
</div>
|
190
190
|
|
191
|
-
<div id="method-
|
192
|
-
<a name="
|
191
|
+
<div id="method-M000011" class="method-detail">
|
192
|
+
<a name="M000011"></a>
|
193
193
|
|
194
194
|
<div class="method-heading">
|
195
|
-
<a href="#
|
195
|
+
<a href="#M000011" class="method-signature">
|
196
196
|
<span class="method-name">expire_all</span><span class="method-args">()</span>
|
197
197
|
</a>
|
198
198
|
</div>
|
199
199
|
|
200
200
|
<div class="method-description">
|
201
201
|
<p><a class="source-toggle" href="#"
|
202
|
-
onclick="toggleCode('
|
203
|
-
<div class="method-source-code" id="
|
202
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
203
|
+
<div class="method-source-code" id="M000011-source">
|
204
204
|
<pre>
|
205
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
205
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 39</span>
|
206
206
|
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
207
207
|
40: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">increment_version</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>)
|
208
208
|
41: <span class="ruby-keyword kw">end</span>
|
@@ -211,21 +211,21 @@ backing. The configuration for this should look something like this:
|
|
211
211
|
</div>
|
212
212
|
</div>
|
213
213
|
|
214
|
-
<div id="method-
|
215
|
-
<a name="
|
214
|
+
<div id="method-M000010" class="method-detail">
|
215
|
+
<a name="M000010"></a>
|
216
216
|
|
217
217
|
<div class="method-heading">
|
218
|
-
<a href="#
|
218
|
+
<a href="#M000010" class="method-signature">
|
219
219
|
<span class="method-name">get</span><span class="method-args">(key, raw = false)</span>
|
220
220
|
</a>
|
221
221
|
</div>
|
222
222
|
|
223
223
|
<div class="method-description">
|
224
224
|
<p><a class="source-toggle" href="#"
|
225
|
-
onclick="toggleCode('
|
226
|
-
<div class="method-source-code" id="
|
225
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
226
|
+
<div class="method-source-code" id="M000010-source">
|
227
227
|
<pre>
|
228
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
228
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 35</span>
|
229
229
|
35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">raw</span> = <span class="ruby-keyword kw">false</span>)
|
230
230
|
36: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">conn</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">raw</span>)
|
231
231
|
37: <span class="ruby-keyword kw">end</span>
|
@@ -234,21 +234,21 @@ backing. The configuration for this should look something like this:
|
|
234
234
|
</div>
|
235
235
|
</div>
|
236
236
|
|
237
|
-
<div id="method-
|
238
|
-
<a name="
|
237
|
+
<div id="method-M000012" class="method-detail">
|
238
|
+
<a name="M000012"></a>
|
239
239
|
|
240
240
|
<div class="method-heading">
|
241
|
-
<a href="#
|
241
|
+
<a href="#M000012" class="method-signature">
|
242
242
|
<span class="method-name">inspect</span><span class="method-args">()</span>
|
243
243
|
</a>
|
244
244
|
</div>
|
245
245
|
|
246
246
|
<div class="method-description">
|
247
247
|
<p><a class="source-toggle" href="#"
|
248
|
-
onclick="toggleCode('
|
249
|
-
<div class="method-source-code" id="
|
248
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
249
|
+
<div class="method-source-code" id="M000012-source">
|
250
250
|
<pre>
|
251
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
251
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 43</span>
|
252
252
|
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
|
253
253
|
44: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">conn</span>.<span class="ruby-identifier">inspect</span> <span class="ruby-operator">+</span> <span class="ruby-node">" <version: #{self.version}> #{self.conn.stats.inspect}"</span>
|
254
254
|
45: <span class="ruby-keyword kw">end</span>
|
@@ -257,21 +257,21 @@ backing. The configuration for this should look something like this:
|
|
257
257
|
</div>
|
258
258
|
</div>
|
259
259
|
|
260
|
-
<div id="method-
|
261
|
-
<a name="
|
260
|
+
<div id="method-M000008" class="method-detail">
|
261
|
+
<a name="M000008"></a>
|
262
262
|
|
263
263
|
<div class="method-heading">
|
264
|
-
<a href="#
|
264
|
+
<a href="#M000008" class="method-signature">
|
265
265
|
<span class="method-name">set</span><span class="method-args">(key, value, expiry = 0, raw = false)</span>
|
266
266
|
</a>
|
267
267
|
</div>
|
268
268
|
|
269
269
|
<div class="method-description">
|
270
270
|
<p><a class="source-toggle" href="#"
|
271
|
-
onclick="toggleCode('
|
272
|
-
<div class="method-source-code" id="
|
271
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
272
|
+
<div class="method-source-code" id="M000008-source">
|
273
273
|
<pre>
|
274
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
274
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 27</span>
|
275
275
|
27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">expiry</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">raw</span> = <span class="ruby-keyword kw">false</span>)
|
276
276
|
28: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">conn</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">expiry</span>, <span class="ruby-identifier">raw</span>)
|
277
277
|
29: <span class="ruby-keyword kw">end</span>
|
@@ -280,23 +280,23 @@ backing. The configuration for this should look something like this:
|
|
280
280
|
</div>
|
281
281
|
</div>
|
282
282
|
|
283
|
-
<div id="method-
|
284
|
-
<a name="
|
283
|
+
<div id="method-M000007" class="method-detail">
|
284
|
+
<a name="M000007"></a>
|
285
285
|
|
286
286
|
<div class="method-heading">
|
287
|
-
<a href="#
|
287
|
+
<a href="#M000007" class="method-signature">
|
288
288
|
<span class="method-name">setup</span><span class="method-args">()</span>
|
289
289
|
</a>
|
290
290
|
</div>
|
291
291
|
|
292
292
|
<div class="method-description">
|
293
293
|
<p><a class="source-toggle" href="#"
|
294
|
-
onclick="toggleCode('
|
295
|
-
<div class="method-source-code" id="
|
294
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
295
|
+
<div class="method-source-code" id="M000007-source">
|
296
296
|
<pre>
|
297
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
297
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 22</span>
|
298
298
|
22: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
299
|
-
23: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">conn</span> = <span class="ruby-constant">MemCache</span>.<span class="ruby-identifier">new</span>(<span class="ruby-
|
299
|
+
23: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">conn</span> = <span class="ruby-constant">MemCache</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">servers</span>, <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">store_options</span>.<span class="ruby-identifier">to_hash</span>.<span class="ruby-identifier">merge</span>({<span class="ruby-identifier">:namespace</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">namespace</span>}))
|
300
300
|
24: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_version</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>)
|
301
301
|
25: <span class="ruby-keyword kw">end</span>
|
302
302
|
</pre>
|
@@ -304,21 +304,21 @@ backing. The configuration for this should look something like this:
|
|
304
304
|
</div>
|
305
305
|
</div>
|
306
306
|
|
307
|
-
<div id="method-
|
308
|
-
<a name="
|
307
|
+
<div id="method-M000014" class="method-detail">
|
308
|
+
<a name="M000014"></a>
|
309
309
|
|
310
310
|
<div class="method-heading">
|
311
|
-
<a href="#
|
311
|
+
<a href="#M000014" class="method-signature">
|
312
312
|
<span class="method-name">stats</span><span class="method-args">()</span>
|
313
313
|
</a>
|
314
314
|
</div>
|
315
315
|
|
316
316
|
<div class="method-description">
|
317
317
|
<p><a class="source-toggle" href="#"
|
318
|
-
onclick="toggleCode('
|
319
|
-
<div class="method-source-code" id="
|
318
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
319
|
+
<div class="method-source-code" id="M000014-source">
|
320
320
|
<pre>
|
321
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
321
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 57</span>
|
322
322
|
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
|
323
323
|
58: <span class="ruby-keyword kw">super</span>
|
324
324
|
59: <span class="ruby-keyword kw">begin</span>
|
@@ -336,7 +336,7 @@ backing. The configuration for this should look something like this:
|
|
336
336
|
71: <span class="ruby-keyword kw">end</span>
|
337
337
|
72: <span class="ruby-keyword kw">end</span>
|
338
338
|
73: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">memcached_tool_found</span>
|
339
|
-
74: <span class="ruby-identifier">
|
339
|
+
74: <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">memcache_servers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">server</span><span class="ruby-operator">|</span>
|
340
340
|
75: <span class="ruby-identifier">puts</span> <span class="ruby-node">`memcached_tool #{server}`</span>
|
341
341
|
76: <span class="ruby-keyword kw">end</span>
|
342
342
|
77: <span class="ruby-keyword kw">end</span>
|
@@ -349,21 +349,21 @@ backing. The configuration for this should look something like this:
|
|
349
349
|
</div>
|
350
350
|
</div>
|
351
351
|
|
352
|
-
<div id="method-
|
353
|
-
<a name="
|
352
|
+
<div id="method-M000013" class="method-detail">
|
353
|
+
<a name="M000013"></a>
|
354
354
|
|
355
355
|
<div class="method-heading">
|
356
|
-
<a href="#
|
356
|
+
<a href="#M000013" class="method-signature">
|
357
357
|
<span class="method-name">valid?</span><span class="method-args">()</span>
|
358
358
|
</a>
|
359
359
|
</div>
|
360
360
|
|
361
361
|
<div class="method-description">
|
362
362
|
<p><a class="source-toggle" href="#"
|
363
|
-
onclick="toggleCode('
|
364
|
-
<div class="method-source-code" id="
|
363
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
364
|
+
<div class="method-source-code" id="M000013-source">
|
365
365
|
<pre>
|
366
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
366
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 47</span>
|
367
367
|
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
|
368
368
|
48: <span class="ruby-keyword kw">begin</span>
|
369
369
|
49: <span class="ruby-keyword kw">return</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">conn</span>.<span class="ruby-identifier">active?</span> <span class="ruby-operator">&&</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_version</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>))
|
@@ -380,21 +380,21 @@ backing. The configuration for this should look something like this:
|
|
380
380
|
|
381
381
|
<h3 class="section-bar">Protected Instance methods</h3>
|
382
382
|
|
383
|
-
<div id="method-
|
384
|
-
<a name="
|
383
|
+
<div id="method-M000018" class="method-detail">
|
384
|
+
<a name="M000018"></a>
|
385
385
|
|
386
386
|
<div class="method-heading">
|
387
|
-
<a href="#
|
387
|
+
<a href="#M000018" class="method-signature">
|
388
388
|
<span class="method-name">get_version</span><span class="method-args">(name)</span>
|
389
389
|
</a>
|
390
390
|
</div>
|
391
391
|
|
392
392
|
<div class="method-description">
|
393
393
|
<p><a class="source-toggle" href="#"
|
394
|
-
onclick="toggleCode('
|
395
|
-
<div class="method-source-code" id="
|
394
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
395
|
+
<div class="method-source-code" id="M000018-source">
|
396
396
|
<pre>
|
397
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
397
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 104</span>
|
398
398
|
104: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_version</span>(<span class="ruby-identifier">name</span>)
|
399
399
|
105: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>
|
400
400
|
106: <span class="ruby-identifier">v</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ns_versions</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">name</span>)
|
@@ -409,21 +409,21 @@ backing. The configuration for this should look something like this:
|
|
409
409
|
</div>
|
410
410
|
</div>
|
411
411
|
|
412
|
-
<div id="method-
|
413
|
-
<a name="
|
412
|
+
<div id="method-M000017" class="method-detail">
|
413
|
+
<a name="M000017"></a>
|
414
414
|
|
415
415
|
<div class="method-heading">
|
416
|
-
<a href="#
|
416
|
+
<a href="#M000017" class="method-signature">
|
417
417
|
<span class="method-name">increment_version</span><span class="method-args">(name)</span>
|
418
418
|
</a>
|
419
419
|
</div>
|
420
420
|
|
421
421
|
<div class="method-description">
|
422
422
|
<p><a class="source-toggle" href="#"
|
423
|
-
onclick="toggleCode('
|
424
|
-
<div class="method-source-code" id="
|
423
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
424
|
+
<div class="method-source-code" id="M000017-source">
|
425
425
|
<pre>
|
426
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
426
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 98</span>
|
427
427
|
98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">increment_version</span>(<span class="ruby-identifier">name</span>)
|
428
428
|
99: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>
|
429
429
|
100: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">get_version</span>(<span class="ruby-identifier">name</span>)
|
@@ -434,21 +434,21 @@ backing. The configuration for this should look something like this:
|
|
434
434
|
</div>
|
435
435
|
</div>
|
436
436
|
|
437
|
-
<div id="method-
|
438
|
-
<a name="
|
437
|
+
<div id="method-M000015" class="method-detail">
|
438
|
+
<a name="M000015"></a>
|
439
439
|
|
440
440
|
<div class="method-heading">
|
441
|
-
<a href="#
|
441
|
+
<a href="#M000015" class="method-signature">
|
442
442
|
<span class="method-name">namespace</span><span class="method-args">()</span>
|
443
443
|
</a>
|
444
444
|
</div>
|
445
445
|
|
446
446
|
<div class="method-description">
|
447
447
|
<p><a class="source-toggle" href="#"
|
448
|
-
onclick="toggleCode('
|
449
|
-
<div class="method-source-code" id="
|
448
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
449
|
+
<div class="method-source-code" id="M000015-source">
|
450
450
|
<pre>
|
451
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
451
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 87</span>
|
452
452
|
87: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">namespace</span>
|
453
453
|
88: <span class="ruby-identifier">v</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_version</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>)
|
454
454
|
89: <span class="ruby-keyword kw">return</span> <span class="ruby-node">"#{name}.#{v}"</span>
|
@@ -458,24 +458,24 @@ backing. The configuration for this should look something like this:
|
|
458
458
|
</div>
|
459
459
|
</div>
|
460
460
|
|
461
|
-
<div id="method-
|
462
|
-
<a name="
|
461
|
+
<div id="method-M000016" class="method-detail">
|
462
|
+
<a name="M000016"></a>
|
463
463
|
|
464
464
|
<div class="method-heading">
|
465
|
-
<a href="#
|
465
|
+
<a href="#M000016" class="method-signature">
|
466
466
|
<span class="method-name">ns_versions</span><span class="method-args">()</span>
|
467
467
|
</a>
|
468
468
|
</div>
|
469
469
|
|
470
470
|
<div class="method-description">
|
471
471
|
<p><a class="source-toggle" href="#"
|
472
|
-
onclick="toggleCode('
|
473
|
-
<div class="method-source-code" id="
|
472
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
473
|
+
<div class="method-source-code" id="M000016-source">
|
474
474
|
<pre>
|
475
|
-
<span class="ruby-comment cmt"># File lib/adapters/
|
475
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcache.rb, line 92</span>
|
476
476
|
92: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ns_versions</span>
|
477
477
|
93: <span class="ruby-identifier">ivar_cache</span> <span class="ruby-keyword kw">do</span>
|
478
|
-
94: <span class="ruby-identifier">ns_conn</span> = <span class="ruby-constant">MemCache</span>.<span class="ruby-identifier">new</span>(<span class="ruby-
|
478
|
+
94: <span class="ruby-identifier">ns_conn</span> = <span class="ruby-constant">MemCache</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">servers</span>, <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">store_options</span>.<span class="ruby-identifier">to_hash</span>.<span class="ruby-identifier">merge</span>({<span class="ruby-identifier">:namespace</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:namespace_versions</span>}))
|
479
479
|
95: <span class="ruby-keyword kw">end</span>
|
480
480
|
96: <span class="ruby-keyword kw">end</span>
|
481
481
|
</pre>
|
@@ -55,12 +55,12 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/lib/
|
59
|
-
lib/cachetastic.rb
|
58
|
+
<a href="../../files/lib/cachetastic/cacheable_rb.html">
|
59
|
+
lib/cachetastic/cacheable.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
|
-
<a href="../../files/lib/
|
63
|
-
lib/
|
62
|
+
<a href="../../files/lib/cachetastic_rb.html">
|
63
|
+
lib/cachetastic.rb
|
64
64
|
</a>
|
65
65
|
<br />
|
66
66
|
</td>
|
@@ -112,8 +112,8 @@ Example:
|
|
112
112
|
<h3 class="section-bar">Methods</h3>
|
113
113
|
|
114
114
|
<div class="name-list">
|
115
|
-
<a href="#
|
116
|
-
<a href="#
|
115
|
+
<a href="#M000063">cache_self</a>
|
116
|
+
<a href="#M000064">uncache_self</a>
|
117
117
|
</div>
|
118
118
|
</div>
|
119
119
|
|
@@ -142,11 +142,11 @@ Module <a href="Cacheable/ClassOnlyMethods.html" class="link">Cachetastic::Cache
|
|
142
142
|
<div id="methods">
|
143
143
|
<h3 class="section-bar">Public Instance methods</h3>
|
144
144
|
|
145
|
-
<div id="method-
|
146
|
-
<a name="
|
145
|
+
<div id="method-M000063" class="method-detail">
|
146
|
+
<a name="M000063"></a>
|
147
147
|
|
148
148
|
<div class="method-heading">
|
149
|
-
<a href="#
|
149
|
+
<a href="#M000063" class="method-signature">
|
150
150
|
<span class="method-name">cache_self</span><span class="method-args">()</span>
|
151
151
|
</a>
|
152
152
|
</div>
|
@@ -158,8 +158,8 @@ will store the object in the cache using the object‘s cachetastic_key
|
|
158
158
|
as the key. You <b>MUST</b> create an instance level method called
|
159
159
|
cachetastic_key and have it return a valid key! If you return nil from the
|
160
160
|
cachetastic_key method or you will not be able to use the <a
|
161
|
-
href="Cacheable.html#
|
162
|
-
href="Cacheable.html#
|
161
|
+
href="Cacheable.html#M000063">cache_self</a> and <a
|
162
|
+
href="Cacheable.html#M000064">uncache_self</a> methods.
|
163
163
|
</p>
|
164
164
|
<p>
|
165
165
|
Example:
|
@@ -180,10 +180,10 @@ Example:
|
|
180
180
|
Person.get_from_cache("Mark Bates") # => "Mark Bates"
|
181
181
|
</pre>
|
182
182
|
<p><a class="source-toggle" href="#"
|
183
|
-
onclick="toggleCode('
|
184
|
-
<div class="method-source-code" id="
|
183
|
+
onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
|
184
|
+
<div class="method-source-code" id="M000063-source">
|
185
185
|
<pre>
|
186
|
-
<span class="ruby-comment cmt"># File lib/
|
186
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 140</span>
|
187
187
|
140: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_self</span>
|
188
188
|
141: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">set</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cachetastic_key</span>, <span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cachetastic_key</span>.<span class="ruby-identifier">nil?</span>
|
189
189
|
142: <span class="ruby-keyword kw">end</span>
|
@@ -192,11 +192,11 @@ Example:
|
|
192
192
|
</div>
|
193
193
|
</div>
|
194
194
|
|
195
|
-
<div id="method-
|
196
|
-
<a name="
|
195
|
+
<div id="method-M000064" class="method-detail">
|
196
|
+
<a name="M000064"></a>
|
197
197
|
|
198
198
|
<div class="method-heading">
|
199
|
-
<a href="#
|
199
|
+
<a href="#M000064" class="method-signature">
|
200
200
|
<span class="method-name">uncache_self</span><span class="method-args">()</span>
|
201
201
|
</a>
|
202
202
|
</div>
|
@@ -208,8 +208,8 @@ will delete the object in the cache using the object‘s
|
|
208
208
|
cachetastic_key as the key. You <b>MUST</b> create an instance level method
|
209
209
|
called cachetastic_key and have it return a valid key! If you return nil
|
210
210
|
from the cachetastic_key method or you will not be able to use the <a
|
211
|
-
href="Cacheable.html#
|
212
|
-
href="Cacheable.html#
|
211
|
+
href="Cacheable.html#M000063">cache_self</a> and <a
|
212
|
+
href="Cacheable.html#M000064">uncache_self</a> methods.
|
213
213
|
</p>
|
214
214
|
<p>
|
215
215
|
Example:
|
@@ -232,10 +232,10 @@ Example:
|
|
232
232
|
Person.get_from_cache("Mark Bates") # => nil
|
233
233
|
</pre>
|
234
234
|
<p><a class="source-toggle" href="#"
|
235
|
-
onclick="toggleCode('
|
236
|
-
<div class="method-source-code" id="
|
235
|
+
onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
|
236
|
+
<div class="method-source-code" id="M000064-source">
|
237
237
|
<pre>
|
238
|
-
<span class="ruby-comment cmt"># File lib/
|
238
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 166</span>
|
239
239
|
166: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uncache_self</span>
|
240
240
|
167: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cachetastic_key</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cachetastic_key</span>.<span class="ruby-identifier">nil?</span>
|
241
241
|
168: <span class="ruby-keyword kw">end</span>
|