cachetastic 1.7.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +31 -44
- data/bin/cachetastic_drb_server +115 -0
- data/doc/classes/ActiveRecord/Base.html +16 -16
- data/doc/classes/CGI/Session/CachetasticStore.html +2 -2
- data/doc/classes/Cachetastic/Adapters/Base.html +74 -67
- data/doc/classes/Cachetastic/Adapters/Drb.html +11 -11
- data/doc/classes/Cachetastic/Adapters/File.html +5 -5
- data/doc/classes/Cachetastic/Adapters/FileBase.html +45 -45
- data/doc/classes/Cachetastic/Adapters/HtmlFile.html +23 -23
- data/doc/classes/Cachetastic/Adapters/LocalMemory.html +51 -51
- data/doc/classes/Cachetastic/Adapters/Memcache.html +89 -89
- data/doc/classes/Cachetastic/Cacheable.html +22 -22
- data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +23 -23
- data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +23 -23
- data/doc/classes/Cachetastic/Caches/Base.html +170 -199
- data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +9 -9
- data/doc/classes/Cachetastic/Caches/MackSessionCache.html +2 -2
- data/doc/classes/Cachetastic/Caches/PageCache.html +2 -2
- data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +9 -9
- data/doc/classes/Cachetastic/Connection.html +5 -5
- data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +9 -9
- data/doc/classes/Cachetastic/Logger.html +23 -24
- data/doc/classes/Object.html +41 -3
- data/doc/created.rid +1 -1
- data/doc/files/README.html +33 -52
- data/doc/files/lib/{adapters/cachetastic_adapters_base_rb.html → cachetastic/adapters/base_rb.html} +6 -6
- data/doc/files/lib/{adapters/cachetastic_adapters_drb_rb.html → cachetastic/adapters/drb_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_file_base_rb.html → cachetastic/adapters/file_base_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_file_rb.html → cachetastic/adapters/file_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_html_file_rb.html → cachetastic/adapters/html_file_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_local_memory_rb.html → cachetastic/adapters/local_memory_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_memcache_rb.html → cachetastic/adapters/memcache_rb.html} +5 -5
- data/doc/files/lib/{cachetastic_cacheable_rb.html → cachetastic/adapters/store_object_rb.html} +5 -5
- data/doc/files/lib/{ruby_extensions/object_rb.html → cachetastic/cacheable_rb.html} +4 -4
- data/doc/files/lib/{caches/cachetastic_caches_base_rb.html → cachetastic/caches/base_rb.html} +5 -5
- data/doc/files/lib/{cachetastic_connection_rb.html → cachetastic/caches/mack_session_cache_rb.html} +6 -6
- data/doc/files/lib/{caches/cachetastic_caches_page_cache_rb.html → cachetastic/caches/page_cache_rb.html} +5 -5
- data/doc/files/lib/{caches/cachetastic_caches_rails_session_cache_rb.html → cachetastic/caches/rails_session_cache_rb.html} +5 -5
- data/doc/files/lib/{caches/cachetastic_caches_mack_session_cache_rb.html → cachetastic/connection_rb.html} +5 -5
- data/doc/files/lib/{adapters/cachetastic_adapters_store_object_rb.html → cachetastic/errors/unsupported_adapter_rb.html} +5 -5
- data/doc/files/lib/{cachetastic_logger_rb.html → cachetastic/logger_rb.html} +5 -5
- data/doc/files/lib/{rails_extensions/cachetastic_active_record_base_rb.html → cachetastic/rails_extensions/active_record_base_rb.html} +5 -5
- data/doc/files/lib/{rails_extensions/cgi_session_cachetastic_store_rb.html → cachetastic/rails_extensions/cgi_session_store_rb.html} +5 -5
- data/doc/files/lib/cachetastic/ruby_extensions/object_rb.html +101 -0
- data/doc/files/lib/cachetastic_rb.html +34 -53
- data/doc/fr_file_index.html +19 -19
- data/doc/fr_method_index.html +63 -62
- data/lib/cachetastic.rb +35 -22
- data/lib/{adapters/cachetastic_adapters_base.rb → cachetastic/adapters/base.rb} +23 -30
- data/lib/{adapters/cachetastic_adapters_drb.rb → cachetastic/adapters/drb.rb} +2 -2
- data/lib/{adapters/cachetastic_adapters_file.rb → cachetastic/adapters/file.rb} +0 -0
- data/lib/{adapters/cachetastic_adapters_file_base.rb → cachetastic/adapters/file_base.rb} +1 -1
- data/lib/{adapters/cachetastic_adapters_html_file.rb → cachetastic/adapters/html_file.rb} +0 -0
- data/lib/{adapters/cachetastic_adapters_local_memory.rb → cachetastic/adapters/local_memory.rb} +0 -0
- data/lib/{adapters/cachetastic_adapters_memcache.rb → cachetastic/adapters/memcache.rb} +3 -3
- data/lib/{adapters/cachetastic_adapters_store_object.rb → cachetastic/adapters/store_object.rb} +0 -0
- data/lib/{cachetastic_cacheable.rb → cachetastic/cacheable.rb} +0 -0
- data/lib/{caches/cachetastic_caches_base.rb → cachetastic/caches/base.rb} +11 -13
- data/lib/{caches/cachetastic_caches_mack_session_cache.rb → cachetastic/caches/mack_session_cache.rb} +0 -0
- data/lib/{caches/cachetastic_caches_page_cache.rb → cachetastic/caches/page_cache.rb} +0 -0
- data/lib/{caches/cachetastic_caches_rails_session_cache.rb → cachetastic/caches/rails_session_cache.rb} +0 -0
- data/lib/{cachetastic_connection.rb → cachetastic/connection.rb} +1 -1
- data/lib/{errors/cachetastic_errors_unsupported_adapter.rb → cachetastic/errors/unsupported_adapter.rb} +0 -0
- data/lib/cachetastic/logger.rb +49 -0
- data/lib/{rails_extensions/cachetastic_active_record_base.rb → cachetastic/rails_extensions/active_record_base.rb} +0 -0
- data/lib/{rails_extensions/cgi_session_cachetastic_store.rb → cachetastic/rails_extensions/cgi_session_store.rb} +0 -0
- data/lib/{ruby_extensions → cachetastic/ruby_extensions}/object.rb +0 -0
- data/test/config.rb +30 -0
- data/test/drb_adapter_test.rb +14 -0
- data/test/memcache_adapter_test.rb +14 -0
- data/test/test_helper.rb +8 -22
- metadata +58 -47
- data/doc/files/lib/errors/cachetastic_errors_unsupported_adapter_rb.html +0 -101
- data/lib/cachetastic_logger.rb +0 -44
- data/test/config.yml +0 -71
- data/test/data_mapper_test.rb +0 -9
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../../../../files/lib/caches/
|
|
59
|
-
lib/caches/
|
|
58
|
+
<a href="../../../../files/lib/cachetastic/caches/base_rb.html">
|
|
59
|
+
lib/cachetastic/caches/base.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
62
62
|
</td>
|
|
@@ -96,7 +96,7 @@ href="../Base.html">Cachetastic::Caches::Base</a>.
|
|
|
96
96
|
<h3 class="section-bar">Methods</h3>
|
|
97
97
|
|
|
98
98
|
<div class="name-list">
|
|
99
|
-
<a href="#
|
|
99
|
+
<a href="#M000062">new</a>
|
|
100
100
|
</div>
|
|
101
101
|
</div>
|
|
102
102
|
|
|
@@ -141,21 +141,21 @@ list of all caches registered with the system.
|
|
|
141
141
|
<div id="methods">
|
|
142
142
|
<h3 class="section-bar">Public Class methods</h3>
|
|
143
143
|
|
|
144
|
-
<div id="method-
|
|
145
|
-
<a name="
|
|
144
|
+
<div id="method-M000062" class="method-detail">
|
|
145
|
+
<a name="M000062"></a>
|
|
146
146
|
|
|
147
147
|
<div class="method-heading">
|
|
148
|
-
<a href="#
|
|
148
|
+
<a href="#M000062" class="method-signature">
|
|
149
149
|
<span class="method-name">new</span><span class="method-args">()</span>
|
|
150
150
|
</a>
|
|
151
151
|
</div>
|
|
152
152
|
|
|
153
153
|
<div class="method-description">
|
|
154
154
|
<p><a class="source-toggle" href="#"
|
|
155
|
-
onclick="toggleCode('
|
|
156
|
-
<div class="method-source-code" id="
|
|
155
|
+
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
|
156
|
+
<div class="method-source-code" id="M000062-source">
|
|
157
157
|
<pre>
|
|
158
|
-
<span class="ruby-comment cmt"># File lib/caches/
|
|
158
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/caches/base.rb, line 37</span>
|
|
159
159
|
37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
|
160
160
|
38: <span class="ruby-ivar">@list</span> = []
|
|
161
161
|
39: <span class="ruby-keyword kw">end</span>
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../../../files/lib/caches/
|
|
59
|
-
lib/caches/
|
|
58
|
+
<a href="../../../files/lib/cachetastic/caches/mack_session_cache_rb.html">
|
|
59
|
+
lib/cachetastic/caches/mack_session_cache.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
62
62
|
</td>
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../../../files/lib/caches/
|
|
59
|
-
lib/caches/
|
|
58
|
+
<a href="../../../files/lib/cachetastic/caches/page_cache_rb.html">
|
|
59
|
+
lib/cachetastic/caches/page_cache.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
62
62
|
</td>
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../../../files/lib/caches/
|
|
59
|
-
lib/caches/
|
|
58
|
+
<a href="../../../files/lib/cachetastic/caches/rails_session_cache_rb.html">
|
|
59
|
+
lib/cachetastic/caches/rails_session_cache.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
62
62
|
</td>
|
|
@@ -94,7 +94,7 @@ Used for storing Rails sessions.
|
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
|
95
95
|
|
|
96
96
|
<div class="name-list">
|
|
97
|
-
<a href="#
|
|
97
|
+
<a href="#M000047">unsupported_adapters</a>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
100
|
|
|
@@ -116,21 +116,21 @@ Used for storing Rails sessions.
|
|
|
116
116
|
<div id="methods">
|
|
117
117
|
<h3 class="section-bar">Public Class methods</h3>
|
|
118
118
|
|
|
119
|
-
<div id="method-
|
|
120
|
-
<a name="
|
|
119
|
+
<div id="method-M000047" class="method-detail">
|
|
120
|
+
<a name="M000047"></a>
|
|
121
121
|
|
|
122
122
|
<div class="method-heading">
|
|
123
|
-
<a href="#
|
|
123
|
+
<a href="#M000047" class="method-signature">
|
|
124
124
|
<span class="method-name">unsupported_adapters</span><span class="method-args">()</span>
|
|
125
125
|
</a>
|
|
126
126
|
</div>
|
|
127
127
|
|
|
128
128
|
<div class="method-description">
|
|
129
129
|
<p><a class="source-toggle" href="#"
|
|
130
|
-
onclick="toggleCode('
|
|
131
|
-
<div class="method-source-code" id="
|
|
130
|
+
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
|
|
131
|
+
<div class="method-source-code" id="M000047-source">
|
|
132
132
|
<pre>
|
|
133
|
-
<span class="ruby-comment cmt"># File lib/caches/
|
|
133
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/caches/rails_session_cache.rb, line 6</span>
|
|
134
134
|
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unsupported_adapters</span>
|
|
135
135
|
7: [<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>]
|
|
136
136
|
8: <span class="ruby-keyword kw">end</span>
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../../files/lib/
|
|
59
|
-
lib/
|
|
58
|
+
<a href="../../files/lib/cachetastic/connection_rb.html">
|
|
59
|
+
lib/cachetastic/connection.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
62
62
|
</td>
|
|
@@ -151,7 +151,7 @@ This class caches adapter objects for each cache in the system.
|
|
|
151
151
|
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
|
|
152
152
|
<div class="method-source-code" id="M000072-source">
|
|
153
153
|
<pre>
|
|
154
|
-
<span class="ruby-comment cmt"># File lib/
|
|
154
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/connection.rb, line 7</span>
|
|
155
155
|
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
|
156
156
|
8: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">connections</span> = {}
|
|
157
157
|
9: <span class="ruby-keyword kw">end</span>
|
|
@@ -182,12 +182,12 @@ doesn‘t exist or if the adapter is no longer valid (adapter.valid?) a
|
|
|
182
182
|
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
|
183
183
|
<div class="method-source-code" id="M000073-source">
|
|
184
184
|
<pre>
|
|
185
|
-
<span class="ruby-comment cmt"># File lib/
|
|
185
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/connection.rb, line 14</span>
|
|
186
186
|
14: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">name</span>)
|
|
187
187
|
15: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>
|
|
188
188
|
16: <span class="ruby-identifier">conn</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">connections</span>[<span class="ruby-identifier">name</span>]
|
|
189
189
|
17: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">conn</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">conn</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">conn</span>.<span class="ruby-identifier">valid?</span>
|
|
190
|
-
18: <span class="ruby-identifier">adapter</span> = <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">Base</span>.<span class="ruby-identifier">
|
|
190
|
+
18: <span class="ruby-identifier">adapter</span> = <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">Base</span>.<span class="ruby-identifier">configuration</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">adapter</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">camelcase</span>
|
|
191
191
|
19: <span class="ruby-identifier">conn</span> = <span class="ruby-node">"Cachetastic::Adapters::#{adapter}"</span>.<span class="ruby-identifier">constantize</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>)
|
|
192
192
|
20: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">connections</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">conn</span>
|
|
193
193
|
21: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">conn</span>
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../../../files/lib/errors/
|
|
59
|
-
lib/errors/
|
|
58
|
+
<a href="../../../files/lib/cachetastic/errors/unsupported_adapter_rb.html">
|
|
59
|
+
lib/cachetastic/errors/unsupported_adapter.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
62
62
|
</td>
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
89
|
+
<a href="#M000003">new</a>
|
|
90
90
|
</div>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
@@ -108,21 +108,21 @@
|
|
|
108
108
|
<div id="methods">
|
|
109
109
|
<h3 class="section-bar">Public Class methods</h3>
|
|
110
110
|
|
|
111
|
-
<div id="method-
|
|
112
|
-
<a name="
|
|
111
|
+
<div id="method-M000003" class="method-detail">
|
|
112
|
+
<a name="M000003"></a>
|
|
113
113
|
|
|
114
114
|
<div class="method-heading">
|
|
115
|
-
<a href="#
|
|
115
|
+
<a href="#M000003" class="method-signature">
|
|
116
116
|
<span class="method-name">new</span><span class="method-args">(cache_name, adapter)</span>
|
|
117
117
|
</a>
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
<div class="method-description">
|
|
121
121
|
<p><a class="source-toggle" href="#"
|
|
122
|
-
onclick="toggleCode('
|
|
123
|
-
<div class="method-source-code" id="
|
|
122
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
123
|
+
<div class="method-source-code" id="M000003-source">
|
|
124
124
|
<pre>
|
|
125
|
-
<span class="ruby-comment cmt"># File lib/errors/
|
|
125
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/errors/unsupported_adapter.rb, line 3</span>
|
|
126
126
|
3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">adapter</span>)
|
|
127
127
|
4: <span class="ruby-keyword kw">super</span>(<span class="ruby-node">"#{cache_name} does not support the use of the #{adapter} adapter!"</span>)
|
|
128
128
|
5: <span class="ruby-keyword kw">end</span>
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../../files/lib/
|
|
59
|
-
lib/
|
|
58
|
+
<a href="../../files/lib/cachetastic/logger_rb.html">
|
|
59
|
+
lib/cachetastic/logger.rb
|
|
60
60
|
</a>
|
|
61
61
|
<br />
|
|
62
62
|
</td>
|
|
@@ -94,7 +94,7 @@ This class handles logging for the caches and their adapters.
|
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
|
95
95
|
|
|
96
96
|
<div class="name-list">
|
|
97
|
-
<a href="#
|
|
97
|
+
<a href="#M000071">new</a>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
100
|
|
|
@@ -128,14 +128,12 @@ This class handles logging for the caches and their adapters.
|
|
|
128
128
|
<div class="name-list">
|
|
129
129
|
<table>
|
|
130
130
|
<tr class="top-aligned-row context-row">
|
|
131
|
-
<td class="context-item-name">
|
|
131
|
+
<td class="context-item-name">loggers</td>
|
|
132
132
|
<td class="context-item-value"> [RW] </td>
|
|
133
|
-
<td class="context-item-desc"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<td class="context-item-value"> [RW] </td>
|
|
138
|
-
<td class="context-item-desc"></td>
|
|
133
|
+
<td class="context-item-desc">
|
|
134
|
+
attr_accessor :options attr_accessor :cache_name
|
|
135
|
+
|
|
136
|
+
</td>
|
|
139
137
|
</tr>
|
|
140
138
|
</table>
|
|
141
139
|
</div>
|
|
@@ -147,28 +145,29 @@ This class handles logging for the caches and their adapters.
|
|
|
147
145
|
<div id="methods">
|
|
148
146
|
<h3 class="section-bar">Public Class methods</h3>
|
|
149
147
|
|
|
150
|
-
<div id="method-
|
|
151
|
-
<a name="
|
|
148
|
+
<div id="method-M000071" class="method-detail">
|
|
149
|
+
<a name="M000071"></a>
|
|
152
150
|
|
|
153
151
|
<div class="method-heading">
|
|
154
|
-
<a href="#
|
|
155
|
-
<span class="method-name">new</span><span class="method-args">(
|
|
152
|
+
<a href="#M000071" class="method-signature">
|
|
153
|
+
<span class="method-name">new</span><span class="method-args">(loggers)</span>
|
|
156
154
|
</a>
|
|
157
155
|
</div>
|
|
158
156
|
|
|
159
157
|
<div class="method-description">
|
|
160
158
|
<p><a class="source-toggle" href="#"
|
|
161
|
-
onclick="toggleCode('
|
|
162
|
-
<div class="method-source-code" id="
|
|
159
|
+
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
|
|
160
|
+
<div class="method-source-code" id="M000071-source">
|
|
163
161
|
<pre>
|
|
164
|
-
<span class="ruby-comment cmt"># File lib/
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
162
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/logger.rb, line 8</span>
|
|
163
|
+
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">loggers</span>)
|
|
164
|
+
9: <span class="ruby-ivar">@loggers</span> = [<span class="ruby-identifier">loggers</span>].<span class="ruby-identifier">flatten</span>
|
|
165
|
+
10: <span class="ruby-comment cmt"># self.options = options</span>
|
|
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>
|
|
172
171
|
</pre>
|
|
173
172
|
</div>
|
|
174
173
|
</div>
|
data/doc/classes/Object.html
CHANGED
|
@@ -55,8 +55,12 @@
|
|
|
55
55
|
<tr class="top-aligned-row">
|
|
56
56
|
<td><strong>In:</strong></td>
|
|
57
57
|
<td>
|
|
58
|
-
<a href="../files/lib/ruby_extensions/object_rb.html">
|
|
59
|
-
lib/ruby_extensions/object.rb
|
|
58
|
+
<a href="../files/lib/cachetastic/ruby_extensions/object_rb.html">
|
|
59
|
+
lib/cachetastic/ruby_extensions/object.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
<a href="../files/lib/cachetastic_rb.html">
|
|
63
|
+
lib/cachetastic.rb
|
|
60
64
|
</a>
|
|
61
65
|
<br />
|
|
62
66
|
</td>
|
|
@@ -89,6 +93,7 @@
|
|
|
89
93
|
|
|
90
94
|
<div class="name-list">
|
|
91
95
|
<a href="#M000001">cachetastic_key</a>
|
|
96
|
+
<a href="#M000002">needs_method</a>
|
|
92
97
|
</div>
|
|
93
98
|
</div>
|
|
94
99
|
|
|
@@ -108,6 +113,39 @@
|
|
|
108
113
|
|
|
109
114
|
<!-- if method_list -->
|
|
110
115
|
<div id="methods">
|
|
116
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
117
|
+
|
|
118
|
+
<div id="method-M000002" class="method-detail">
|
|
119
|
+
<a name="M000002"></a>
|
|
120
|
+
|
|
121
|
+
<div class="method-heading">
|
|
122
|
+
<a href="#M000002" class="method-signature">
|
|
123
|
+
<span class="method-name">needs_method</span><span class="method-args">(meth)</span>
|
|
124
|
+
</a>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div class="method-description">
|
|
128
|
+
<p>
|
|
129
|
+
Uses <tt>define_method</tt> to create an empty for the method parameter
|
|
130
|
+
defined. That method will then raise MethodNotImplemented. This is useful
|
|
131
|
+
for creating interfaces and you want to stub out methods that others need
|
|
132
|
+
to implement.
|
|
133
|
+
</p>
|
|
134
|
+
<p><a class="source-toggle" href="#"
|
|
135
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
136
|
+
<div class="method-source-code" id="M000002-source">
|
|
137
|
+
<pre>
|
|
138
|
+
<span class="ruby-comment cmt"># File lib/cachetastic.rb, line 23</span>
|
|
139
|
+
23: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">needs_method</span>(<span class="ruby-identifier">meth</span>)
|
|
140
|
+
24: <span class="ruby-identifier">define_method</span>(<span class="ruby-identifier">meth</span>) <span class="ruby-keyword kw">do</span>
|
|
141
|
+
25: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"The interface you are using requires you define the following method '#{meth}'"</span>)
|
|
142
|
+
26: <span class="ruby-keyword kw">end</span>
|
|
143
|
+
27: <span class="ruby-keyword kw">end</span>
|
|
144
|
+
</pre>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
111
149
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
112
150
|
|
|
113
151
|
<div id="method-M000001" class="method-detail">
|
|
@@ -128,7 +166,7 @@ href="Cachetastic/Cacheable.html">Cachetastic::Cacheable</a> module.
|
|
|
128
166
|
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
|
129
167
|
<div class="method-source-code" id="M000001-source">
|
|
130
168
|
<pre>
|
|
131
|
-
<span class="ruby-comment cmt"># File lib/ruby_extensions/object.rb, line 4</span>
|
|
169
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/ruby_extensions/object.rb, line 4</span>
|
|
132
170
|
4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cachetastic_key</span>
|
|
133
171
|
5: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'cachetastic_key'</span>)
|
|
134
172
|
6: <span class="ruby-keyword kw">end</span>
|
data/doc/created.rid
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Tue, 30 Sep 2008 11:03:51 -0400
|
data/doc/files/README.html
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
</tr>
|
|
57
57
|
<tr class="top-aligned-row">
|
|
58
58
|
<td><strong>Last Update:</strong></td>
|
|
59
|
-
<td>Tue
|
|
59
|
+
<td>Tue Sep 30 10:55:20 -0400 2008</td>
|
|
60
60
|
</tr>
|
|
61
61
|
</table>
|
|
62
62
|
</div>
|
|
@@ -71,68 +71,49 @@
|
|
|
71
71
|
<div id="description">
|
|
72
72
|
<h1>Configuration:</h1>
|
|
73
73
|
<pre>
|
|
74
|
-
cachetastic_default_options:
|
|
75
74
|
# this will dump into the log, configuration info for each cache, as well as the .inspect
|
|
76
75
|
# for each object returned from the cache
|
|
77
|
-
debug
|
|
76
|
+
configatron.cachetastic_default_options.debug = false
|
|
77
|
+
|
|
78
78
|
# this is the type of file store to be used for this cache.
|
|
79
79
|
# more adapters can be developed and plugged in as desired
|
|
80
|
-
adapter:
|
|
80
|
+
configatron.cachetastic_default_options.adapter = :local_memory # local_memory | memcache | file | drb | html_file (default: local_memory)
|
|
81
|
+
|
|
81
82
|
# this will marshall objects into and out of the store.
|
|
82
|
-
marshall_method:
|
|
83
|
+
configatron.cachetastic_default_options.marshall_method = :none # none | yaml | ruby (default: none)
|
|
84
|
+
|
|
83
85
|
# this sets how long objects will live in the cache before they are auto expired.
|
|
84
|
-
default_expiry
|
|
86
|
+
configatron.cachetastic_default_options.default_expiry = 86400 # time in seconds (default: 24 hours)
|
|
87
|
+
|
|
85
88
|
# when setting objects into the cache the expiry_swing is +/- to the expiry time.
|
|
86
89
|
# example: if the expiry time is 1 hour, and the swing is 15 minutes,
|
|
87
90
|
# objects will go into the cache with an expiry time sometime between 45 mins and 75 mins.
|
|
88
|
-
expiry_swing
|
|
91
|
+
configatron.cachetastic_default_options.expiry_swing = 60 * 15 # time in seconds (default: 0)
|
|
92
|
+
|
|
89
93
|
# these options get passed on directly to the store.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
dir: /cachetastic/caches/ # absolute path to the directory where caches should be stored.
|
|
98
|
-
store_options: # listed below are the options for drb
|
|
99
|
-
host: "druby://127.0.0.1:61676"
|
|
100
|
-
# configure logging for this cache:
|
|
101
|
-
logging:
|
|
102
|
-
# n number of logs can be configured for a cache
|
|
103
|
-
# their names can be anything you want, it's doesn't matter
|
|
104
|
-
logger_1:
|
|
105
|
-
# this sets the type of log you want to write to.
|
|
106
|
-
# right now the only two options are file and console
|
|
107
|
-
type: file # console | file (default: none)
|
|
108
|
-
# if the type is file, you need to configure where the log file is to be written.
|
|
109
|
-
file: log/memcached.log # relative | absolute path to log file
|
|
110
|
-
# this sets the level of logging for this cache
|
|
111
|
-
level: info # debug | info | warn | error | fatal (default: info)
|
|
112
|
-
logger_2:
|
|
113
|
-
# this sets the type of log you want to write to.
|
|
114
|
-
# right now the only two options are file and console
|
|
115
|
-
type: console # console | file (default: none)
|
|
116
|
-
# this sets the level of logging for this cache
|
|
117
|
-
level: error # debug | info | warn | error | fatal (default: info)
|
|
94
|
+
# listed below are options for memcache:
|
|
95
|
+
configatron.cachetastic_default_options.store_options.c_threshold = "10_000"
|
|
96
|
+
configatron.cachetastic_default_options.store_options.compression = true
|
|
97
|
+
configatron.cachetastic_default_options.store_options.debug = false
|
|
98
|
+
configatron.cachetastic_default_options.store_options.readonly = false
|
|
99
|
+
configatron.cachetastic_default_options.store_options.urlencode = false
|
|
100
|
+
|
|
118
101
|
# set the servers to be used for memcache
|
|
119
|
-
servers:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
cachetastic_caches_rails_session_cache_options:
|
|
135
|
-
default_expiry: <%= 30.minutes %>
|
|
102
|
+
configatron.cachetastic_default_options.servers = ["127.0.0.1:11211"] # ip:port used for memcache
|
|
103
|
+
|
|
104
|
+
# listed below are the options for file:
|
|
105
|
+
configatron.cachetastic_default_options.store_options.dir = "/cachetastic/caches"
|
|
106
|
+
|
|
107
|
+
# listed below are the options for drb:
|
|
108
|
+
configatron.cachetastic_default_options.servers = ["druby://127.0.0.1:61676"]
|
|
109
|
+
|
|
110
|
+
# configure logging for this cache
|
|
111
|
+
# n number of logs can be configured for a cache
|
|
112
|
+
log_1 = Logger.new(STDOUT)
|
|
113
|
+
log_1.level = Logger::DEBUG
|
|
114
|
+
log_2 = Logger.new("log/cachetastic.log")
|
|
115
|
+
log_2.level = Logger::ERROR
|
|
116
|
+
configatron.cachetastic_default_options.logger = [log_1, log_2]
|
|
136
117
|
</pre>
|
|
137
118
|
<h1>Cachetastic::Drb::Server</h1>
|
|
138
119
|
<p>
|