cachetastic 2.1.4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/LICENSE +21 -0
  2. data/README +57 -43
  3. data/doc/classes/Cachetastic/Adapters.html +180 -0
  4. data/doc/classes/Cachetastic/Adapters/Base.html +206 -123
  5. data/doc/classes/Cachetastic/Adapters/File.html +17 -130
  6. data/doc/classes/Cachetastic/Adapters/LocalMemory.html +7 -228
  7. data/doc/classes/Cachetastic/Adapters/Memcached.html +193 -0
  8. data/doc/classes/Cachetastic/Cache.html +425 -0
  9. data/doc/classes/Cachetastic/Cacheable.html +26 -30
  10. data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +66 -62
  11. data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +30 -30
  12. data/doc/classes/Cachetastic/Logger.html +31 -33
  13. data/doc/created.rid +1 -1
  14. data/doc/files/{lib/cachetastic/adapters/html_file_rb.html → LICENSE.html} +29 -34
  15. data/doc/files/README.html +91 -57
  16. data/doc/files/lib/cachetastic/adapters/base_rb.html +1 -39
  17. data/doc/files/lib/cachetastic/adapters/file_rb.html +1 -21
  18. data/doc/files/lib/cachetastic/adapters/local_memory_rb.html +1 -9
  19. data/doc/files/lib/cachetastic/{ruby_extensions/kernel_rb.html → adapters/memcached_rb.html} +4 -4
  20. data/doc/files/lib/cachetastic/{ruby_extensions/string_rb.html → cache_rb.html} +5 -5
  21. data/doc/files/lib/cachetastic/cacheable_rb.html +1 -1
  22. data/doc/files/lib/cachetastic/{caches/base_rb.html → extensions/string_rb.html} +5 -5
  23. data/doc/files/lib/cachetastic/logger_rb.html +1 -7
  24. data/doc/files/lib/cachetastic/{adapters/store_object_rb.html → store_object_rb.html} +3 -3
  25. data/doc/files/lib/cachetastic_rb.html +4 -95
  26. data/doc/fr_class_index.html +3 -15
  27. data/doc/fr_file_index.html +5 -16
  28. data/doc/fr_method_index.html +26 -78
  29. data/lib/cachetastic.rb +16 -70
  30. data/lib/cachetastic/adapters/base.rb +178 -76
  31. data/lib/cachetastic/adapters/file.rb +63 -46
  32. data/lib/cachetastic/adapters/local_memory.rb +36 -67
  33. data/lib/cachetastic/adapters/memcached.rb +114 -0
  34. data/lib/cachetastic/cache.rb +165 -0
  35. data/lib/cachetastic/cacheable.rb +19 -15
  36. data/lib/cachetastic/extensions/string.rb +8 -0
  37. data/lib/cachetastic/logger.rb +41 -41
  38. data/lib/cachetastic/store_object.rb +22 -0
  39. metadata +43 -64
  40. data/bin/cachetastic_drb_server +0 -115
  41. data/doc/classes/ActiveRecord/Base.html +0 -194
  42. data/doc/classes/CGI/Session/CachetasticStore.html +0 -124
  43. data/doc/classes/Cachetastic/Adapters/Drb.html +0 -332
  44. data/doc/classes/Cachetastic/Adapters/FileBase.html +0 -309
  45. data/doc/classes/Cachetastic/Adapters/HtmlFile.html +0 -224
  46. data/doc/classes/Cachetastic/Adapters/Memcache.html +0 -498
  47. data/doc/classes/Cachetastic/Caches/Base.html +0 -643
  48. data/doc/classes/Cachetastic/Caches/Base/RegisteredCaches.html +0 -179
  49. data/doc/classes/Cachetastic/Caches/MackSessionCache.html +0 -119
  50. data/doc/classes/Cachetastic/Caches/PageCache.html +0 -121
  51. data/doc/classes/Cachetastic/Caches/RailsSessionCache.html +0 -154
  52. data/doc/classes/Cachetastic/Connection.html +0 -212
  53. data/doc/classes/Cachetastic/Errors/UnsupportedAdapter.html +0 -146
  54. data/doc/classes/Object.html +0 -222
  55. data/doc/classes/String.html +0 -172
  56. data/doc/files/lib/cachetastic/adapters/drb_rb.html +0 -115
  57. data/doc/files/lib/cachetastic/adapters/file_base_rb.html +0 -109
  58. data/doc/files/lib/cachetastic/adapters/memcache_rb.html +0 -127
  59. data/doc/files/lib/cachetastic/caches/mack_session_cache_rb.html +0 -107
  60. data/doc/files/lib/cachetastic/caches/page_cache_rb.html +0 -109
  61. data/doc/files/lib/cachetastic/caches/rails_session_cache_rb.html +0 -107
  62. data/doc/files/lib/cachetastic/connection_rb.html +0 -107
  63. data/doc/files/lib/cachetastic/errors/unsupported_adapter_rb.html +0 -101
  64. data/doc/files/lib/cachetastic/rails_extensions/active_record_base_rb.html +0 -101
  65. data/doc/files/lib/cachetastic/rails_extensions/cgi_session_store_rb.html +0 -109
  66. data/doc/files/lib/cachetastic/ruby_extensions/object_rb.html +0 -101
  67. data/lib/cachetastic/adapters/drb.rb +0 -51
  68. data/lib/cachetastic/adapters/file_base.rb +0 -86
  69. data/lib/cachetastic/adapters/html_file.rb +0 -68
  70. data/lib/cachetastic/adapters/memcache.rb +0 -114
  71. data/lib/cachetastic/adapters/store_object.rb +0 -28
  72. data/lib/cachetastic/caches/base.rb +0 -238
  73. data/lib/cachetastic/caches/mack_session_cache.rb +0 -3
  74. data/lib/cachetastic/caches/page_cache.rb +0 -6
  75. data/lib/cachetastic/caches/rails_session_cache.rb +0 -12
  76. data/lib/cachetastic/connection.rb +0 -24
  77. data/lib/cachetastic/errors/unsupported_adapter.rb +0 -7
  78. data/lib/cachetastic/rails_extensions/active_record_base.rb +0 -24
  79. data/lib/cachetastic/rails_extensions/cgi_session_store.rb +0 -59
  80. data/lib/cachetastic/ruby_extensions/kernel.rb +0 -25
  81. data/lib/cachetastic/ruby_extensions/object.rb +0 -22
  82. data/lib/cachetastic/ruby_extensions/string.rb +0 -15
  83. data/test/active_record_test.rb +0 -89
  84. data/test/cacheable_test.rb +0 -88
  85. data/test/cachetastic_unit_test.rb +0 -74
  86. data/test/config.rb +0 -30
  87. data/test/drb_adapter_test.rb +0 -14
  88. data/test/file_adapter_test.rb +0 -49
  89. data/test/memcache_adapter_test.rb +0 -18
  90. data/test/test_helper.rb +0 -75
@@ -1,194 +0,0 @@
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: ActiveRecord::Base</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">ActiveRecord::Base</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/cachetastic/rails_extensions/active_record_base_rb.html">
59
- lib/cachetastic/rails_extensions/active_record_base.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="../Object.html">
69
- Object
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
-
84
-
85
- </div>
86
-
87
- <div id="method-list">
88
- <h3 class="section-bar">Methods</h3>
89
-
90
- <div class="name-list">
91
- <a href="#M000077">cachetastic_key</a>&nbsp;&nbsp;
92
- <a href="#M000078">get_from_cache</a>&nbsp;&nbsp;
93
- </div>
94
- </div>
95
-
96
- </div>
97
-
98
-
99
- <!-- if includes -->
100
- <div id="includes">
101
- <h3 class="section-bar">Included Modules</h3>
102
-
103
- <div id="includes-list">
104
- <span class="include-name"><a href="../Cachetastic/Cacheable.html">Cachetastic::Cacheable</a></span>
105
- </div>
106
- </div>
107
-
108
- <div id="section">
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
- <!-- if method_list -->
118
- <div id="methods">
119
- <h3 class="section-bar">Public Class methods</h3>
120
-
121
- <div id="method-M000078" class="method-detail">
122
- <a name="M000078"></a>
123
-
124
- <div class="method-heading">
125
- <a href="#M000078" class="method-signature">
126
- <span class="method-name">get_from_cache</span><span class="method-args">(key, self_populate = false)</span>
127
- </a>
128
- </div>
129
-
130
- <div class="method-description">
131
- <p>
132
- Returns an object from the cache for a given key. If the object returned is
133
- nil and the self_populate parameter is true then the key will be used to
134
- try and find the object in the database, set the object into the cache, and
135
- then return the object.
136
- </p>
137
- <p><a class="source-toggle" href="#"
138
- onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
139
- <div class="method-source-code" id="M000078-source">
140
- <pre>
141
- <span class="ruby-comment cmt"># File lib/cachetastic/rails_extensions/active_record_base.rb, line 13</span>
142
- 13: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_from_cache</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">self_populate</span> = <span class="ruby-keyword kw">false</span>)
143
- 14: <span class="ruby-identifier">res</span> = <span class="ruby-identifier">cache_class</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
144
- 15: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">self_populate</span>
145
- 16: <span class="ruby-identifier">res</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">constantize</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">key</span>)
146
- 17: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">res</span>.<span class="ruby-identifier">nil?</span>
147
- 18: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">cache_self</span>
148
- 19: <span class="ruby-keyword kw">end</span>
149
- 20: <span class="ruby-keyword kw">end</span>
150
- 21: <span class="ruby-identifier">res</span>
151
- 22: <span class="ruby-keyword kw">end</span>
152
- </pre>
153
- </div>
154
- </div>
155
- </div>
156
-
157
- <h3 class="section-bar">Public Instance methods</h3>
158
-
159
- <div id="method-M000077" class="method-detail">
160
- <a name="M000077"></a>
161
-
162
- <div class="method-heading">
163
- <a href="#M000077" class="method-signature">
164
- <span class="method-name">cachetastic_key</span><span class="method-args">()</span>
165
- </a>
166
- </div>
167
-
168
- <div class="method-description">
169
- <p><a class="source-toggle" href="#"
170
- onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
171
- <div class="method-source-code" id="M000077-source">
172
- <pre>
173
- <span class="ruby-comment cmt"># File lib/cachetastic/rails_extensions/active_record_base.rb, line 5</span>
174
- 5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cachetastic_key</span>
175
- 6: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">id</span>
176
- 7: <span class="ruby-keyword kw">end</span>
177
- </pre>
178
- </div>
179
- </div>
180
- </div>
181
-
182
-
183
- </div>
184
-
185
-
186
- </div>
187
-
188
-
189
- <div id="validator-badges">
190
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
191
- </div>
192
-
193
- </body>
194
- </html>
@@ -1,124 +0,0 @@
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: CGI::Session::CachetasticStore</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">CGI::Session::CachetasticStore</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/lib/cachetastic/rails_extensions/cgi_session_store_rb.html">
59
- lib/cachetastic/rails_extensions/cgi_session_store.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="../../Object.html">
69
- Object
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
- Allows Rails to use Cachetastic for it&#8216;s session store. The setting
86
- below needs to happen AFTER the gem has been required, obviously! In Rails
87
- 1.2.6 this is AFTER the initializer block.
88
- </p>
89
- <pre>
90
- ActionController::Base.session_store = :cachetastic_store
91
- </pre>
92
-
93
- </div>
94
-
95
-
96
- </div>
97
-
98
-
99
- </div>
100
-
101
-
102
- <!-- if includes -->
103
-
104
- <div id="section">
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
- <!-- if method_list -->
114
-
115
-
116
- </div>
117
-
118
-
119
- <div id="validator-badges">
120
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
121
- </div>
122
-
123
- </body>
124
- </html>
@@ -1,332 +0,0 @@
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::Adapters::Drb</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::Adapters::Drb</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/lib/cachetastic/adapters/drb_rb.html">
59
- lib/cachetastic/adapters/drb.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::Adapters::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 adapter uses Cachetastic::Drb::Server as it&#8216;s backing. The
86
- configuration for this should look something like this:
87
- </p>
88
- <pre>
89
- my_awesome_cache_options:
90
- debug: false
91
- adapter: drb
92
- store_options:
93
- host: druby://127.0.0.1:61676
94
- </pre>
95
-
96
- </div>
97
-
98
-
99
- </div>
100
-
101
- <div id="method-list">
102
- <h3 class="section-bar">Methods</h3>
103
-
104
- <div class="name-list">
105
- <a href="#M000045">delete</a>&nbsp;&nbsp;
106
- <a href="#M000042">expire_all</a>&nbsp;&nbsp;
107
- <a href="#M000043">get</a>&nbsp;&nbsp;
108
- <a href="#M000044">set</a>&nbsp;&nbsp;
109
- <a href="#M000041">setup</a>&nbsp;&nbsp;
110
- <a href="#M000046">stats</a>&nbsp;&nbsp;
111
- <a href="#M000040">valid?</a>&nbsp;&nbsp;
112
- </div>
113
- </div>
114
-
115
- </div>
116
-
117
-
118
- <!-- if includes -->
119
-
120
- <div id="section">
121
-
122
-
123
-
124
-
125
-
126
- <div id="attribute-list">
127
- <h3 class="section-bar">Attributes</h3>
128
-
129
- <div class="name-list">
130
- <table>
131
- <tr class="top-aligned-row context-row">
132
- <td class="context-item-name">drb_store</td>
133
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
134
- <td class="context-item-desc"></td>
135
- </tr>
136
- </table>
137
- </div>
138
- </div>
139
-
140
-
141
-
142
- <!-- if method_list -->
143
- <div id="methods">
144
- <h3 class="section-bar">Public Instance methods</h3>
145
-
146
- <div id="method-M000045" class="method-detail">
147
- <a name="M000045"></a>
148
-
149
- <div class="method-heading">
150
- <a href="#M000045" class="method-signature">
151
- <span class="method-name">delete</span><span class="method-args">(key, delay = 0)</span>
152
- </a>
153
- </div>
154
-
155
- <div class="method-description">
156
- <p><a class="source-toggle" href="#"
157
- onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
158
- <div class="method-source-code" id="M000045-source">
159
- <pre>
160
- <span class="ruby-comment cmt"># File lib/cachetastic/adapters/drb.rb, line 38</span>
161
- 38: <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>)
162
- 39: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drb_store</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">key</span>)
163
- 40: <span class="ruby-keyword kw">end</span>
164
- </pre>
165
- </div>
166
- </div>
167
- </div>
168
-
169
- <div id="method-M000042" class="method-detail">
170
- <a name="M000042"></a>
171
-
172
- <div class="method-heading">
173
- <a href="#M000042" class="method-signature">
174
- <span class="method-name">expire_all</span><span class="method-args">()</span>
175
- </a>
176
- </div>
177
-
178
- <div class="method-description">
179
- <p><a class="source-toggle" href="#"
180
- onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
181
- <div class="method-source-code" id="M000042-source">
182
- <pre>
183
- <span class="ruby-comment cmt"># File lib/cachetastic/adapters/drb.rb, line 25</span>
184
- 25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expire_all</span>
185
- 26: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drb_store</span>.<span class="ruby-identifier">expire_all</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>)
186
- 27: <span class="ruby-keyword kw">end</span>
187
- </pre>
188
- </div>
189
- </div>
190
- </div>
191
-
192
- <div id="method-M000043" class="method-detail">
193
- <a name="M000043"></a>
194
-
195
- <div class="method-heading">
196
- <a href="#M000043" class="method-signature">
197
- <span class="method-name">get</span><span class="method-args">(key)</span>
198
- </a>
199
- </div>
200
-
201
- <div class="method-description">
202
- <p>
203
- See <a href="Base.html">Cachetastic::Adapters::Base</a>
204
- </p>
205
- <p><a class="source-toggle" href="#"
206
- onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
207
- <div class="method-source-code" id="M000043-source">
208
- <pre>
209
- <span class="ruby-comment cmt"># File lib/cachetastic/adapters/drb.rb, line 30</span>
210
- 30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">key</span>)
211
- 31: <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Caches</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">unmarshall</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drb_store</span>.<span class="ruby-identifier">get</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">key</span>))
212
- 32: <span class="ruby-keyword kw">end</span>
213
- </pre>
214
- </div>
215
- </div>
216
- </div>
217
-
218
- <div id="method-M000044" class="method-detail">
219
- <a name="M000044"></a>
220
-
221
- <div class="method-heading">
222
- <a href="#M000044" class="method-signature">
223
- <span class="method-name">set</span><span class="method-args">(key, value, expiry = 0)</span>
224
- </a>
225
- </div>
226
-
227
- <div class="method-description">
228
- <p><a class="source-toggle" href="#"
229
- onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
230
- <div class="method-source-code" id="M000044-source">
231
- <pre>
232
- <span class="ruby-comment cmt"># File lib/cachetastic/adapters/drb.rb, line 34</span>
233
- 34: <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>)
234
- 35: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drb_store</span>.<span class="ruby-identifier">set</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">key</span>, <span class="ruby-constant">Cachetastic</span><span class="ruby-operator">::</span><span class="ruby-constant">Caches</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">marshall</span>(<span class="ruby-identifier">value</span>), <span class="ruby-identifier">expiry</span>)
235
- 36: <span class="ruby-keyword kw">end</span>
236
- </pre>
237
- </div>
238
- </div>
239
- </div>
240
-
241
- <div id="method-M000041" class="method-detail">
242
- <a name="M000041"></a>
243
-
244
- <div class="method-heading">
245
- <a href="#M000041" class="method-signature">
246
- <span class="method-name">setup</span><span class="method-args">()</span>
247
- </a>
248
- </div>
249
-
250
- <div class="method-description">
251
- <p><a class="source-toggle" href="#"
252
- onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
253
- <div class="method-source-code" id="M000041-source">
254
- <pre>
255
- <span class="ruby-comment cmt"># File lib/cachetastic/adapters/drb.rb, line 20</span>
256
- 20: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
257
- 21: <span class="ruby-comment cmt"># self.all_options[&quot;marshall_method&quot;] = &quot;ruby&quot;</span>
258
- 22: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drb_store</span> = <span class="ruby-constant">DRbObject</span>.<span class="ruby-identifier">new_with_uri</span>(<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">servers</span>)
259
- 23: <span class="ruby-keyword kw">end</span>
260
- </pre>
261
- </div>
262
- </div>
263
- </div>
264
-
265
- <div id="method-M000046" class="method-detail">
266
- <a name="M000046"></a>
267
-
268
- <div class="method-heading">
269
- <a href="#M000046" class="method-signature">
270
- <span class="method-name">stats</span><span class="method-args">()</span>
271
- </a>
272
- </div>
273
-
274
- <div class="method-description">
275
- <p><a class="source-toggle" href="#"
276
- onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
277
- <div class="method-source-code" id="M000046-source">
278
- <pre>
279
- <span class="ruby-comment cmt"># File lib/cachetastic/adapters/drb.rb, line 42</span>
280
- 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
281
- 43: <span class="ruby-keyword kw">super</span>
282
- 44: <span class="ruby-keyword kw">begin</span>
283
- 45: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drb_store</span>.<span class="ruby-identifier">stats</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drb_store</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value str">'stats'</span>
284
- 46: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
285
- 47: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Calling stats on the DRb store raised this exception: #{e.message}&quot;</span>
286
- 48: <span class="ruby-keyword kw">end</span>
287
- 49: <span class="ruby-keyword kw">end</span>
288
- </pre>
289
- </div>
290
- </div>
291
- </div>
292
-
293
- <div id="method-M000040" class="method-detail">
294
- <a name="M000040"></a>
295
-
296
- <div class="method-heading">
297
- <a href="#M000040" class="method-signature">
298
- <span class="method-name">valid?</span><span class="method-args">()</span>
299
- </a>
300
- </div>
301
-
302
- <div class="method-description">
303
- <p><a class="source-toggle" href="#"
304
- onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
305
- <div class="method-source-code" id="M000040-source">
306
- <pre>
307
- <span class="ruby-comment cmt"># File lib/cachetastic/adapters/drb.rb, line 12</span>
308
- 12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
309
- 13: <span class="ruby-keyword kw">begin</span>
310
- 14: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">drb_store</span>.<span class="ruby-identifier">ping</span>
311
- 15: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
312
- 16: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
313
- 17: <span class="ruby-keyword kw">end</span>
314
- 18: <span class="ruby-keyword kw">end</span>
315
- </pre>
316
- </div>
317
- </div>
318
- </div>
319
-
320
-
321
- </div>
322
-
323
-
324
- </div>
325
-
326
-
327
- <div id="validator-badges">
328
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
329
- </div>
330
-
331
- </body>
332
- </html>