cachetastic 1.1.3 → 1.1.8
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 +3 -1
- data/doc/classes/ActiveRecord/Base.html +22 -2
- data/doc/classes/ActiveRecord/Base.src/M000001.html +1 -1
- data/doc/classes/ActiveRecord/Base.src/M000002.html +1 -1
- data/doc/classes/ActiveRecord/Base.src/M000003.html +1 -1
- data/doc/classes/ActiveRecord/Base.src/M000004.html +1 -1
- data/doc/classes/ActiveRecord/Base.src/M000005.html +1 -1
- data/doc/classes/{Cachetastic/Stores.html → CGI/Session/CachetasticStore.html} +23 -14
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +17 -6
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.src/{M000044.html → M000043.html} +1 -1
- data/doc/classes/Cachetastic/Caches/Base.html +148 -54
- data/doc/classes/Cachetastic/Caches/Base.src/{M000043.html → M000032.html} +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000033.html +14 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000034.html +9 -6
- data/doc/classes/Cachetastic/Caches/Base.src/M000035.html +5 -13
- data/doc/classes/Cachetastic/Caches/Base.src/M000036.html +5 -18
- data/doc/classes/Cachetastic/Caches/Base.src/M000037.html +4 -6
- data/doc/classes/Cachetastic/Caches/Base.src/M000038.html +4 -5
- data/doc/classes/Cachetastic/Caches/Base.src/M000039.html +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000040.html +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000041.html +4 -4
- data/doc/classes/Cachetastic/Caches/Base.src/M000042.html +14 -4
- data/doc/classes/Cachetastic/Caches/PageCache.html +8 -0
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +6 -0
- data/doc/classes/Cachetastic/Connection.html +14 -14
- data/doc/classes/Cachetastic/Connection.src/M000044.html +18 -0
- data/doc/classes/Cachetastic/Connection.src/M000045.html +10 -4
- data/doc/classes/Cachetastic/Logger.html +5 -5
- data/doc/classes/Cachetastic/Stores/Base.html +68 -45
- data/doc/classes/Cachetastic/Stores/Base.src/{M000028.html → M000023.html} +1 -1
- data/doc/classes/Cachetastic/Stores/Base.src/{M000030.html → M000024.html} +1 -1
- data/doc/classes/Cachetastic/Stores/Base.src/{M000032.html → M000025.html} +1 -1
- data/doc/classes/Cachetastic/Stores/File.html +265 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000026.html +18 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000027.html +20 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000028.html +19 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000029.html +33 -0
- data/doc/classes/Cachetastic/Stores/File.src/M000030.html +21 -0
- data/doc/classes/Cachetastic/Stores/{LocalMemory.src/M000025.html → File.src/M000031.html} +3 -3
- data/doc/classes/Cachetastic/Stores/LocalMemory.html +41 -36
- data/doc/classes/Cachetastic/Stores/{Base.src/M000029.html → LocalMemory.src/M000017.html} +3 -3
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000018.html +18 -0
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000019.html +18 -0
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000020.html +12 -4
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000021.html +4 -4
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000022.html +11 -4
- data/doc/classes/Cachetastic/Stores/Memcache.html +85 -59
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000006.html +19 -0
- data/doc/classes/Cachetastic/Stores/{LocalMemory.src/M000024.html → Memcache.src/M000007.html} +3 -3
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000008.html +18 -0
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000009.html +4 -5
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000010.html +4 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000011.html +4 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000012.html +10 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000013.html +5 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000014.html +6 -4
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000015.html +6 -5
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000016.html +9 -9
- data/doc/created.rid +1 -1
- data/doc/files/init_rb.html +111 -1
- data/doc/files/lib/caches/cachetastic_caches_base_rb.html +1 -1
- data/doc/files/lib/caches/cachetastic_caches_page_cache_rb.html +9 -1
- data/doc/files/lib/caches/cachetastic_caches_rails_session_cache_rb.html +7 -1
- data/doc/files/lib/cachetastic_connection_rb.html +1 -1
- data/doc/files/lib/cachetastic_rb.html +6 -2
- data/doc/files/lib/helpers/cachetastic_helpers_active_record_rb.html +1 -1
- data/doc/files/lib/rails_extensions/cachetastic_active_record_base_rb.html +1 -1
- data/doc/files/lib/rails_extensions/cgi_session_cachetastic_store_rb.html +1 -1
- data/doc/files/lib/stores/cachetastic_stores_base_rb.html +39 -1
- data/doc/{classes/ActiveRecord.html → files/lib/stores/cachetastic_stores_file_rb.html} +36 -22
- data/doc/files/lib/stores/cachetastic_stores_local_memory_rb.html +9 -1
- data/doc/files/lib/stores/cachetastic_stores_memcache_rb.html +27 -1
- data/doc/{classes/Cachetastic/Caches/ActiveRecord.html → files/lib/stores/cachetastic_stores_store_object_rb.html} +15 -19
- data/doc/fr_class_index.html +2 -8
- data/doc/fr_file_index.html +2 -0
- data/doc/fr_method_index.html +41 -42
- data/doc/index.html +2 -2
- data/init.rb +1 -0
- data/lib/caches/cachetastic_caches_base.rb +81 -18
- data/lib/caches/cachetastic_caches_page_cache.rb +4 -0
- data/lib/caches/cachetastic_caches_rails_session_cache.rb +1 -0
- data/lib/cachetastic.rb +10 -6
- data/lib/cachetastic_connection.rb +2 -2
- data/lib/helpers/cachetastic_helpers_active_record.rb +12 -1
- data/lib/rails_extensions/cachetastic_active_record_base.rb +10 -0
- data/lib/rails_extensions/cgi_session_cachetastic_store.rb +15 -10
- data/lib/stores/cachetastic_stores_base.rb +33 -13
- data/lib/stores/cachetastic_stores_file.rb +101 -0
- data/lib/stores/cachetastic_stores_local_memory.rb +6 -27
- data/lib/stores/cachetastic_stores_memcache.rb +24 -5
- data/lib/stores/cachetastic_stores_store_object.rb +28 -0
- data/lib/tasks/rubyforge_config.yml +1 -1
- metadata +28 -32
- data/doc/classes/Cachetastic/Caches.html +0 -114
- data/doc/classes/Cachetastic/Connection.src/M000046.html +0 -24
- data/doc/classes/Cachetastic/Helpers/ActiveRecord.html +0 -165
- data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000006.html +0 -29
- data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000007.html +0 -23
- data/doc/classes/Cachetastic/Helpers/ActiveRecord.src/M000008.html +0 -18
- data/doc/classes/Cachetastic/Helpers.html +0 -115
- data/doc/classes/Cachetastic/Stores/Base.src/M000031.html +0 -22
- data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.html +0 -177
- data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.src/M000026.html +0 -27
- data/doc/classes/Cachetastic/Stores/LocalMemory/StoreObject.src/M000027.html +0 -19
- data/doc/classes/Cachetastic/Stores/LocalMemory.src/M000023.html +0 -26
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000017.html +0 -20
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000018.html +0 -20
- data/doc/classes/Cachetastic/Stores/Memcache.src/M000019.html +0 -24
- data/doc/classes/Cachetastic.html +0 -119
- /data/doc/classes/Cachetastic/Logger.src/{M000047.html → M000046.html} +0 -0
|
@@ -10,7 +10,7 @@
|
|
|
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/stores/cachetastic_stores_base.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/stores/cachetastic_stores_base.rb, line 42</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug?</span>
|
|
15
15
|
<span class="ruby-identifier">ivar_cache</span>(<span class="ruby-identifier">:debug</span>) <span class="ruby-keyword kw">do</span>
|
|
16
16
|
(<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>)
|
|
@@ -10,7 +10,7 @@
|
|
|
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/stores/cachetastic_stores_base.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/stores/cachetastic_stores_base.rb, line 56</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_options</span>(<span class="ruby-identifier">name</span>)
|
|
15
15
|
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">app_config</span>.<span class="ruby-identifier">cachetastic_default_options</span>
|
|
16
16
|
<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> {})
|
|
@@ -0,0 +1,265 @@
|
|
|
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::Stores::File</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::Stores::File</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../../files/lib/stores/cachetastic_stores_file_rb.html">
|
|
59
|
+
lib/stores/cachetastic_stores_file.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="Base.html">
|
|
69
|
+
Cachetastic::Stores::Base
|
|
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 store uses the file system as it‘s backing. The configuration
|
|
86
|
+
for this should look something like this:
|
|
87
|
+
</p>
|
|
88
|
+
<pre>
|
|
89
|
+
my_awesome_cache_options:
|
|
90
|
+
debug: false
|
|
91
|
+
store: file
|
|
92
|
+
marshall_method: none
|
|
93
|
+
default_expiry: <%= 24.hours %>
|
|
94
|
+
store_options:
|
|
95
|
+
dir: /usr/local/caches/
|
|
96
|
+
logging:
|
|
97
|
+
logger_1:
|
|
98
|
+
type: file
|
|
99
|
+
file: log/file_store_cache.log
|
|
100
|
+
</pre>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div id="method-list">
|
|
108
|
+
<h3 class="section-bar">Methods</h3>
|
|
109
|
+
|
|
110
|
+
<div class="name-list">
|
|
111
|
+
<a href="#M000031">delete</a>
|
|
112
|
+
<a href="#M000028">expire_all</a>
|
|
113
|
+
<a href="#M000029">get</a>
|
|
114
|
+
<a href="#M000030">set</a>
|
|
115
|
+
<a href="#M000027">setup</a>
|
|
116
|
+
<a href="#M000026">valid?</a>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<!-- if includes -->
|
|
124
|
+
|
|
125
|
+
<div id="section">
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
<div id="constants-list">
|
|
129
|
+
<h3 class="section-bar">Constants</h3>
|
|
130
|
+
|
|
131
|
+
<div class="name-list">
|
|
132
|
+
<table summary="Constants">
|
|
133
|
+
<tr class="top-aligned-row context-row">
|
|
134
|
+
<td class="context-item-name">STORE_FILE_NAME</td>
|
|
135
|
+
<td>=</td>
|
|
136
|
+
<td class="context-item-value">"cache.yml"</td>
|
|
137
|
+
</tr>
|
|
138
|
+
</table>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
<div id="attribute-list">
|
|
145
|
+
<h3 class="section-bar">Attributes</h3>
|
|
146
|
+
|
|
147
|
+
<div class="name-list">
|
|
148
|
+
<table>
|
|
149
|
+
<tr class="top-aligned-row context-row">
|
|
150
|
+
<td class="context-item-name">directory</td>
|
|
151
|
+
<td class="context-item-value"> [R] </td>
|
|
152
|
+
<td class="context-item-desc"></td>
|
|
153
|
+
</tr>
|
|
154
|
+
<tr class="top-aligned-row context-row">
|
|
155
|
+
<td class="context-item-name">hashed_keys</td>
|
|
156
|
+
<td class="context-item-value"> [R] </td>
|
|
157
|
+
<td class="context-item-desc"></td>
|
|
158
|
+
</tr>
|
|
159
|
+
</table>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
<!-- if method_list -->
|
|
166
|
+
<div id="methods">
|
|
167
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
168
|
+
|
|
169
|
+
<div id="method-M000031" class="method-detail">
|
|
170
|
+
<a name="M000031"></a>
|
|
171
|
+
|
|
172
|
+
<div class="method-heading">
|
|
173
|
+
<a href="File.src/M000031.html" target="Code" class="method-signature"
|
|
174
|
+
onclick="popupCode('File.src/M000031.html');return false;">
|
|
175
|
+
<span class="method-name">delete</span><span class="method-args">(key, delay = 0)</span>
|
|
176
|
+
</a>
|
|
177
|
+
</div>
|
|
178
|
+
|
|
179
|
+
<div class="method-description">
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div id="method-M000028" class="method-detail">
|
|
184
|
+
<a name="M000028"></a>
|
|
185
|
+
|
|
186
|
+
<div class="method-heading">
|
|
187
|
+
<a href="File.src/M000028.html" target="Code" class="method-signature"
|
|
188
|
+
onclick="popupCode('File.src/M000028.html');return false;">
|
|
189
|
+
<span class="method-name">expire_all</span><span class="method-args">()</span>
|
|
190
|
+
</a>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<div class="method-description">
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<div id="method-M000029" class="method-detail">
|
|
198
|
+
<a name="M000029"></a>
|
|
199
|
+
|
|
200
|
+
<div class="method-heading">
|
|
201
|
+
<a href="File.src/M000029.html" target="Code" class="method-signature"
|
|
202
|
+
onclick="popupCode('File.src/M000029.html');return false;">
|
|
203
|
+
<span class="method-name">get</span><span class="method-args">(key)</span>
|
|
204
|
+
</a>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<div class="method-description">
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div id="method-M000030" class="method-detail">
|
|
212
|
+
<a name="M000030"></a>
|
|
213
|
+
|
|
214
|
+
<div class="method-heading">
|
|
215
|
+
<a href="File.src/M000030.html" target="Code" class="method-signature"
|
|
216
|
+
onclick="popupCode('File.src/M000030.html');return false;">
|
|
217
|
+
<span class="method-name">set</span><span class="method-args">(key, value, expiry = 0)</span>
|
|
218
|
+
</a>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div class="method-description">
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div id="method-M000027" class="method-detail">
|
|
226
|
+
<a name="M000027"></a>
|
|
227
|
+
|
|
228
|
+
<div class="method-heading">
|
|
229
|
+
<a href="File.src/M000027.html" target="Code" class="method-signature"
|
|
230
|
+
onclick="popupCode('File.src/M000027.html');return false;">
|
|
231
|
+
<span class="method-name">setup</span><span class="method-args">()</span>
|
|
232
|
+
</a>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<div class="method-description">
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<div id="method-M000026" class="method-detail">
|
|
240
|
+
<a name="M000026"></a>
|
|
241
|
+
|
|
242
|
+
<div class="method-heading">
|
|
243
|
+
<a href="File.src/M000026.html" target="Code" class="method-signature"
|
|
244
|
+
onclick="popupCode('File.src/M000026.html');return false;">
|
|
245
|
+
<span class="method-name">valid?</span><span class="method-args">()</span>
|
|
246
|
+
</a>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div class="method-description">
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
<div id="validator-badges">
|
|
261
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
</body>
|
|
265
|
+
</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>valid? (Cachetastic::Stores::File)</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/stores/cachetastic_stores_file.rb, line 19</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
|
|
15
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">directory</span>)
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
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>setup (Cachetastic::Stores::File)</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/stores/cachetastic_stores_file.rb, line 23</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
|
15
|
+
<span class="ruby-ivar">@directory</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">store_options</span>[<span class="ruby-value str">"dir"</span>], <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
|
|
16
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debug?</span>)
|
|
17
|
+
<span class="ruby-ivar">@hashed_keys</span> = {}
|
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
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>expire_all (Cachetastic::Stores::File)</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/stores/cachetastic_stores_file.rb, line 29</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
|
15
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debug?</span>)
|
|
16
|
+
<span class="ruby-identifier">setup</span>
|
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
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>get (Cachetastic::Stores::File)</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/stores/cachetastic_stores_file.rb, line 34</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">full_path</span> = <span class="ruby-identifier">full_path_from_dir</span>(<span class="ruby-identifier">get_key_directoy</span>(<span class="ruby-identifier">key</span>, <span class="ruby-keyword kw">false</span>))
|
|
16
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">full_path</span>)
|
|
17
|
+
<span class="ruby-identifier">so</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">full_path</span>).<span class="ruby-identifier">read</span>)
|
|
18
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">so</span>
|
|
19
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">so</span>.<span class="ruby-identifier">invalid?</span>
|
|
20
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
|
|
21
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
|
23
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">so</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>)
|
|
24
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-node">"require #{so.value.class.underscore}"</span>
|
|
25
|
+
<span class="ruby-identifier">require</span> <span class="ruby-identifier">so</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">underscore</span>
|
|
26
|
+
<span class="ruby-identifier">so</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">full_path</span>).<span class="ruby-identifier">read</span>)
|
|
27
|
+
<span class="ruby-keyword kw">end</span>
|
|
28
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">so</span>.<span class="ruby-identifier">value</span>
|
|
29
|
+
<span class="ruby-keyword kw">end</span>
|
|
30
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
|
31
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
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>set (Cachetastic::Stores::File)</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/stores/cachetastic_stores_file.rb, line 53</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-value">0</span>)
|
|
15
|
+
<span class="ruby-identifier">so</span> = <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Stores</span><span class="ruby-operator">::</span><span class="ruby-constant">StoreObject</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">expiry</span>)
|
|
16
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">full_path_from_key</span>(<span class="ruby-identifier">key</span>), <span class="ruby-value str">"w"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
|
17
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">so</span>)
|
|
18
|
+
<span class="ruby-keyword kw">end</span>
|
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>delete (Cachetastic::Stores::
|
|
8
|
+
<title>delete (Cachetastic::Stores::File)</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/stores/
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/stores/cachetastic_stores_file.rb, line 60</span>
|
|
14
14
|
<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>)
|
|
15
15
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">delay</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
|
16
|
-
<span class="ruby-
|
|
16
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">get_key_directoy</span>(<span class="ruby-identifier">key</span>), <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debug?</span>)
|
|
17
17
|
<span class="ruby-keyword kw">else</span>
|
|
18
18
|
<span class="ruby-identifier">so</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
|
|
19
19
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">so</span>
|
|
@@ -80,6 +80,14 @@
|
|
|
80
80
|
|
|
81
81
|
<div id="contextContent">
|
|
82
82
|
|
|
83
|
+
<div id="description">
|
|
84
|
+
<p>
|
|
85
|
+
A store that keeps objects in local memory. This is great for
|
|
86
|
+
development/testing, but probably shouldn‘t be put into production.
|
|
87
|
+
It‘s also a very good example of how to write a store.
|
|
88
|
+
</p>
|
|
89
|
+
|
|
90
|
+
</div>
|
|
83
91
|
|
|
84
92
|
|
|
85
93
|
</div>
|
|
@@ -88,12 +96,12 @@
|
|
|
88
96
|
<h3 class="section-bar">Methods</h3>
|
|
89
97
|
|
|
90
98
|
<div class="name-list">
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
95
|
-
<a href="#
|
|
96
|
-
<a href="#
|
|
99
|
+
<a href="#M000022">delete</a>
|
|
100
|
+
<a href="#M000019">expire_all</a>
|
|
101
|
+
<a href="#M000020">get</a>
|
|
102
|
+
<a href="#M000021">set</a>
|
|
103
|
+
<a href="#M000018">setup</a>
|
|
104
|
+
<a href="#M000017">valid?</a>
|
|
97
105
|
</div>
|
|
98
106
|
</div>
|
|
99
107
|
|
|
@@ -104,12 +112,6 @@
|
|
|
104
112
|
|
|
105
113
|
<div id="section">
|
|
106
114
|
|
|
107
|
-
<div id="class-list">
|
|
108
|
-
<h3 class="section-bar">Classes and Modules</h3>
|
|
109
|
-
|
|
110
|
-
Class <a href="LocalMemory/StoreObject.html" class="link">Cachetastic::Stores::LocalMemory::StoreObject</a><br />
|
|
111
|
-
|
|
112
|
-
</div>
|
|
113
115
|
|
|
114
116
|
|
|
115
117
|
|
|
@@ -134,12 +136,12 @@
|
|
|
134
136
|
<div id="methods">
|
|
135
137
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
136
138
|
|
|
137
|
-
<div id="method-
|
|
138
|
-
<a name="
|
|
139
|
+
<div id="method-M000022" class="method-detail">
|
|
140
|
+
<a name="M000022"></a>
|
|
139
141
|
|
|
140
142
|
<div class="method-heading">
|
|
141
|
-
<a href="LocalMemory.src/
|
|
142
|
-
onclick="popupCode('LocalMemory.src/
|
|
143
|
+
<a href="LocalMemory.src/M000022.html" target="Code" class="method-signature"
|
|
144
|
+
onclick="popupCode('LocalMemory.src/M000022.html');return false;">
|
|
143
145
|
<span class="method-name">delete</span><span class="method-args">(key, delay = 0)</span>
|
|
144
146
|
</a>
|
|
145
147
|
</div>
|
|
@@ -148,12 +150,12 @@
|
|
|
148
150
|
</div>
|
|
149
151
|
</div>
|
|
150
152
|
|
|
151
|
-
<div id="method-
|
|
152
|
-
<a name="
|
|
153
|
+
<div id="method-M000019" class="method-detail">
|
|
154
|
+
<a name="M000019"></a>
|
|
153
155
|
|
|
154
156
|
<div class="method-heading">
|
|
155
|
-
<a href="LocalMemory.src/
|
|
156
|
-
onclick="popupCode('LocalMemory.src/
|
|
157
|
+
<a href="LocalMemory.src/M000019.html" target="Code" class="method-signature"
|
|
158
|
+
onclick="popupCode('LocalMemory.src/M000019.html');return false;">
|
|
157
159
|
<span class="method-name">expire_all</span><span class="method-args">()</span>
|
|
158
160
|
</a>
|
|
159
161
|
</div>
|
|
@@ -162,26 +164,29 @@
|
|
|
162
164
|
</div>
|
|
163
165
|
</div>
|
|
164
166
|
|
|
165
|
-
<div id="method-
|
|
166
|
-
<a name="
|
|
167
|
+
<div id="method-M000020" class="method-detail">
|
|
168
|
+
<a name="M000020"></a>
|
|
167
169
|
|
|
168
170
|
<div class="method-heading">
|
|
169
|
-
<a href="LocalMemory.src/
|
|
170
|
-
onclick="popupCode('LocalMemory.src/
|
|
171
|
+
<a href="LocalMemory.src/M000020.html" target="Code" class="method-signature"
|
|
172
|
+
onclick="popupCode('LocalMemory.src/M000020.html');return false;">
|
|
171
173
|
<span class="method-name">get</span><span class="method-args">(key)</span>
|
|
172
174
|
</a>
|
|
173
175
|
</div>
|
|
174
176
|
|
|
175
177
|
<div class="method-description">
|
|
178
|
+
<p>
|
|
179
|
+
See <a href="Base.html">Cachetastic::Stores::Base</a>
|
|
180
|
+
</p>
|
|
176
181
|
</div>
|
|
177
182
|
</div>
|
|
178
183
|
|
|
179
|
-
<div id="method-
|
|
180
|
-
<a name="
|
|
184
|
+
<div id="method-M000021" class="method-detail">
|
|
185
|
+
<a name="M000021"></a>
|
|
181
186
|
|
|
182
187
|
<div class="method-heading">
|
|
183
|
-
<a href="LocalMemory.src/
|
|
184
|
-
onclick="popupCode('LocalMemory.src/
|
|
188
|
+
<a href="LocalMemory.src/M000021.html" target="Code" class="method-signature"
|
|
189
|
+
onclick="popupCode('LocalMemory.src/M000021.html');return false;">
|
|
185
190
|
<span class="method-name">set</span><span class="method-args">(key, value, expiry = 0)</span>
|
|
186
191
|
</a>
|
|
187
192
|
</div>
|
|
@@ -190,12 +195,12 @@
|
|
|
190
195
|
</div>
|
|
191
196
|
</div>
|
|
192
197
|
|
|
193
|
-
<div id="method-
|
|
194
|
-
<a name="
|
|
198
|
+
<div id="method-M000018" class="method-detail">
|
|
199
|
+
<a name="M000018"></a>
|
|
195
200
|
|
|
196
201
|
<div class="method-heading">
|
|
197
|
-
<a href="LocalMemory.src/
|
|
198
|
-
onclick="popupCode('LocalMemory.src/
|
|
202
|
+
<a href="LocalMemory.src/M000018.html" target="Code" class="method-signature"
|
|
203
|
+
onclick="popupCode('LocalMemory.src/M000018.html');return false;">
|
|
199
204
|
<span class="method-name">setup</span><span class="method-args">()</span>
|
|
200
205
|
</a>
|
|
201
206
|
</div>
|
|
@@ -204,12 +209,12 @@
|
|
|
204
209
|
</div>
|
|
205
210
|
</div>
|
|
206
211
|
|
|
207
|
-
<div id="method-
|
|
208
|
-
<a name="
|
|
212
|
+
<div id="method-M000017" class="method-detail">
|
|
213
|
+
<a name="M000017"></a>
|
|
209
214
|
|
|
210
215
|
<div class="method-heading">
|
|
211
|
-
<a href="LocalMemory.src/
|
|
212
|
-
onclick="popupCode('LocalMemory.src/
|
|
216
|
+
<a href="LocalMemory.src/M000017.html" target="Code" class="method-signature"
|
|
217
|
+
onclick="popupCode('LocalMemory.src/M000017.html');return false;">
|
|
213
218
|
<span class="method-name">valid?</span><span class="method-args">()</span>
|
|
214
219
|
</a>
|
|
215
220
|
</div>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>valid? (Cachetastic::Stores::
|
|
8
|
+
<title>valid? (Cachetastic::Stores::LocalMemory)</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/stores/
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/stores/cachetastic_stores_local_memory.rb, line 8</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
|
|
15
|
-
<span class="ruby-keyword kw">
|
|
15
|
+
<span class="ruby-keyword kw">true</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>setup (Cachetastic::Stores::LocalMemory)</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/stores/cachetastic_stores_local_memory.rb, line 12</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">local_store</span> = {}
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|