cachetastic-three 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 +89 -0
- data/doc/classes/Cachetastic/Adapters.html +180 -0
- data/doc/classes/Cachetastic/Adapters/Base.html +419 -0
- data/doc/classes/Cachetastic/Adapters/File.html +135 -0
- data/doc/classes/Cachetastic/Adapters/LocalMemory.html +125 -0
- data/doc/classes/Cachetastic/Adapters/Memcached.html +193 -0
- data/doc/classes/Cachetastic/Cache.html +425 -0
- data/doc/classes/Cachetastic/Cacheable.html +255 -0
- data/doc/classes/Cachetastic/Cacheable/ClassAndInstanceMethods.html +290 -0
- data/doc/classes/Cachetastic/Cacheable/ClassOnlyMethods.html +197 -0
- data/doc/classes/Cachetastic/Logger.html +186 -0
- data/doc/created.rid +1 -0
- data/doc/files/LICENSE.html +132 -0
- data/doc/files/README.html +222 -0
- data/doc/files/lib/cachetastic/adapters/base_rb.html +101 -0
- data/doc/files/lib/cachetastic/adapters/file_rb.html +101 -0
- data/doc/files/lib/cachetastic/adapters/local_memory_rb.html +101 -0
- data/doc/files/lib/cachetastic/adapters/memcached_rb.html +101 -0
- data/doc/files/lib/cachetastic/cache_rb.html +101 -0
- data/doc/files/lib/cachetastic/cacheable_rb.html +101 -0
- data/doc/files/lib/cachetastic/extensions/string_rb.html +108 -0
- data/doc/files/lib/cachetastic/logger_rb.html +101 -0
- data/doc/files/lib/cachetastic/store_object_rb.html +101 -0
- data/doc/files/lib/cachetastic_rb.html +112 -0
- data/doc/fr_class_index.html +36 -0
- data/doc/fr_file_index.html +38 -0
- data/doc/fr_method_index.html +52 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/cachetastic.rb +20 -0
- data/lib/cachetastic/adapters/base.rb +178 -0
- data/lib/cachetastic/adapters/file.rb +66 -0
- data/lib/cachetastic/adapters/local_memory.rb +37 -0
- data/lib/cachetastic/adapters/memcached.rb +114 -0
- data/lib/cachetastic/cache.rb +165 -0
- data/lib/cachetastic/cacheable.rb +202 -0
- data/lib/cachetastic/extensions/string.rb +8 -0
- data/lib/cachetastic/logger.rb +49 -0
- data/lib/cachetastic/store_object.rb +22 -0
- metadata +122 -0
@@ -0,0 +1,135 @@
|
|
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::File</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Cachetastic::Adapters::File</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/cachetastic/adapters/file_rb.html">
|
59
|
+
lib/cachetastic/adapters/file.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Base.html">
|
69
|
+
Cachetastic::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
|
+
An adapter to cache objects to the file system.
|
86
|
+
</p>
|
87
|
+
<p>
|
88
|
+
This adapter supports the following configuration settings, in addition to
|
89
|
+
the default settings:
|
90
|
+
</p>
|
91
|
+
<pre>
|
92
|
+
configatron.cachetastic.defaults.storage_path = ::File.join(FileUtils.pwd, 'cachetastic')
|
93
|
+
configatron.cachetastic.defaults.marshal_method = :yaml
|
94
|
+
</pre>
|
95
|
+
<p>
|
96
|
+
The <tt>storage_path</tt> setting defines the path to where cached objects
|
97
|
+
are written to on disk.
|
98
|
+
</p>
|
99
|
+
<p>
|
100
|
+
See <tt><a href="Base.html">Cachetastic::Adapters::Base</a></tt> for a list
|
101
|
+
of public API methods.
|
102
|
+
</p>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
<!-- if includes -->
|
114
|
+
|
115
|
+
<div id="section">
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<!-- if method_list -->
|
125
|
+
|
126
|
+
|
127
|
+
</div>
|
128
|
+
|
129
|
+
|
130
|
+
<div id="validator-badges">
|
131
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
</body>
|
135
|
+
</html>
|
@@ -0,0 +1,125 @@
|
|
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::LocalMemory</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::LocalMemory</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/cachetastic/adapters/local_memory_rb.html">
|
59
|
+
lib/cachetastic/adapters/local_memory.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
|
+
An adapter to cache objects to memory. It is important to note that this
|
86
|
+
cache is <b>volatile</b>. If the VM it is running in shuts down, everything
|
87
|
+
in the cache gets vaporized.
|
88
|
+
</p>
|
89
|
+
<p>
|
90
|
+
See <tt><a href="Base.html">Cachetastic::Adapters::Base</a></tt> for a list
|
91
|
+
of public API methods.
|
92
|
+
</p>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if includes -->
|
104
|
+
|
105
|
+
<div id="section">
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<!-- if method_list -->
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
<div id="validator-badges">
|
121
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
</body>
|
125
|
+
</html>
|
@@ -0,0 +1,193 @@
|
|
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::Memcached</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::Memcached</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/cachetastic/adapters/memcached_rb.html">
|
59
|
+
lib/cachetastic/adapters/memcached.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
|
+
An adapter to cache objects to the file system.
|
86
|
+
</p>
|
87
|
+
<p>
|
88
|
+
This adapter supports the following configuration settings, in addition to
|
89
|
+
the default settings:
|
90
|
+
</p>
|
91
|
+
<pre>
|
92
|
+
configatron.cachetastic.defaults.servers = ['127.0.0.1:11211']
|
93
|
+
configatron.cachetastic.defaults.mc_options = {:c_threshold => 10_000,
|
94
|
+
:compression => true,
|
95
|
+
:debug => false,
|
96
|
+
:readonly => false,
|
97
|
+
:urlencode => false}
|
98
|
+
configatron.cachetastic.delete_delay = 0
|
99
|
+
</pre>
|
100
|
+
<p>
|
101
|
+
The <tt>servers</tt> setting defines an <tt>Array</tt> of Mecached servers,
|
102
|
+
represented as "<host>:<port>".
|
103
|
+
</p>
|
104
|
+
<p>
|
105
|
+
The <tt>mc_options</tt> setting is a <tt>Hash</tt> of settings required by
|
106
|
+
<a href="Memcached.html">Memcached</a>. See the <a
|
107
|
+
href="Memcached.html">Memcached</a> documentation for more information on
|
108
|
+
what the settings mean.
|
109
|
+
</p>
|
110
|
+
<p>
|
111
|
+
The <tt>delete_delay</tt> setting tells <a
|
112
|
+
href="Memcached.html">Memcached</a> how long to wait before it deletes the
|
113
|
+
object. This is not the same as <tt>expiry_time</tt>. It is only used when
|
114
|
+
the <tt>delete</tt> method is called.
|
115
|
+
</p>
|
116
|
+
<p>
|
117
|
+
See <tt><a href="Base.html">Cachetastic::Adapters::Base</a></tt> for a list
|
118
|
+
of public API methods.
|
119
|
+
</p>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
|
123
|
+
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<div id="method-list">
|
127
|
+
<h3 class="section-bar">Methods</h3>
|
128
|
+
|
129
|
+
<div class="name-list">
|
130
|
+
<a href="#M000002">valid?</a>
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
<!-- if includes -->
|
138
|
+
|
139
|
+
<div id="section">
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
<!-- if method_list -->
|
149
|
+
<div id="methods">
|
150
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
151
|
+
|
152
|
+
<div id="method-M000002" class="method-detail">
|
153
|
+
<a name="M000002"></a>
|
154
|
+
|
155
|
+
<div class="method-heading">
|
156
|
+
<a href="#M000002" class="method-signature">
|
157
|
+
<span class="method-name">valid?</span><span class="method-args">()</span>
|
158
|
+
</a>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<div class="method-description">
|
162
|
+
<p>
|
163
|
+
Return <tt>false</tt> if the connection to <a
|
164
|
+
href="Memcached.html">Memcached</a> is either <tt>nil</tt> or not active.
|
165
|
+
</p>
|
166
|
+
<p><a class="source-toggle" href="#"
|
167
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
168
|
+
<div class="method-source-code" id="M000002-source">
|
169
|
+
<pre>
|
170
|
+
<span class="ruby-comment cmt"># File lib/cachetastic/adapters/memcached.rb, line 70</span>
|
171
|
+
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
|
172
|
+
71: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@_mc_connection</span>.<span class="ruby-identifier">nil?</span>
|
173
|
+
72: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@_mc_connection</span>.<span class="ruby-identifier">active?</span>
|
174
|
+
73: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
175
|
+
74: <span class="ruby-keyword kw">end</span>
|
176
|
+
</pre>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
</div>
|
186
|
+
|
187
|
+
|
188
|
+
<div id="validator-badges">
|
189
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
</body>
|
193
|
+
</html>
|