cachetastic 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/doc/classes/ActiveRecord/Base.html +188 -0
  2. data/doc/classes/CGI/Session/CachetasticStore.html +124 -0
  3. data/doc/classes/Cachetastic/Adapters/Base.html +331 -0
  4. data/doc/classes/Cachetastic/Adapters/Drb.html +332 -0
  5. data/doc/classes/Cachetastic/Adapters/File.html +248 -0
  6. data/doc/classes/Cachetastic/Adapters/FileBase.html +309 -0
  7. data/doc/classes/Cachetastic/Adapters/HtmlFile.html +224 -0
  8. data/doc/classes/Cachetastic/Adapters/LocalMemory.html +346 -0
  9. data/doc/classes/Cachetastic/Adapters/Memcache.html +498 -0
  10. data/doc/classes/Cachetastic/Cacheable.html +264 -0
  11. data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +287 -0
  12. data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +200 -0
  13. data/doc/classes/Cachetastic/Caches/Base.html +672 -0
  14. data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +179 -0
  15. data/doc/classes/Cachetastic/Caches/MackSessionCache.html +119 -0
  16. data/doc/classes/Cachetastic/Caches/PageCache.html +121 -0
  17. data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +154 -0
  18. data/doc/classes/Cachetastic/Connection.html +212 -0
  19. data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +146 -0
  20. data/doc/classes/Cachetastic/Logger.html +189 -0
  21. data/doc/classes/Object.html +152 -0
  22. data/doc/created.rid +1 -0
  23. data/doc/files/README.html +207 -0
  24. data/doc/files/lib/adapters/cachetastic_adapters_base_rb.html +139 -0
  25. data/doc/files/lib/adapters/cachetastic_adapters_drb_rb.html +115 -0
  26. data/doc/files/lib/adapters/cachetastic_adapters_file_base_rb.html +109 -0
  27. data/doc/files/lib/adapters/cachetastic_adapters_file_rb.html +121 -0
  28. data/doc/files/lib/adapters/cachetastic_adapters_html_file_rb.html +137 -0
  29. data/doc/files/lib/adapters/cachetastic_adapters_local_memory_rb.html +109 -0
  30. data/doc/files/lib/adapters/cachetastic_adapters_memcache_rb.html +127 -0
  31. data/doc/files/lib/adapters/cachetastic_adapters_store_object_rb.html +101 -0
  32. data/doc/files/lib/caches/cachetastic_caches_base_rb.html +108 -0
  33. data/doc/files/lib/caches/cachetastic_caches_mack_session_cache_rb.html +107 -0
  34. data/doc/files/lib/caches/cachetastic_caches_page_cache_rb.html +109 -0
  35. data/doc/files/lib/caches/cachetastic_caches_rails_session_cache_rb.html +107 -0
  36. data/doc/files/lib/cachetastic_cacheable_rb.html +101 -0
  37. data/doc/files/lib/cachetastic_connection_rb.html +107 -0
  38. data/doc/files/lib/cachetastic_logger_rb.html +107 -0
  39. data/doc/files/lib/cachetastic_rb.html +222 -0
  40. data/doc/files/lib/errors/cachetastic_errors_unsupported_adapter_rb.html +101 -0
  41. data/doc/files/lib/rails_extensions/cachetastic_active_record_base_rb.html +101 -0
  42. data/doc/files/lib/rails_extensions/cgi_session_cachetastic_store_rb.html +109 -0
  43. data/doc/files/lib/ruby_extensions/object_rb.html +101 -0
  44. data/doc/fr_class_index.html +47 -0
  45. data/doc/fr_file_index.html +47 -0
  46. data/doc/fr_method_index.html +100 -0
  47. data/doc/index.html +24 -0
  48. data/doc/rdoc-style.css +208 -0
  49. data/lib/cachetastic.rb +21 -23
  50. data/lib/cachetastic_cacheable.rb +202 -0
  51. data/lib/rails_extensions/cachetastic_active_record_base.rb +12 -39
  52. data/lib/ruby_extensions/object.rb +8 -0
  53. data/test/active_record_test.rb +8 -8
  54. data/test/cacheable_test.rb +72 -0
  55. metadata +52 -2
  56. data/lib/helpers/cachetastic_helpers_active_record.rb +0 -46
@@ -0,0 +1,107 @@
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>File: cachetastic_logger.rb</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="fileHeader">
50
+ <h1>cachetastic_logger.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/cachetastic_logger.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Tue Jun 03 13:14:49 -0400 2008</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <p>
73
+ This class handles logging for the caches and their adapters.
74
+ </p>
75
+
76
+ </div>
77
+
78
+
79
+ </div>
80
+
81
+
82
+ </div>
83
+
84
+
85
+ <!-- if includes -->
86
+
87
+ <div id="section">
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <!-- if method_list -->
97
+
98
+
99
+ </div>
100
+
101
+
102
+ <div id="validator-badges">
103
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
104
+ </div>
105
+
106
+ </body>
107
+ </html>
@@ -0,0 +1,222 @@
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>File: cachetastic.rb</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="fileHeader">
50
+ <h1>cachetastic.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/cachetastic.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Tue Jun 03 16:59:08 -0400 2008</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <h1>Configuration:</h1>
73
+ <pre>
74
+ cachetastic_default_options:
75
+ # this will dump into the log, configuration info for each cache, as well as the .inspect
76
+ # for each object returned from the cache
77
+ debug: true # true | false (default: false)
78
+ # this is the type of file store to be used for this cache.
79
+ # more adapters can be developed and plugged in as desired
80
+ adapter: local_memory # local_memory | memcache | file | drb | html_file (default: local_memory)
81
+ # this will marshall objects into and out of the store.
82
+ marshall_method: none # none | yaml | ruby (default: none)
83
+ # this sets how long objects will live in the cache before they are auto expired.
84
+ default_expiry: &lt;%= 24.hours %&gt; # time in seconds (default: 24 hours)
85
+ # when setting objects into the cache the expiry_swing is +/- to the expiry time.
86
+ # example: if the expiry time is 1 hour, and the swing is 15 minutes,
87
+ # objects will go into the cache with an expiry time sometime between 45 mins and 75 mins.
88
+ expiry_swing: &lt;%= 15.minutes %&gt; # time in seconds (default: 0)
89
+ # these options get passed on directly to the store.
90
+ store_options: # listed below are options for memcache
91
+ c_threshold: 10_000
92
+ compression: true
93
+ debug: false
94
+ readonly: false
95
+ urlencode: false
96
+ store_options: # listed below are the options for file
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: &quot;druby://127.0.0.1:61676&quot;
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)
118
+ # set the servers to be used for memcache
119
+ servers:
120
+ - 127.0.0.1:11211 # ip:port used for memcache
121
+ </pre>
122
+ <p>
123
+ # example of how to override options for page cacheing:
124
+ </p>
125
+ <pre>
126
+ cachetastic_caches_page_cache_options:
127
+ default_expiry: &lt;%= 1.hour %&gt;
128
+ expiry_swing: &lt;%= 15.minutes %&gt;
129
+ </pre>
130
+ <p>
131
+ # example of how to override options for rails session cacheing:
132
+ </p>
133
+ <pre>
134
+ cachetastic_caches_rails_session_cache_options:
135
+ default_expiry: &lt;%= 30.minutes %&gt;
136
+ </pre>
137
+ <h1>Cachetastic::Drb::Server</h1>
138
+ <p>
139
+ If you want to use Drb and the <a
140
+ href="../../classes/Cachetastic/Adapters/Drb.html">Cachetastic::Adapters::Drb</a>
141
+ adapter, you&#8216;ll have to use the Cachetastic::Drb::Server that comes
142
+ with Cachetastic. Using this server is simple. It gets installed as a
143
+ binary when you install the Cachetastic gem.
144
+ </p>
145
+ <pre>
146
+ $ cachetastic_drb_server # that will start the drb server on the host 127.0.0.1 on the port 61676
147
+ </pre>
148
+ <p>
149
+ The server takes to command line parameters: -h &lt;host&gt; -p
150
+ &lt;port&gt; -v &lt;verbose&gt; -rv &lt;really verbose&gt;
151
+ </p>
152
+ <h1>Examples:</h1>
153
+ <pre>
154
+ class MyAwesomeCache &lt; Cachetastic::Caches::Base
155
+ end
156
+
157
+ MyAwesomeCache.set(1, [1,2,3])
158
+ MyAwesomeCache.get(1) # =&gt; [1,2,3]
159
+
160
+ class MyAwesomeCache &lt; Cachetastic::Caches::Base
161
+ class &lt;&lt; self
162
+ def get(key, x, y)
163
+ super(key) do
164
+ n = x + y
165
+ set(key, n)
166
+ n
167
+ end
168
+ end
169
+ end
170
+ end
171
+
172
+ MyAwesomeCache.get(1, 2, 4) # =&gt; 8
173
+ MyAwesomeCache.get(1, 4, 4) # =&gt; 8
174
+ </pre>
175
+
176
+ </div>
177
+
178
+ <div id="requires-list">
179
+ <h3 class="section-bar">Required files</h3>
180
+
181
+ <div class="name-list">
182
+ rubygems&nbsp;&nbsp;
183
+ singleton&nbsp;&nbsp;
184
+ logger&nbsp;&nbsp;
185
+ yaml&nbsp;&nbsp;
186
+ zlib&nbsp;&nbsp;
187
+ pp&nbsp;&nbsp;
188
+ drb&nbsp;&nbsp;
189
+ application_configuration&nbsp;&nbsp;
190
+ memcache&nbsp;&nbsp;
191
+ </div>
192
+ </div>
193
+
194
+ </div>
195
+
196
+
197
+ </div>
198
+
199
+
200
+ <!-- if includes -->
201
+
202
+ <div id="section">
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+ <!-- if method_list -->
212
+
213
+
214
+ </div>
215
+
216
+
217
+ <div id="validator-badges">
218
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
219
+ </div>
220
+
221
+ </body>
222
+ </html>
@@ -0,0 +1,101 @@
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>File: cachetastic_errors_unsupported_adapter.rb</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="fileHeader">
50
+ <h1>cachetastic_errors_unsupported_adapter.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/errors/cachetastic_errors_unsupported_adapter.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Tue Jun 03 13:14:49 -0400 2008</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -0,0 +1,101 @@
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>File: cachetastic_active_record_base.rb</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="fileHeader">
50
+ <h1>cachetastic_active_record_base.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/rails_extensions/cachetastic_active_record_base.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Tue Jun 03 17:25:57 -0400 2008</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>