cachetastic 2.1.4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +21 -0
- data/README +57 -43
- data/doc/classes/Cachetastic/Adapters.html +180 -0
- data/doc/classes/Cachetastic/Adapters/Base.html +206 -123
- data/doc/classes/Cachetastic/Adapters/File.html +17 -130
- data/doc/classes/Cachetastic/Adapters/LocalMemory.html +7 -228
- data/doc/classes/Cachetastic/Adapters/Memcached.html +193 -0
- data/doc/classes/Cachetastic/Cache.html +425 -0
- data/doc/classes/Cachetastic/Cacheable.html +26 -30
- data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +66 -62
- data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +30 -30
- data/doc/classes/Cachetastic/Logger.html +31 -33
- data/doc/created.rid +1 -1
- data/doc/files/{lib/cachetastic/adapters/html_file_rb.html → LICENSE.html} +29 -34
- data/doc/files/README.html +91 -57
- data/doc/files/lib/cachetastic/adapters/base_rb.html +1 -39
- data/doc/files/lib/cachetastic/adapters/file_rb.html +1 -21
- data/doc/files/lib/cachetastic/adapters/local_memory_rb.html +1 -9
- data/doc/files/lib/cachetastic/{ruby_extensions/kernel_rb.html → adapters/memcached_rb.html} +4 -4
- data/doc/files/lib/cachetastic/{ruby_extensions/string_rb.html → cache_rb.html} +5 -5
- data/doc/files/lib/cachetastic/cacheable_rb.html +1 -1
- data/doc/files/lib/cachetastic/{caches/base_rb.html → extensions/string_rb.html} +5 -5
- data/doc/files/lib/cachetastic/logger_rb.html +1 -7
- data/doc/files/lib/cachetastic/{adapters/store_object_rb.html → store_object_rb.html} +3 -3
- data/doc/files/lib/cachetastic_rb.html +4 -95
- data/doc/fr_class_index.html +3 -15
- data/doc/fr_file_index.html +5 -16
- data/doc/fr_method_index.html +26 -78
- data/lib/cachetastic.rb +16 -70
- data/lib/cachetastic/adapters/base.rb +178 -76
- data/lib/cachetastic/adapters/file.rb +63 -46
- data/lib/cachetastic/adapters/local_memory.rb +36 -67
- data/lib/cachetastic/adapters/memcached.rb +114 -0
- data/lib/cachetastic/cache.rb +165 -0
- data/lib/cachetastic/cacheable.rb +19 -15
- data/lib/cachetastic/extensions/string.rb +8 -0
- data/lib/cachetastic/logger.rb +41 -41
- data/lib/cachetastic/store_object.rb +22 -0
- metadata +43 -64
- data/bin/cachetastic_drb_server +0 -115
- data/doc/classes/ActiveRecord/Base.html +0 -194
- data/doc/classes/CGI/Session/CachetasticStore.html +0 -124
- data/doc/classes/Cachetastic/Adapters/Drb.html +0 -332
- data/doc/classes/Cachetastic/Adapters/FileBase.html +0 -309
- data/doc/classes/Cachetastic/Adapters/HtmlFile.html +0 -224
- data/doc/classes/Cachetastic/Adapters/Memcache.html +0 -498
- data/doc/classes/Cachetastic/Caches/Base.html +0 -643
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +0 -179
- data/doc/classes/Cachetastic/Caches/MackSessionCache.html +0 -119
- data/doc/classes/Cachetastic/Caches/PageCache.html +0 -121
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +0 -154
- data/doc/classes/Cachetastic/Connection.html +0 -212
- data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +0 -146
- data/doc/classes/Object.html +0 -222
- data/doc/classes/String.html +0 -172
- data/doc/files/lib/cachetastic/adapters/drb_rb.html +0 -115
- data/doc/files/lib/cachetastic/adapters/file_base_rb.html +0 -109
- data/doc/files/lib/cachetastic/adapters/memcache_rb.html +0 -127
- data/doc/files/lib/cachetastic/caches/mack_session_cache_rb.html +0 -107
- data/doc/files/lib/cachetastic/caches/page_cache_rb.html +0 -109
- data/doc/files/lib/cachetastic/caches/rails_session_cache_rb.html +0 -107
- data/doc/files/lib/cachetastic/connection_rb.html +0 -107
- data/doc/files/lib/cachetastic/errors/unsupported_adapter_rb.html +0 -101
- data/doc/files/lib/cachetastic/rails_extensions/active_record_base_rb.html +0 -101
- data/doc/files/lib/cachetastic/rails_extensions/cgi_session_store_rb.html +0 -109
- data/doc/files/lib/cachetastic/ruby_extensions/object_rb.html +0 -101
- data/lib/cachetastic/adapters/drb.rb +0 -51
- data/lib/cachetastic/adapters/file_base.rb +0 -86
- data/lib/cachetastic/adapters/html_file.rb +0 -68
- data/lib/cachetastic/adapters/memcache.rb +0 -114
- data/lib/cachetastic/adapters/store_object.rb +0 -28
- data/lib/cachetastic/caches/base.rb +0 -238
- data/lib/cachetastic/caches/mack_session_cache.rb +0 -3
- data/lib/cachetastic/caches/page_cache.rb +0 -6
- data/lib/cachetastic/caches/rails_session_cache.rb +0 -12
- data/lib/cachetastic/connection.rb +0 -24
- data/lib/cachetastic/errors/unsupported_adapter.rb +0 -7
- data/lib/cachetastic/rails_extensions/active_record_base.rb +0 -24
- data/lib/cachetastic/rails_extensions/cgi_session_store.rb +0 -59
- data/lib/cachetastic/ruby_extensions/kernel.rb +0 -25
- data/lib/cachetastic/ruby_extensions/object.rb +0 -22
- data/lib/cachetastic/ruby_extensions/string.rb +0 -15
- data/test/active_record_test.rb +0 -89
- data/test/cacheable_test.rb +0 -88
- data/test/cachetastic_unit_test.rb +0 -74
- data/test/config.rb +0 -30
- data/test/drb_adapter_test.rb +0 -14
- data/test/file_adapter_test.rb +0 -49
- data/test/memcache_adapter_test.rb +0 -18
- data/test/test_helper.rb +0 -75
@@ -80,9 +80,9 @@
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
81
81
|
|
82
82
|
<div class="name-list">
|
83
|
-
<a href="#
|
84
|
-
<a href="#
|
85
|
-
<a href="#
|
83
|
+
<a href="#M000015">cache_class</a>
|
84
|
+
<a href="#M000016">cacher</a>
|
85
|
+
<a href="#M000017">expire_all</a>
|
86
86
|
</div>
|
87
87
|
</div>
|
88
88
|
|
@@ -104,69 +104,76 @@
|
|
104
104
|
<div id="methods">
|
105
105
|
<h3 class="section-bar">Public Instance methods</h3>
|
106
106
|
|
107
|
-
<div id="method-
|
108
|
-
<a name="
|
107
|
+
<div id="method-M000015" class="method-detail">
|
108
|
+
<a name="M000015"></a>
|
109
109
|
|
110
110
|
<div class="method-heading">
|
111
|
-
<a href="#
|
111
|
+
<a href="#M000015" class="method-signature">
|
112
112
|
<span class="method-name">cache_class</span><span class="method-args">()</span>
|
113
113
|
</a>
|
114
114
|
</div>
|
115
115
|
|
116
116
|
<div class="method-description">
|
117
117
|
<p>
|
118
|
-
Returns the <a href="../
|
119
|
-
|
120
|
-
|
118
|
+
Returns the <a href="../Cache.html">Cachetastic::Cache</a> object
|
119
|
+
associated with the object. If a cache hasn‘t been defined the one
|
120
|
+
will be created on the fly. The cache for the object is expected to be
|
121
121
|
defined as: <a
|
122
|
-
href="../Cacheable.html">Cachetastic::Cacheable</a>::{CLASS_NAME_HERE}
|
122
|
+
href="../Cacheable.html">Cachetastic::Cacheable</a>::{CLASS_NAME_HERE}<a
|
123
|
+
href="../Cache.html">Cache</a>
|
123
124
|
</p>
|
124
125
|
<p>
|
125
|
-
|
126
|
+
Examples:
|
126
127
|
</p>
|
127
128
|
<pre>
|
128
129
|
class Person
|
129
130
|
include Cachetastic::Cacheable
|
130
|
-
attr_accessor :name
|
131
|
-
def cachetastic_key
|
132
|
-
self.name
|
133
|
-
end
|
134
131
|
end
|
135
132
|
|
136
133
|
Person.cache_class # => Cachetastic::Cacheable::PersonCache
|
134
|
+
|
135
|
+
class Admin::Person
|
136
|
+
include Cachetastic::Cacheable
|
137
|
+
end
|
138
|
+
|
139
|
+
Admin::Person.cache_class # => Cachetastic::Cacheable::Admin_PersonCache
|
137
140
|
</pre>
|
138
141
|
<p><a class="source-toggle" href="#"
|
139
|
-
onclick="toggleCode('
|
140
|
-
<div class="method-source-code" id="
|
142
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
143
|
+
<div class="method-source-code" id="M000015-source">
|
141
144
|
<pre>
|
142
|
-
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
145
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 41</span>
|
146
|
+
41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_class</span>
|
147
|
+
42: <span class="ruby-identifier">n</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>
|
148
|
+
43: <span class="ruby-identifier">n</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"Class"</span>
|
149
|
+
44: <span class="ruby-identifier">c_name</span> = <span class="ruby-node">"Cachetastic::Cacheable::#{n.gsub('::', '_')}Cache"</span>
|
150
|
+
45: <span class="ruby-keyword kw">begin</span>
|
151
|
+
46: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">c_name</span>.<span class="ruby-identifier">constantize</span>
|
152
|
+
47: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
153
|
+
48: <span class="ruby-identifier">eval</span> <span class="ruby-node">%{
|
154
|
+
49: class #{c_name} < Cachetastic::Cache
|
155
|
+
50:
|
156
|
+
51: def self.cache_klass
|
157
|
+
52: #{n}
|
158
|
+
53: end
|
159
|
+
54:
|
160
|
+
55: end
|
161
|
+
56: }</span>
|
162
|
+
57: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">c_name</span>.<span class="ruby-identifier">constantize</span>
|
163
|
+
58: <span class="ruby-keyword kw">end</span>
|
164
|
+
59:
|
165
|
+
60: <span class="ruby-keyword kw">end</span>
|
159
166
|
</pre>
|
160
167
|
</div>
|
161
168
|
</div>
|
162
169
|
</div>
|
163
170
|
|
164
|
-
<div id="method-
|
165
|
-
<a name="
|
171
|
+
<div id="method-M000016" class="method-detail">
|
172
|
+
<a name="M000016"></a>
|
166
173
|
|
167
174
|
<div class="method-heading">
|
168
|
-
<a href="#
|
169
|
-
<span class="method-name">cacher</span><span class="method-args">(key, expiry =
|
175
|
+
<a href="#M000016" class="method-signature">
|
176
|
+
<span class="method-name">cacher</span><span class="method-args">(key, expiry = nil) {|| ...}</span>
|
170
177
|
</a>
|
171
178
|
</div>
|
172
179
|
|
@@ -184,10 +191,7 @@ Example:
|
|
184
191
|
<pre>
|
185
192
|
class Person
|
186
193
|
include Cachetastic::Cacheable
|
187
|
-
|
188
|
-
def cachetastic_key
|
189
|
-
self.name
|
190
|
-
end
|
194
|
+
|
191
195
|
def always_the_same(x,y)
|
192
196
|
cacher("always_the_same") do
|
193
197
|
x + y
|
@@ -207,28 +211,28 @@ Example:
|
|
207
211
|
Cachetastic::Cacheable::PersonCache.get("say_hi") # => "Hi There"
|
208
212
|
</pre>
|
209
213
|
<p><a class="source-toggle" href="#"
|
210
|
-
onclick="toggleCode('
|
211
|
-
<div class="method-source-code" id="
|
214
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
215
|
+
<div class="method-source-code" id="M000016-source">
|
212
216
|
<pre>
|
213
|
-
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
217
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 89</span>
|
218
|
+
89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cacher</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">expiry</span> = <span class="ruby-keyword kw">nil</span>)
|
219
|
+
90: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">do</span>
|
220
|
+
91: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
221
|
+
92: <span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">yield</span>
|
222
|
+
93: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">set</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">res</span>, <span class="ruby-identifier">expiry</span>)
|
223
|
+
94: <span class="ruby-keyword kw">end</span>
|
224
|
+
95: <span class="ruby-keyword kw">end</span>
|
225
|
+
96: <span class="ruby-keyword kw">end</span>
|
222
226
|
</pre>
|
223
227
|
</div>
|
224
228
|
</div>
|
225
229
|
</div>
|
226
230
|
|
227
|
-
<div id="method-
|
228
|
-
<a name="
|
231
|
+
<div id="method-M000017" class="method-detail">
|
232
|
+
<a name="M000017"></a>
|
229
233
|
|
230
234
|
<div class="method-heading">
|
231
|
-
<a href="#
|
235
|
+
<a href="#M000017" class="method-signature">
|
232
236
|
<span class="method-name">expire_all</span><span class="method-args">()</span>
|
233
237
|
</a>
|
234
238
|
</div>
|
@@ -259,13 +263,13 @@ Example:
|
|
259
263
|
Person.get_from_cache(1) # => nil
|
260
264
|
</pre>
|
261
265
|
<p><a class="source-toggle" href="#"
|
262
|
-
onclick="toggleCode('
|
263
|
-
<div class="method-source-code" id="
|
266
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
267
|
+
<div class="method-source-code" id="M000017-source">
|
264
268
|
<pre>
|
265
|
-
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 117</span>
|
270
|
+
117: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
|
271
|
+
118: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">expire_all</span>
|
272
|
+
119: <span class="ruby-keyword kw">end</span>
|
269
273
|
</pre>
|
270
274
|
</div>
|
271
275
|
</div>
|
@@ -80,9 +80,9 @@
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
81
81
|
|
82
82
|
<div class="name-list">
|
83
|
-
<a href="#
|
84
|
-
<a href="#
|
85
|
-
<a href="#
|
83
|
+
<a href="#M000013">delete_from_cache</a>
|
84
|
+
<a href="#M000012">get_from_cache</a>
|
85
|
+
<a href="#M000014">set_into_cache</a>
|
86
86
|
</div>
|
87
87
|
</div>
|
88
88
|
|
@@ -104,11 +104,11 @@
|
|
104
104
|
<div id="methods">
|
105
105
|
<h3 class="section-bar">Public Instance methods</h3>
|
106
106
|
|
107
|
-
<div id="method-
|
108
|
-
<a name="
|
107
|
+
<div id="method-M000013" class="method-detail">
|
108
|
+
<a name="M000013"></a>
|
109
109
|
|
110
110
|
<div class="method-heading">
|
111
|
-
<a href="#
|
111
|
+
<a href="#M000013" class="method-signature">
|
112
112
|
<span class="method-name">delete_from_cache</span><span class="method-args">(key)</span>
|
113
113
|
</a>
|
114
114
|
</div>
|
@@ -118,23 +118,23 @@
|
|
118
118
|
Deletes an object from the cache for a given key.
|
119
119
|
</p>
|
120
120
|
<p><a class="source-toggle" href="#"
|
121
|
-
onclick="toggleCode('
|
122
|
-
<div class="method-source-code" id="
|
121
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
122
|
+
<div class="method-source-code" id="M000013-source">
|
123
123
|
<pre>
|
124
|
-
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line
|
125
|
-
|
126
|
-
|
127
|
-
|
124
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 191</span>
|
125
|
+
191: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_from_cache</span>(<span class="ruby-identifier">key</span>)
|
126
|
+
192: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
|
127
|
+
193: <span class="ruby-keyword kw">end</span>
|
128
128
|
</pre>
|
129
129
|
</div>
|
130
130
|
</div>
|
131
131
|
</div>
|
132
132
|
|
133
|
-
<div id="method-
|
134
|
-
<a name="
|
133
|
+
<div id="method-M000012" class="method-detail">
|
134
|
+
<a name="M000012"></a>
|
135
135
|
|
136
136
|
<div class="method-heading">
|
137
|
-
<a href="#
|
137
|
+
<a href="#M000012" class="method-signature">
|
138
138
|
<span class="method-name">get_from_cache</span><span class="method-args">(key, &block)</span>
|
139
139
|
</a>
|
140
140
|
</div>
|
@@ -144,23 +144,23 @@ Deletes an object from the cache for a given key.
|
|
144
144
|
Returns an object from the cache for a given key.
|
145
145
|
</p>
|
146
146
|
<p><a class="source-toggle" href="#"
|
147
|
-
onclick="toggleCode('
|
148
|
-
<div class="method-source-code" id="
|
147
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
148
|
+
<div class="method-source-code" id="M000012-source">
|
149
149
|
<pre>
|
150
|
-
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line
|
151
|
-
|
152
|
-
|
153
|
-
|
150
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 186</span>
|
151
|
+
186: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_from_cache</span>(<span class="ruby-identifier">key</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
152
|
+
187: <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
153
|
+
188: <span class="ruby-keyword kw">end</span>
|
154
154
|
</pre>
|
155
155
|
</div>
|
156
156
|
</div>
|
157
157
|
</div>
|
158
158
|
|
159
|
-
<div id="method-
|
160
|
-
<a name="
|
159
|
+
<div id="method-M000014" class="method-detail">
|
160
|
+
<a name="M000014"></a>
|
161
161
|
|
162
162
|
<div class="method-heading">
|
163
|
-
<a href="#
|
163
|
+
<a href="#M000014" class="method-signature">
|
164
164
|
<span class="method-name">set_into_cache</span><span class="method-args">(key, value, expiry = 0)</span>
|
165
165
|
</a>
|
166
166
|
</div>
|
@@ -170,13 +170,13 @@ Returns an object from the cache for a given key.
|
|
170
170
|
Sets an object into the cache for a given key.
|
171
171
|
</p>
|
172
172
|
<p><a class="source-toggle" href="#"
|
173
|
-
onclick="toggleCode('
|
174
|
-
<div class="method-source-code" id="
|
173
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
174
|
+
<div class="method-source-code" id="M000014-source">
|
175
175
|
<pre>
|
176
|
-
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line
|
177
|
-
|
178
|
-
|
179
|
-
|
176
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/cacheable.rb, line 196</span>
|
177
|
+
196: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_into_cache</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>)
|
178
|
+
197: <span class="ruby-identifier">cache_class</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>)
|
179
|
+
198: <span class="ruby-keyword kw">end</span>
|
180
180
|
</pre>
|
181
181
|
</div>
|
182
182
|
</div>
|
@@ -65,9 +65,7 @@
|
|
65
65
|
<tr class="top-aligned-row">
|
66
66
|
<td><strong>Parent:</strong></td>
|
67
67
|
<td>
|
68
|
-
<a href="../Object.html">
|
69
68
|
Object
|
70
|
-
</a>
|
71
69
|
</td>
|
72
70
|
</tr>
|
73
71
|
</table>
|
@@ -82,8 +80,22 @@
|
|
82
80
|
|
83
81
|
<div id="description">
|
84
82
|
<p>
|
85
|
-
This class handles logging for the caches and their adapters.
|
83
|
+
This class handles logging for the caches and their adapters. This class
|
84
|
+
exists simply to supply the ability to write to multiple loggers
|
85
|
+
simultaneously from a single call. It also creates a standardized message
|
86
|
+
to write to those loggers.
|
86
87
|
</p>
|
88
|
+
<p>
|
89
|
+
It is important that any logger type of class you decide to use reponds to
|
90
|
+
the following methods:
|
91
|
+
</p>
|
92
|
+
<pre>
|
93
|
+
fatal(message)
|
94
|
+
error(message)
|
95
|
+
warn(message)
|
96
|
+
info(message)
|
97
|
+
debug(message)
|
98
|
+
</pre>
|
87
99
|
|
88
100
|
</div>
|
89
101
|
|
@@ -94,7 +106,7 @@ This class handles logging for the caches and their adapters.
|
|
94
106
|
<h3 class="section-bar">Methods</h3>
|
95
107
|
|
96
108
|
<div class="name-list">
|
97
|
-
<a href="#
|
109
|
+
<a href="#M000026">new</a>
|
98
110
|
</div>
|
99
111
|
</div>
|
100
112
|
|
@@ -106,19 +118,6 @@ This class handles logging for the caches and their adapters.
|
|
106
118
|
<div id="section">
|
107
119
|
|
108
120
|
|
109
|
-
<div id="constants-list">
|
110
|
-
<h3 class="section-bar">Constants</h3>
|
111
|
-
|
112
|
-
<div class="name-list">
|
113
|
-
<table summary="Constants">
|
114
|
-
<tr class="top-aligned-row context-row">
|
115
|
-
<td class="context-item-name">LOG_LEVELS</td>
|
116
|
-
<td>=</td>
|
117
|
-
<td class="context-item-value">[:fatal, :error, :warn, :info, :debug]</td>
|
118
|
-
</tr>
|
119
|
-
</table>
|
120
|
-
</div>
|
121
|
-
</div>
|
122
121
|
|
123
122
|
|
124
123
|
|
@@ -131,7 +130,7 @@ This class handles logging for the caches and their adapters.
|
|
131
130
|
<td class="context-item-name">loggers</td>
|
132
131
|
<td class="context-item-value"> [RW] </td>
|
133
132
|
<td class="context-item-desc">
|
134
|
-
|
133
|
+
An <tt>Array</tt> of ‘real’ loggers to write to.
|
135
134
|
|
136
135
|
</td>
|
137
136
|
</tr>
|
@@ -145,29 +144,28 @@ attr_accessor :options attr_accessor :cache_name
|
|
145
144
|
<div id="methods">
|
146
145
|
<h3 class="section-bar">Public Class methods</h3>
|
147
146
|
|
148
|
-
<div id="method-
|
149
|
-
<a name="
|
147
|
+
<div id="method-M000026" class="method-detail">
|
148
|
+
<a name="M000026"></a>
|
150
149
|
|
151
150
|
<div class="method-heading">
|
152
|
-
<a href="#
|
153
|
-
<span class="method-name">new</span><span class="method-args">(loggers)</span>
|
151
|
+
<a href="#M000026" class="method-signature">
|
152
|
+
<span class="method-name">new</span><span class="method-args">(*loggers)</span>
|
154
153
|
</a>
|
155
154
|
</div>
|
156
155
|
|
157
156
|
<div class="method-description">
|
157
|
+
<p>
|
158
|
+
The <tt>initialize</tt> method takes an <tt>Array</tt> of your favorite
|
159
|
+
logger style classes to write to.
|
160
|
+
</p>
|
158
161
|
<p><a class="source-toggle" href="#"
|
159
|
-
onclick="toggleCode('
|
160
|
-
<div class="method-source-code" id="
|
162
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
163
|
+
<div class="method-source-code" id="M000026-source">
|
161
164
|
<pre>
|
162
|
-
<span class="ruby-comment cmt"># File lib/cachetastic/logger.rb, line
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
11: <span class="ruby-comment cmt"># self.cache_name = cache_name</span>
|
167
|
-
12: <span class="ruby-comment cmt"># self.options.each_pair do |n, opts|</span>
|
168
|
-
13: <span class="ruby-comment cmt"># opts["level"] = (opts["level"] ||= "info").to_sym</span>
|
169
|
-
14: <span class="ruby-comment cmt"># end</span>
|
170
|
-
15: <span class="ruby-keyword kw">end</span>
|
165
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/logger.rb, line 21</span>
|
166
|
+
21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">loggers</span>)
|
167
|
+
22: <span class="ruby-ivar">@loggers</span> = [<span class="ruby-identifier">loggers</span>].<span class="ruby-identifier">flatten</span>
|
168
|
+
23: <span class="ruby-keyword kw">end</span>
|
171
169
|
</pre>
|
172
170
|
</div>
|
173
171
|
</div>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Thu, 11 Jun 2009 14:19:33 -0400
|
@@ -5,10 +5,10 @@
|
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
|
-
<title>File:
|
8
|
+
<title>File: LICENSE</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
12
|
<script type="text/javascript">
|
13
13
|
// <![CDATA[
|
14
14
|
|
@@ -47,16 +47,16 @@
|
|
47
47
|
|
48
48
|
|
49
49
|
<div id="fileHeader">
|
50
|
-
<h1>
|
50
|
+
<h1>LICENSE</h1>
|
51
51
|
<table class="header-table">
|
52
52
|
<tr class="top-aligned-row">
|
53
53
|
<td><strong>Path:</strong></td>
|
54
|
-
<td>
|
54
|
+
<td>LICENSE
|
55
55
|
</td>
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Fri Jun 05 17:12:05 -0400 2009</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -70,41 +70,36 @@
|
|
70
70
|
|
71
71
|
<div id="description">
|
72
72
|
<p>
|
73
|
-
|
74
|
-
in files called index.html. At the beginning of the html the following html
|
75
|
-
comments are pre-pended:
|
73
|
+
The MIT License
|
76
74
|
</p>
|
77
|
-
<pre>
|
78
|
-
<!-- cachetastic: expires_at: Fri Feb 01 20:51:45 -0500 2008 -->
|
79
|
-
<!-- cachetastic: key: /channels/1-arts-humanities -->
|
80
|
-
</pre>
|
81
75
|
<p>
|
82
|
-
|
83
|
-
|
76
|
+
Copyright (c) 2009 Mark Bates
|
77
|
+
</p>
|
78
|
+
<p>
|
79
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
80
|
+
copy of this software and associated documentation files (the
|
81
|
+
"Software"), to deal in the Software without restriction,
|
82
|
+
including without limitation the rights to use, copy, modify, merge,
|
83
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
84
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
85
|
+
following conditions:
|
86
|
+
</p>
|
87
|
+
<p>
|
88
|
+
The above copyright notice and this permission notice shall be included in
|
89
|
+
all copies or substantial portions of the Software.
|
90
|
+
</p>
|
91
|
+
<p>
|
92
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
93
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
94
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
95
|
+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
96
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
97
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
98
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
84
99
|
</p>
|
85
|
-
<pre>
|
86
|
-
my_awesome_cache_options:
|
87
|
-
debug: false
|
88
|
-
adapter: html_file
|
89
|
-
marshall_method: none
|
90
|
-
default_expiry: <%= 24.hours %>
|
91
|
-
store_options:
|
92
|
-
dir: /usr/local/caches/
|
93
|
-
logging:
|
94
|
-
logger_1:
|
95
|
-
type: file
|
96
|
-
file: log/file_store_cache.log
|
97
|
-
</pre>
|
98
100
|
|
99
101
|
</div>
|
100
102
|
|
101
|
-
<div id="requires-list">
|
102
|
-
<h3 class="section-bar">Required files</h3>
|
103
|
-
|
104
|
-
<div class="name-list">
|
105
|
-
time
|
106
|
-
</div>
|
107
|
-
</div>
|
108
103
|
|
109
104
|
</div>
|
110
105
|
|