cachetastic 1.2.2 → 1.2.3
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/README +10 -2
- data/bin/cachetastic_drb_server +97 -0
- data/doc/classes/Cachetastic/Adapters/Base.html +16 -16
- data/doc/classes/Cachetastic/Adapters/Base.src/M000024.html +9 -5
- data/doc/classes/Cachetastic/Adapters/Base.src/M000025.html +7 -8
- data/doc/classes/Cachetastic/Adapters/Base.src/M000026.html +21 -0
- data/doc/classes/Cachetastic/Adapters/Drb.html +244 -0
- data/doc/classes/Cachetastic/Adapters/Drb.src/M000027.html +22 -0
- data/doc/classes/Cachetastic/Adapters/Drb.src/M000028.html +18 -0
- data/doc/classes/Cachetastic/Adapters/{LocalMemory.src/M000017.html → Drb.src/M000029.html} +4 -4
- data/doc/classes/Cachetastic/Adapters/Drb.src/M000030.html +26 -0
- data/doc/classes/Cachetastic/Adapters/Drb.src/M000031.html +18 -0
- data/doc/classes/Cachetastic/Adapters/Drb.src/M000032.html +25 -0
- data/doc/classes/Cachetastic/Adapters/File.html +30 -30
- data/doc/classes/Cachetastic/Adapters/File.src/{M000026.html → M000033.html} +0 -0
- data/doc/classes/Cachetastic/Adapters/File.src/{M000027.html → M000034.html} +0 -0
- data/doc/classes/Cachetastic/Adapters/File.src/{M000028.html → M000035.html} +0 -0
- data/doc/classes/Cachetastic/Adapters/File.src/{M000029.html → M000036.html} +2 -0
- data/doc/classes/Cachetastic/Adapters/File.src/{M000030.html → M000037.html} +1 -1
- data/doc/classes/Cachetastic/Adapters/File.src/{M000031.html → M000038.html} +1 -1
- data/doc/classes/Cachetastic/Adapters/LocalMemory.html +30 -30
- data/doc/classes/Cachetastic/Adapters/LocalMemory.src/M000018.html +4 -4
- data/doc/classes/Cachetastic/Adapters/LocalMemory.src/M000019.html +3 -3
- data/doc/classes/Cachetastic/Adapters/LocalMemory.src/M000020.html +4 -12
- data/doc/classes/Cachetastic/Adapters/LocalMemory.src/M000021.html +12 -4
- data/doc/classes/Cachetastic/Adapters/LocalMemory.src/M000022.html +4 -11
- data/doc/classes/Cachetastic/Adapters/LocalMemory.src/M000023.html +25 -0
- data/doc/classes/Cachetastic/Adapters/Memcache.html +55 -55
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000007.html +5 -4
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000008.html +4 -4
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000009.html +4 -4
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000010.html +4 -4
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000011.html +4 -4
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000012.html +4 -10
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000013.html +10 -5
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000014.html +5 -6
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000015.html +6 -6
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000016.html +5 -9
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000017.html +24 -0
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +5 -5
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.src/{M000043.html → M000053.html} +0 -0
- data/doc/classes/Cachetastic/Caches/Base.html +103 -63
- data/doc/classes/Cachetastic/Caches/Base.src/M000040.html +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000041.html +29 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000042.html +8 -13
- data/doc/classes/Cachetastic/Caches/Base.src/{M000035.html → M000043.html} +0 -0
- data/doc/classes/Cachetastic/Caches/Base.src/{M000036.html → M000044.html} +0 -0
- data/doc/classes/Cachetastic/Caches/Base.src/{M000037.html → M000045.html} +0 -0
- data/doc/classes/Cachetastic/Caches/Base.src/{M000038.html → M000046.html} +0 -0
- data/doc/classes/Cachetastic/Caches/Base.src/{M000039.html → M000047.html} +0 -0
- data/doc/classes/Cachetastic/Caches/Base.src/M000048.html +23 -0
- data/doc/classes/Cachetastic/Caches/Base.src/{M000032.html → M000049.html} +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000050.html +18 -0
- data/doc/classes/Cachetastic/Caches/Base.src/M000051.html +18 -0
- data/doc/classes/Cachetastic/Caches/Base.src/M000052.html +28 -0
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +26 -0
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.src/M000039.html +18 -0
- data/doc/classes/Cachetastic/Connection.html +11 -11
- data/doc/classes/Cachetastic/Connection.src/{M000044.html → M000054.html} +0 -0
- data/doc/classes/Cachetastic/Connection.src/{M000045.html → M000055.html} +0 -0
- data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +137 -0
- data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.src/M000006.html +18 -0
- data/doc/classes/Cachetastic/Logger.html +5 -5
- data/doc/classes/Cachetastic/Logger.src/{M000046.html → M000056.html} +0 -0
- data/doc/created.rid +1 -1
- data/doc/files/init_rb.html +18 -2
- data/doc/files/lib/adapters/cachetastic_adapters_base_rb.html +1 -1
- data/doc/files/lib/adapters/cachetastic_adapters_drb_rb.html +115 -0
- data/doc/files/lib/adapters/cachetastic_adapters_file_rb.html +1 -1
- data/doc/files/lib/adapters/cachetastic_adapters_local_memory_rb.html +1 -1
- data/doc/files/lib/caches/cachetastic_caches_base_rb.html +1 -1
- data/doc/files/lib/caches/cachetastic_caches_rails_session_cache_rb.html +1 -1
- data/doc/files/lib/cachetastic_rb.html +21 -3
- data/doc/files/lib/errors/cachetastic_errors_unsupported_adapter_rb.html +101 -0
- data/doc/fr_class_index.html +2 -0
- data/doc/fr_file_index.html +2 -0
- data/doc/fr_method_index.html +51 -41
- data/doc/index.html +1 -1
- data/lib/adapters/cachetastic_adapters_base.rb +1 -1
- data/lib/adapters/cachetastic_adapters_drb.rb +56 -0
- data/lib/cachetastic.rb +1 -0
- data/lib/tasks/rubyforge_config.yml +1 -1
- metadata +44 -27
- data/doc/classes/Cachetastic/Adapters/Base.src/M000023.html +0 -24
- data/doc/classes/Cachetastic/Adapters/Memcache.src/M000006.html +0 -19
- data/doc/classes/Cachetastic/Caches/Base.src/M000033.html +0 -43
- data/doc/classes/Cachetastic/Caches/Base.src/M000034.html +0 -23
- data/init.rb +0 -1
|
@@ -118,17 +118,19 @@ different for your cache.
|
|
|
118
118
|
<h3 class="section-bar">Methods</h3>
|
|
119
119
|
|
|
120
120
|
<div class="name-list">
|
|
121
|
-
<a href="#
|
|
122
|
-
<a href="#
|
|
123
|
-
<a href="#
|
|
124
|
-
<a href="#
|
|
125
|
-
<a href="#
|
|
126
|
-
<a href="#
|
|
127
|
-
<a href="#
|
|
128
|
-
<a href="#M000041">
|
|
129
|
-
<a href="#
|
|
130
|
-
<a href="#
|
|
131
|
-
<a href="#
|
|
121
|
+
<a href="#M000048">adapter</a>
|
|
122
|
+
<a href="#M000051">adapter_supported?</a>
|
|
123
|
+
<a href="#M000040">all_registered_caches</a>
|
|
124
|
+
<a href="#M000047">cache_name</a>
|
|
125
|
+
<a href="#M000052">calculate_expiry_time</a>
|
|
126
|
+
<a href="#M000043">delete</a>
|
|
127
|
+
<a href="#M000044">expire_all</a>
|
|
128
|
+
<a href="#M000041">get</a>
|
|
129
|
+
<a href="#M000049">logger</a>
|
|
130
|
+
<a href="#M000045">populate_all</a>
|
|
131
|
+
<a href="#M000042">set</a>
|
|
132
|
+
<a href="#M000046">stats</a>
|
|
133
|
+
<a href="#M000050">unsupported_adapters</a>
|
|
132
134
|
</div>
|
|
133
135
|
</div>
|
|
134
136
|
|
|
@@ -169,12 +171,12 @@ different for your cache.
|
|
|
169
171
|
<div id="methods">
|
|
170
172
|
<h3 class="section-bar">Public Class methods</h3>
|
|
171
173
|
|
|
172
|
-
<div id="method-
|
|
173
|
-
<a name="
|
|
174
|
+
<div id="method-M000048" class="method-detail">
|
|
175
|
+
<a name="M000048"></a>
|
|
174
176
|
|
|
175
177
|
<div class="method-heading">
|
|
176
|
-
<a href="Base.src/
|
|
177
|
-
onclick="popupCode('Base.src/
|
|
178
|
+
<a href="Base.src/M000048.html" target="Code" class="method-signature"
|
|
179
|
+
onclick="popupCode('Base.src/M000048.html');return false;">
|
|
178
180
|
<span class="method-name">adapter</span><span class="method-args">()</span>
|
|
179
181
|
</a>
|
|
180
182
|
</div>
|
|
@@ -188,12 +190,30 @@ cache.
|
|
|
188
190
|
</div>
|
|
189
191
|
</div>
|
|
190
192
|
|
|
191
|
-
<div id="method-
|
|
192
|
-
<a name="
|
|
193
|
+
<div id="method-M000051" class="method-detail">
|
|
194
|
+
<a name="M000051"></a>
|
|
193
195
|
|
|
194
196
|
<div class="method-heading">
|
|
195
|
-
<a href="Base.src/
|
|
196
|
-
onclick="popupCode('Base.src/
|
|
197
|
+
<a href="Base.src/M000051.html" target="Code" class="method-signature"
|
|
198
|
+
onclick="popupCode('Base.src/M000051.html');return false;">
|
|
199
|
+
<span class="method-name">adapter_supported?</span><span class="method-args">(a = cache_conn_instance.get(cache_name).class)</span>
|
|
200
|
+
</a>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div class="method-description">
|
|
204
|
+
<p>
|
|
205
|
+
Returns true/false on whether the <a href="Base.html#M000048">adapter</a>
|
|
206
|
+
you want to use is supported for the cache.
|
|
207
|
+
</p>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div id="method-M000040" class="method-detail">
|
|
212
|
+
<a name="M000040"></a>
|
|
213
|
+
|
|
214
|
+
<div class="method-heading">
|
|
215
|
+
<a href="Base.src/M000040.html" target="Code" class="method-signature"
|
|
216
|
+
onclick="popupCode('Base.src/M000040.html');return false;">
|
|
197
217
|
<span class="method-name">all_registered_caches</span><span class="method-args">()</span>
|
|
198
218
|
</a>
|
|
199
219
|
</div>
|
|
@@ -205,12 +225,12 @@ Returns a list of all registered caches in the system.
|
|
|
205
225
|
</div>
|
|
206
226
|
</div>
|
|
207
227
|
|
|
208
|
-
<div id="method-
|
|
209
|
-
<a name="
|
|
228
|
+
<div id="method-M000047" class="method-detail">
|
|
229
|
+
<a name="M000047"></a>
|
|
210
230
|
|
|
211
231
|
<div class="method-heading">
|
|
212
|
-
<a href="Base.src/
|
|
213
|
-
onclick="popupCode('Base.src/
|
|
232
|
+
<a href="Base.src/M000047.html" target="Code" class="method-signature"
|
|
233
|
+
onclick="popupCode('Base.src/M000047.html');return false;">
|
|
214
234
|
<span class="method-name">cache_name</span><span class="method-args">()</span>
|
|
215
235
|
</a>
|
|
216
236
|
</div>
|
|
@@ -228,12 +248,12 @@ href="../Connection.html">Cachetastic::Connection</a> class.
|
|
|
228
248
|
</div>
|
|
229
249
|
</div>
|
|
230
250
|
|
|
231
|
-
<div id="method-
|
|
232
|
-
<a name="
|
|
251
|
+
<div id="method-M000043" class="method-detail">
|
|
252
|
+
<a name="M000043"></a>
|
|
233
253
|
|
|
234
254
|
<div class="method-heading">
|
|
235
|
-
<a href="Base.src/
|
|
236
|
-
onclick="popupCode('Base.src/
|
|
255
|
+
<a href="Base.src/M000043.html" target="Code" class="method-signature"
|
|
256
|
+
onclick="popupCode('Base.src/M000043.html');return false;">
|
|
237
257
|
<span class="method-name">delete</span><span class="method-args">(key, delay = 0)</span>
|
|
238
258
|
</a>
|
|
239
259
|
</div>
|
|
@@ -242,18 +262,18 @@ href="../Connection.html">Cachetastic::Connection</a> class.
|
|
|
242
262
|
<p>
|
|
243
263
|
Deletes an object from the cache. The optional delay parameter sets an
|
|
244
264
|
offset, in seconds, for when the object should <a
|
|
245
|
-
href="Base.html#
|
|
265
|
+
href="Base.html#M000041">get</a> deleted. The default of 0 means the object
|
|
246
266
|
gets deleted right away.
|
|
247
267
|
</p>
|
|
248
268
|
</div>
|
|
249
269
|
</div>
|
|
250
270
|
|
|
251
|
-
<div id="method-
|
|
252
|
-
<a name="
|
|
271
|
+
<div id="method-M000044" class="method-detail">
|
|
272
|
+
<a name="M000044"></a>
|
|
253
273
|
|
|
254
274
|
<div class="method-heading">
|
|
255
|
-
<a href="Base.src/
|
|
256
|
-
onclick="popupCode('Base.src/
|
|
275
|
+
<a href="Base.src/M000044.html" target="Code" class="method-signature"
|
|
276
|
+
onclick="popupCode('Base.src/M000044.html');return false;">
|
|
257
277
|
<span class="method-name">expire_all</span><span class="method-args">()</span>
|
|
258
278
|
</a>
|
|
259
279
|
</div>
|
|
@@ -265,12 +285,12 @@ Expires all objects for this cache.
|
|
|
265
285
|
</div>
|
|
266
286
|
</div>
|
|
267
287
|
|
|
268
|
-
<div id="method-
|
|
269
|
-
<a name="
|
|
288
|
+
<div id="method-M000041" class="method-detail">
|
|
289
|
+
<a name="M000041"></a>
|
|
270
290
|
|
|
271
291
|
<div class="method-heading">
|
|
272
|
-
<a href="Base.src/
|
|
273
|
-
onclick="popupCode('Base.src/
|
|
292
|
+
<a href="Base.src/M000041.html" target="Code" class="method-signature"
|
|
293
|
+
onclick="popupCode('Base.src/M000041.html');return false;">
|
|
274
294
|
<span class="method-name">get</span><span class="method-args">(key) {|key if block_given?| ...}</span>
|
|
275
295
|
</a>
|
|
276
296
|
</div>
|
|
@@ -280,18 +300,18 @@ Expires all objects for this cache.
|
|
|
280
300
|
Returns an object from the cache for a given key. If the object comes back
|
|
281
301
|
as nil and a block is given that block will be run and the results of the
|
|
282
302
|
block will be run. This can be used to JIT caches, just make sure in the
|
|
283
|
-
block to call the <a href="Base.html#
|
|
303
|
+
block to call the <a href="Base.html#M000042">set</a> method because the
|
|
284
304
|
results of the block are not automatically cached.
|
|
285
305
|
</p>
|
|
286
306
|
</div>
|
|
287
307
|
</div>
|
|
288
308
|
|
|
289
|
-
<div id="method-
|
|
290
|
-
<a name="
|
|
309
|
+
<div id="method-M000049" class="method-detail">
|
|
310
|
+
<a name="M000049"></a>
|
|
291
311
|
|
|
292
312
|
<div class="method-heading">
|
|
293
|
-
<a href="Base.src/
|
|
294
|
-
onclick="popupCode('Base.src/
|
|
313
|
+
<a href="Base.src/M000049.html" target="Code" class="method-signature"
|
|
314
|
+
onclick="popupCode('Base.src/M000049.html');return false;">
|
|
295
315
|
<span class="method-name">logger</span><span class="method-args">()</span>
|
|
296
316
|
</a>
|
|
297
317
|
</div>
|
|
@@ -304,12 +324,12 @@ underlying <a href="../Adapters/Base.html">Cachetastic::Adapters::Base</a>.
|
|
|
304
324
|
</div>
|
|
305
325
|
</div>
|
|
306
326
|
|
|
307
|
-
<div id="method-
|
|
308
|
-
<a name="
|
|
327
|
+
<div id="method-M000045" class="method-detail">
|
|
328
|
+
<a name="M000045"></a>
|
|
309
329
|
|
|
310
330
|
<div class="method-heading">
|
|
311
|
-
<a href="Base.src/
|
|
312
|
-
onclick="popupCode('Base.src/
|
|
331
|
+
<a href="Base.src/M000045.html" target="Code" class="method-signature"
|
|
332
|
+
onclick="popupCode('Base.src/M000045.html');return false;">
|
|
313
333
|
<span class="method-name">populate_all</span><span class="method-args">()</span>
|
|
314
334
|
</a>
|
|
315
335
|
</div>
|
|
@@ -323,12 +343,12 @@ should be in there.
|
|
|
323
343
|
</div>
|
|
324
344
|
</div>
|
|
325
345
|
|
|
326
|
-
<div id="method-
|
|
327
|
-
<a name="
|
|
346
|
+
<div id="method-M000042" class="method-detail">
|
|
347
|
+
<a name="M000042"></a>
|
|
328
348
|
|
|
329
349
|
<div class="method-heading">
|
|
330
|
-
<a href="Base.src/
|
|
331
|
-
onclick="popupCode('Base.src/
|
|
350
|
+
<a href="Base.src/M000042.html" target="Code" class="method-signature"
|
|
351
|
+
onclick="popupCode('Base.src/M000042.html');return false;">
|
|
332
352
|
<span class="method-name">set</span><span class="method-args">(key, value, expiry = (adapter.all_options["default_expiry"] || 0))</span>
|
|
333
353
|
</a>
|
|
334
354
|
</div>
|
|
@@ -337,22 +357,22 @@ should be in there.
|
|
|
337
357
|
<p>
|
|
338
358
|
Set a particular object info the cache for the given key. An optional third
|
|
339
359
|
parameter sets the expiry time for the object in the cache. The default for
|
|
340
|
-
this expiry is <a href="Base.html#
|
|
360
|
+
this expiry is <a href="Base.html#M000042">set</a> as either 0, meaning it
|
|
341
361
|
never expires, or if there‘s a default_expiry time <a
|
|
342
|
-
href="Base.html#
|
|
343
|
-
used. If there is an expiry_swing <a href="Base.html#
|
|
362
|
+
href="Base.html#M000042">set</a> in the config file, that file will be
|
|
363
|
+
used. If there is an expiry_swing <a href="Base.html#M000042">set</a> in
|
|
344
364
|
the config file it will be +/- to the expiry time. See also: <a
|
|
345
|
-
href="Base.html#
|
|
365
|
+
href="Base.html#M000052">calculate_expiry_time</a>
|
|
346
366
|
</p>
|
|
347
367
|
</div>
|
|
348
368
|
</div>
|
|
349
369
|
|
|
350
|
-
<div id="method-
|
|
351
|
-
<a name="
|
|
370
|
+
<div id="method-M000046" class="method-detail">
|
|
371
|
+
<a name="M000046"></a>
|
|
352
372
|
|
|
353
373
|
<div class="method-heading">
|
|
354
|
-
<a href="Base.src/
|
|
355
|
-
onclick="popupCode('Base.src/
|
|
374
|
+
<a href="Base.src/M000046.html" target="Code" class="method-signature"
|
|
375
|
+
onclick="popupCode('Base.src/M000046.html');return false;">
|
|
356
376
|
<span class="method-name">stats</span><span class="method-args">()</span>
|
|
357
377
|
</a>
|
|
358
378
|
</div>
|
|
@@ -365,22 +385,42 @@ href="../Adapters/Base.html">Cachetastic::Adapters::Base</a> for the cache.
|
|
|
365
385
|
</div>
|
|
366
386
|
</div>
|
|
367
387
|
|
|
388
|
+
<div id="method-M000050" class="method-detail">
|
|
389
|
+
<a name="M000050"></a>
|
|
390
|
+
|
|
391
|
+
<div class="method-heading">
|
|
392
|
+
<a href="Base.src/M000050.html" target="Code" class="method-signature"
|
|
393
|
+
onclick="popupCode('Base.src/M000050.html');return false;">
|
|
394
|
+
<span class="method-name">unsupported_adapters</span><span class="method-args">()</span>
|
|
395
|
+
</a>
|
|
396
|
+
</div>
|
|
397
|
+
|
|
398
|
+
<div class="method-description">
|
|
399
|
+
<p>
|
|
400
|
+
Returns an array of unsupported adapters for this cache. Defaults to an
|
|
401
|
+
empty array which will let any <a href="Base.html#M000048">adapter</a> be
|
|
402
|
+
used by the cache. Override in your specific cache to prevent certain
|
|
403
|
+
adapters.
|
|
404
|
+
</p>
|
|
405
|
+
</div>
|
|
406
|
+
</div>
|
|
407
|
+
|
|
368
408
|
<h3 class="section-bar">Private Class methods</h3>
|
|
369
409
|
|
|
370
|
-
<div id="method-
|
|
371
|
-
<a name="
|
|
410
|
+
<div id="method-M000052" class="method-detail">
|
|
411
|
+
<a name="M000052"></a>
|
|
372
412
|
|
|
373
413
|
<div class="method-heading">
|
|
374
|
-
<a href="Base.src/
|
|
375
|
-
onclick="popupCode('Base.src/
|
|
414
|
+
<a href="Base.src/M000052.html" target="Code" class="method-signature"
|
|
415
|
+
onclick="popupCode('Base.src/M000052.html');return false;">
|
|
376
416
|
<span class="method-name">calculate_expiry_time</span><span class="method-args">(expiry)</span>
|
|
377
417
|
</a>
|
|
378
418
|
</div>
|
|
379
419
|
|
|
380
420
|
<div class="method-description">
|
|
381
421
|
<p>
|
|
382
|
-
If the expiry time is <a href="Base.html#
|
|
383
|
-
the expiry_swing time is <a href="Base.html#
|
|
422
|
+
If the expiry time is <a href="Base.html#M000042">set</a> to 60 minutes and
|
|
423
|
+
the expiry_swing time is <a href="Base.html#M000042">set</a> to 15 minutes,
|
|
384
424
|
this method will return a number between 45 minutes and 75 minutes.
|
|
385
425
|
</p>
|
|
386
426
|
</div>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>all_registered_caches (Cachetastic::Caches::Base)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 48</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all_registered_caches</span>
|
|
15
|
+
<span class="ruby-constant">RegisteredCaches</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">list</span>
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -5,14 +5,39 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>get (Cachetastic::Caches::Base)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-identifier">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 58</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
|
|
15
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">nil</span>
|
|
16
|
+
<span class="ruby-identifier">do_with_logging</span>(<span class="ruby-identifier">:get</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
|
|
17
|
+
<span class="ruby-identifier">retryable</span>(<span class="ruby-identifier">:on</span> =<span class="ruby-operator">></span> <span class="ruby-constant">ArgumentError</span>) <span class="ruby-keyword kw">do</span>
|
|
18
|
+
<span class="ruby-keyword kw">begin</span>
|
|
19
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>)
|
|
20
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">nil?</span>
|
|
21
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">key</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
|
22
|
+
<span class="ruby-keyword kw">else</span>
|
|
23
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">unmarshall</span>(<span class="ruby-identifier">res</span>)
|
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
|
25
|
+
<span class="ruby-identifier">res</span>
|
|
26
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">ArgumentError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
|
27
|
+
<span class="ruby-identifier">m</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/class\/module .*/</span>)
|
|
28
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">m</span>
|
|
29
|
+
<span class="ruby-identifier">m</span> = <span class="ruby-identifier">m</span>.<span class="ruby-identifier">to_s</span>
|
|
30
|
+
<span class="ruby-identifier">m</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">"class/module"</span>, <span class="ruby-value str">''</span>)
|
|
31
|
+
<span class="ruby-identifier">m</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-value str">"(ArgumentError)"</span>, <span class="ruby-value str">''</span>)
|
|
32
|
+
<span class="ruby-identifier">require</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">underscore</span>
|
|
33
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
|
|
34
|
+
<span class="ruby-keyword kw">end</span>
|
|
35
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
|
36
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
|
|
37
|
+
<span class="ruby-keyword kw">end</span>
|
|
38
|
+
<span class="ruby-keyword kw">end</span>
|
|
39
|
+
<span class="ruby-keyword kw">end</span>
|
|
40
|
+
<span class="ruby-identifier">res</span>
|
|
16
41
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
42
|
</body>
|
|
18
43
|
</html>
|
|
@@ -5,24 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>set (Cachetastic::Caches::Base)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-identifier">
|
|
16
|
-
|
|
17
|
-
<span class="ruby-identifier">
|
|
18
|
-
<span class="ruby-
|
|
19
|
-
<span class="ruby-
|
|
20
|
-
<span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">swing</span>)
|
|
21
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
|
|
22
|
-
<span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">swing</span>)
|
|
23
|
-
<span class="ruby-keyword kw">end</span>
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 94</span>
|
|
14
|
+
<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-identifier">adapter</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">"default_expiry"</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>))
|
|
15
|
+
<span class="ruby-identifier">do_with_logging</span>(<span class="ruby-identifier">:set</span>, <span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
|
|
16
|
+
<span class="ruby-identifier">expiry</span> = <span class="ruby-identifier">calculate_expiry_time</span>(<span class="ruby-identifier">expiry</span>)
|
|
17
|
+
<span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">marshall</span>(<span class="ruby-identifier">value</span>), <span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span>)
|
|
18
|
+
<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">''</span>, <span class="ruby-value str">''</span>, <span class="ruby-identifier">:expiry</span>, <span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span>)
|
|
19
|
+
<span class="ruby-identifier">value</span>
|
|
24
20
|
<span class="ruby-keyword kw">end</span>
|
|
25
|
-
<span class="ruby-identifier">expiry</span>
|
|
26
21
|
<span class="ruby-keyword kw">end</span></pre>
|
|
27
22
|
</body>
|
|
28
23
|
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>adapter (Cachetastic::Caches::Base)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 141</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">adapter</span>
|
|
15
|
+
<span class="ruby-identifier">a</span> = <span class="ruby-identifier">cache_conn_instance</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">cache_name</span>)
|
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">adapter_supported?</span>(<span class="ruby-identifier">a</span>.<span class="ruby-identifier">class</span>)
|
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">a</span>
|
|
18
|
+
<span class="ruby-keyword kw">else</span>
|
|
19
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">UnsupportedAdapter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">a</span>.<span class="ruby-identifier">class</span>)
|
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>logger (Cachetastic::Caches::Base)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 151</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
|
|
15
|
+
<span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">logger</span>
|
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>unsupported_adapters (Cachetastic::Caches::Base)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 158</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unsupported_adapters</span>
|
|
15
|
+
[]
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>adapter_supported? (Cachetastic::Caches::Base)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 163</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">adapter_supported?</span>(<span class="ruby-identifier">a</span> = <span class="ruby-identifier">cache_conn_instance</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">cache_name</span>).<span class="ruby-identifier">class</span>)
|
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-identifier">unsupported_adapters</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">a</span>)
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,28 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>calculate_expiry_time (Cachetastic::Caches::Base)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_base.rb, line 170</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calculate_expiry_time</span>(<span class="ruby-identifier">expiry</span>) <span class="ruby-comment cmt"># :doc:</span>
|
|
15
|
+
<span class="ruby-identifier">exp_swing</span> = <span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">all_options</span>[<span class="ruby-value str">"expiry_swing"</span>]
|
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp_swing</span>
|
|
17
|
+
<span class="ruby-identifier">swing</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">exp_swing</span>.<span class="ruby-identifier">to_i</span>)
|
|
18
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>)
|
|
19
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
|
|
20
|
+
<span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">swing</span>)
|
|
21
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
|
|
22
|
+
<span class="ruby-identifier">expiry</span> = (<span class="ruby-identifier">expiry</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">swing</span>)
|
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
|
25
|
+
<span class="ruby-identifier">expiry</span>
|
|
26
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
|
@@ -90,6 +90,13 @@ Used for storing Rails sessions.
|
|
|
90
90
|
|
|
91
91
|
</div>
|
|
92
92
|
|
|
93
|
+
<div id="method-list">
|
|
94
|
+
<h3 class="section-bar">Methods</h3>
|
|
95
|
+
|
|
96
|
+
<div class="name-list">
|
|
97
|
+
<a href="#M000039">unsupported_adapters</a>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
93
100
|
|
|
94
101
|
</div>
|
|
95
102
|
|
|
@@ -106,6 +113,25 @@ Used for storing Rails sessions.
|
|
|
106
113
|
|
|
107
114
|
|
|
108
115
|
<!-- if method_list -->
|
|
116
|
+
<div id="methods">
|
|
117
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
118
|
+
|
|
119
|
+
<div id="method-M000039" class="method-detail">
|
|
120
|
+
<a name="M000039"></a>
|
|
121
|
+
|
|
122
|
+
<div class="method-heading">
|
|
123
|
+
<a href="RailsSessionCache.src/M000039.html" target="Code" class="method-signature"
|
|
124
|
+
onclick="popupCode('RailsSessionCache.src/M000039.html');return false;">
|
|
125
|
+
<span class="method-name">unsupported_adapters</span><span class="method-args">()</span>
|
|
126
|
+
</a>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<div class="method-description">
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
</div>
|
|
109
135
|
|
|
110
136
|
|
|
111
137
|
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
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>
|
|
7
|
+
<head>
|
|
8
|
+
<title>unsupported_adapters (Cachetastic::Caches::RailsSessionCache)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/caches/cachetastic_caches_rails_session_cache.rb, line 6</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unsupported_adapters</span>
|
|
15
|
+
[<span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Adapters</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>]
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|