mongrel_esi 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +8 -8
- data/Rakefile +4 -12
- data/doc/rdoc/classes/ESI.html +169 -0
- data/doc/rdoc/classes/ESI/Cache.html +178 -0
- data/doc/rdoc/classes/ESI/Cache.src/M000060.html +17 -0
- data/doc/rdoc/classes/ESI/Cache.src/M000061.html +20 -0
- data/doc/rdoc/classes/ESI/Config.html +291 -0
- data/doc/rdoc/classes/ESI/Config.src/M000043.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/M000044.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/M000045.html +35 -0
- data/doc/rdoc/classes/ESI/Config.src/M000046.html +38 -0
- data/doc/rdoc/classes/ESI/Config.src/M000047.html +23 -0
- data/doc/rdoc/classes/ESI/Config.src/M000048.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/M000049.html +20 -0
- data/doc/rdoc/classes/ESI/Config.src/M000050.html +18 -0
- data/doc/rdoc/classes/ESI/Config.src/M000051.html +24 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.html +212 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000055.html +19 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000056.html +19 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000057.html +18 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000058.html +18 -0
- data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000059.html +18 -0
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.html +187 -0
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000052.html +19 -0
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000053.html +21 -0
- data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000054.html +21 -0
- data/doc/rdoc/classes/ESI/Dispatcher.html +172 -0
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000062.html +23 -0
- data/doc/rdoc/classes/ESI/Dispatcher.src/M000063.html +20 -0
- data/doc/rdoc/classes/ESI/Fragment.html +218 -0
- data/doc/rdoc/classes/ESI/Fragment.src/M000076.html +21 -0
- data/doc/rdoc/classes/ESI/Fragment.src/M000077.html +18 -0
- data/doc/rdoc/classes/ESI/Fragment.src/M000078.html +18 -0
- data/doc/rdoc/classes/ESI/Handler.html +236 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000079.html +19 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000080.html +161 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000081.html +24 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000082.html +18 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000083.html +26 -0
- data/doc/rdoc/classes/ESI/Handler.src/M000084.html +30 -0
- data/doc/rdoc/classes/ESI/Invalidator.html +131 -0
- data/doc/rdoc/classes/ESI/Invalidator.src/M000004.html +41 -0
- data/doc/rdoc/classes/ESI/Log.html +251 -0
- data/doc/rdoc/classes/ESI/Log.src/M000005.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000006.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000007.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000008.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000009.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000010.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000011.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000012.html +18 -0
- data/doc/rdoc/classes/ESI/Log.src/M000013.html +18 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.html +314 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000034.html +24 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000035.html +22 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000036.html +19 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000037.html +23 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000038.html +18 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000039.html +19 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000040.html +18 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000041.html +18 -0
- data/doc/rdoc/classes/ESI/MemcachedCache.src/M000042.html +17 -0
- data/doc/rdoc/classes/ESI/Router.html +229 -0
- data/doc/rdoc/classes/ESI/Router.src/M000073.html +36 -0
- data/doc/rdoc/classes/ESI/Router.src/M000074.html +25 -0
- data/doc/rdoc/classes/ESI/Router.src/M000075.html +24 -0
- data/doc/rdoc/classes/ESI/RubyCache.html +278 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000064.html +20 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000065.html +22 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000066.html +21 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000067.html +22 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000068.html +18 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000069.html +22 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000070.html +18 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000071.html +18 -0
- data/doc/rdoc/classes/ESI/RubyCache.src/M000072.html +18 -0
- data/doc/rdoc/classes/ESI/Tag.html +137 -0
- data/doc/rdoc/classes/ESI/Tag/Attempt.html +113 -0
- data/doc/rdoc/classes/ESI/Tag/Base.html +267 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000028.html +26 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000029.html +23 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000030.html +22 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000031.html +18 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000032.html +22 -0
- data/doc/rdoc/classes/ESI/Tag/Base.src/M000033.html +23 -0
- data/doc/rdoc/classes/ESI/Tag/Except.html +184 -0
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000020.html +21 -0
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000021.html +20 -0
- data/doc/rdoc/classes/ESI/Tag/Except.src/M000022.html +18 -0
- data/doc/rdoc/classes/ESI/Tag/Include.html +189 -0
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000017.html +20 -0
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000018.html +18 -0
- data/doc/rdoc/classes/ESI/Tag/Include.src/M000019.html +125 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.html +199 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.src/M000014.html +18 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest.src/M000015.html +42 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest/Error.html +155 -0
- data/doc/rdoc/classes/ESI/Tag/IncludeRequest/Error.src/M000016.html +19 -0
- data/doc/rdoc/classes/ESI/Tag/Invalidate.html +171 -0
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000025.html +19 -0
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000026.html +51 -0
- data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000027.html +19 -0
- data/doc/rdoc/classes/ESI/Tag/Try.html +161 -0
- data/doc/rdoc/classes/ESI/Tag/Try.src/M000023.html +40 -0
- data/doc/rdoc/classes/ESI/Tag/Try.src/M000024.html +18 -0
- data/doc/rdoc/classes/MultiDirHandler.html +198 -0
- data/doc/rdoc/classes/MultiDirHandler.src/M000001.html +20 -0
- data/doc/rdoc/classes/MultiDirHandler.src/M000002.html +28 -0
- data/doc/rdoc/classes/MultiDirHandler.src/M000003.html +22 -0
- data/doc/rdoc/classes/Net.html +119 -0
- data/doc/rdoc/classes/Net/An.html +114 -0
- data/doc/rdoc/classes/Net/An/HTTP.html +137 -0
- data/doc/rdoc/classes/Net/An/HTTP.src/M000087.html +17 -0
- data/doc/rdoc/classes/Net/An/IORequest.html +139 -0
- data/doc/rdoc/classes/Net/An/IORequest.src/M000088.html +17 -0
- data/doc/rdoc/classes/Net/An/IOResponse.html +139 -0
- data/doc/rdoc/classes/Net/An/IOResponse.src/M000085.html +17 -0
- data/doc/rdoc/classes/Net/An/IOSocket.html +137 -0
- data/doc/rdoc/classes/Net/An/IOSocket.src/M000086.html +17 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/COPYING.html +168 -0
- data/doc/rdoc/files/LICENSE.html +605 -0
- data/doc/rdoc/files/README.html +361 -0
- data/doc/rdoc/files/lib/esi/cache_rb.html +113 -0
- data/doc/rdoc/files/lib/esi/config_rb.html +108 -0
- data/doc/rdoc/files/lib/esi/dispatcher_rb.html +109 -0
- data/doc/rdoc/files/lib/esi/handler_rb.html +121 -0
- data/doc/rdoc/files/lib/esi/invalidator_rb.html +117 -0
- data/doc/rdoc/files/lib/esi/logger_rb.html +108 -0
- data/doc/rdoc/files/lib/esi/router_rb.html +101 -0
- data/doc/rdoc/files/lib/esi/tag/attempt_rb.html +101 -0
- data/doc/rdoc/files/lib/esi/tag/base_rb.html +108 -0
- data/doc/rdoc/files/lib/esi/tag/except_rb.html +101 -0
- data/doc/rdoc/files/lib/esi/tag/include_rb.html +109 -0
- data/doc/rdoc/files/lib/esi/tag/invalidate_rb.html +109 -0
- data/doc/rdoc/files/lib/esi/tag/try_rb.html +108 -0
- data/doc/rdoc/files/lib/multi_dirhandler_rb.html +109 -0
- data/doc/rdoc/files/lib/net/ahttp_rb.html +109 -0
- data/doc/rdoc/fr_class_index.html +55 -0
- data/doc/rdoc/fr_file_index.html +44 -0
- data/doc/rdoc/fr_method_index.html +114 -0
- data/doc/rdoc/index.html +24 -0
- data/doc/rdoc/rdoc-style.css +208 -0
- data/ext/esi/esi_parser.c +36 -156
- data/ext/esi/test/parser.c +42 -43
- data/ext/esi/test1.rb +2 -2
- data/lib/esi/cache.rb +83 -72
- data/lib/esi/handler.rb +5 -20
- data/lib/multi_dirhandler.rb +13 -0
- data/lib/net/ahttp.rb +36 -0
- data/test/integration/handler_test.rb +1 -1
- metadata +222 -45
- data/test/unit/sample.html +0 -21
@@ -0,0 +1,25 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>url_for (ESI::Router)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/router.rb, line 61</span>
|
14
|
+
61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url_for</span>( <span class="ruby-identifier">request_uri</span> )
|
15
|
+
62: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">request_uri</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_uri</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/http:\/\//</span>)
|
16
|
+
63: <span class="ruby-comment cmt"># locate the first entry to match the given uri</span>
|
17
|
+
64: <span class="ruby-identifier">config</span> = <span class="ruby-ivar">@hosts</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cfg</span><span class="ruby-operator">|</span>
|
18
|
+
65: <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>]).<span class="ruby-identifier">match</span>(<span class="ruby-identifier">request_uri</span>)
|
19
|
+
66: <span class="ruby-keyword kw">end</span>
|
20
|
+
67: <span class="ruby-identifier">config</span> = <span class="ruby-ivar">@default</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config</span>
|
21
|
+
68: <span class="ruby-comment cmt"># build a url given a valid config or abort 404 not found</span>
|
22
|
+
69: <span class="ruby-value str">"http://"</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:host</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">":"</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:port</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">""</span>).<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">request_uri</span>).<span class="ruby-identifier">squeeze</span>(<span class="ruby-value str">"/"</span>)
|
23
|
+
70: <span class="ruby-keyword kw">end</span></pre>
|
24
|
+
</body>
|
25
|
+
</html>
|
@@ -0,0 +1,24 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>cache_ttl (ESI::Router)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/router.rb, line 72</span>
|
14
|
+
72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_ttl</span>( <span class="ruby-identifier">request_uri</span> )
|
15
|
+
73: <span class="ruby-keyword kw">return</span> <span class="ruby-value">600</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_uri</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/http:\/\//</span>) <span class="ruby-comment cmt"># default cache for absolute URLs</span>
|
16
|
+
74: <span class="ruby-comment cmt"># locate the first entry to match the given uri</span>
|
17
|
+
75: <span class="ruby-identifier">config</span> = <span class="ruby-ivar">@hosts</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cfg</span><span class="ruby-operator">|</span>
|
18
|
+
76: <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>]).<span class="ruby-identifier">match</span>(<span class="ruby-identifier">request_uri</span>)
|
19
|
+
77: <span class="ruby-keyword kw">end</span>
|
20
|
+
78: <span class="ruby-identifier">config</span> = <span class="ruby-ivar">@default</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config</span>
|
21
|
+
79: (<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:cache_ttl</span>] <span class="ruby-operator">||</span> <span class="ruby-value">600</span>).<span class="ruby-identifier">to_i</span>
|
22
|
+
80: <span class="ruby-keyword kw">end</span></pre>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,278 @@
|
|
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: ESI::RubyCache</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">ESI::RubyCache</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/esi/cache_rb.html">
|
59
|
+
lib/esi/cache.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="Cache.html">
|
69
|
+
Cache
|
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
|
+
A ruby thread safe cache, stores cached fragments in the current ruby
|
86
|
+
process memory
|
87
|
+
</p>
|
88
|
+
<p>
|
89
|
+
A hash table indexed by cache_key of Fragments. the cache is made thread
|
90
|
+
safe if the external invalidator is active otherwise the Mutex is a no op
|
91
|
+
</p>
|
92
|
+
<p>
|
93
|
+
Default cache.
|
94
|
+
</p>
|
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="#M000065">cached?</a>
|
106
|
+
<a href="#M000070">delete</a>
|
107
|
+
<a href="#M000071">delete_unlocked</a>
|
108
|
+
<a href="#M000066">get</a>
|
109
|
+
<a href="#M000069">keys</a>
|
110
|
+
<a href="#M000064">new</a>
|
111
|
+
<a href="#M000067">put</a>
|
112
|
+
<a href="#M000068">sweep!</a>
|
113
|
+
<a href="#M000072">sweep_unlocked!</a>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
<!-- if includes -->
|
121
|
+
|
122
|
+
<div id="section">
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<!-- if method_list -->
|
132
|
+
<div id="methods">
|
133
|
+
<h3 class="section-bar">Public Class methods</h3>
|
134
|
+
|
135
|
+
<div id="method-M000064" class="method-detail">
|
136
|
+
<a name="M000064"></a>
|
137
|
+
|
138
|
+
<div class="method-heading">
|
139
|
+
<a href="RubyCache.src/M000064.html" target="Code" class="method-signature"
|
140
|
+
onclick="popupCode('RubyCache.src/M000064.html');return false;">
|
141
|
+
<span class="method-name">new</span><span class="method-args">( options = {} )</span>
|
142
|
+
</a>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="method-description">
|
146
|
+
</div>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
150
|
+
|
151
|
+
<div id="method-M000065" class="method-detail">
|
152
|
+
<a name="M000065"></a>
|
153
|
+
|
154
|
+
<div class="method-heading">
|
155
|
+
<a href="RubyCache.src/M000065.html" target="Code" class="method-signature"
|
156
|
+
onclick="popupCode('RubyCache.src/M000065.html');return false;">
|
157
|
+
<span class="method-name">cached?</span><span class="method-args">( uri, params )</span>
|
158
|
+
</a>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<div class="method-description">
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div id="method-M000070" class="method-detail">
|
166
|
+
<a name="M000070"></a>
|
167
|
+
|
168
|
+
<div class="method-heading">
|
169
|
+
<a href="RubyCache.src/M000070.html" target="Code" class="method-signature"
|
170
|
+
onclick="popupCode('RubyCache.src/M000070.html');return false;">
|
171
|
+
<span class="method-name">delete</span><span class="method-args">( key )</span>
|
172
|
+
</a>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div class="method-description">
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div id="method-M000071" class="method-detail">
|
180
|
+
<a name="M000071"></a>
|
181
|
+
|
182
|
+
<div class="method-heading">
|
183
|
+
<a href="RubyCache.src/M000071.html" target="Code" class="method-signature"
|
184
|
+
onclick="popupCode('RubyCache.src/M000071.html');return false;">
|
185
|
+
<span class="method-name">delete_unlocked</span><span class="method-args">( key )</span>
|
186
|
+
</a>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div class="method-description">
|
190
|
+
</div>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div id="method-M000066" class="method-detail">
|
194
|
+
<a name="M000066"></a>
|
195
|
+
|
196
|
+
<div class="method-heading">
|
197
|
+
<a href="RubyCache.src/M000066.html" target="Code" class="method-signature"
|
198
|
+
onclick="popupCode('RubyCache.src/M000066.html');return false;">
|
199
|
+
<span class="method-name">get</span><span class="method-args">( uri, params )</span>
|
200
|
+
</a>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
<div class="method-description">
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div id="method-M000069" class="method-detail">
|
208
|
+
<a name="M000069"></a>
|
209
|
+
|
210
|
+
<div class="method-heading">
|
211
|
+
<a href="RubyCache.src/M000069.html" target="Code" class="method-signature"
|
212
|
+
onclick="popupCode('RubyCache.src/M000069.html');return false;">
|
213
|
+
<span class="method-name">keys</span><span class="method-args">() {|key, data| ...}</span>
|
214
|
+
</a>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
<div class="method-description">
|
218
|
+
</div>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div id="method-M000067" class="method-detail">
|
222
|
+
<a name="M000067"></a>
|
223
|
+
|
224
|
+
<div class="method-heading">
|
225
|
+
<a href="RubyCache.src/M000067.html" target="Code" class="method-signature"
|
226
|
+
onclick="popupCode('RubyCache.src/M000067.html');return false;">
|
227
|
+
<span class="method-name">put</span><span class="method-args">( uri, params, max_age, body )</span>
|
228
|
+
</a>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div class="method-description">
|
232
|
+
</div>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div id="method-M000068" class="method-detail">
|
236
|
+
<a name="M000068"></a>
|
237
|
+
|
238
|
+
<div class="method-heading">
|
239
|
+
<a href="RubyCache.src/M000068.html" target="Code" class="method-signature"
|
240
|
+
onclick="popupCode('RubyCache.src/M000068.html');return false;">
|
241
|
+
<span class="method-name">sweep!</span><span class="method-args">()</span>
|
242
|
+
</a>
|
243
|
+
</div>
|
244
|
+
|
245
|
+
<div class="method-description">
|
246
|
+
<p>
|
247
|
+
run through the cache and dump anything that has expired
|
248
|
+
</p>
|
249
|
+
</div>
|
250
|
+
</div>
|
251
|
+
|
252
|
+
<div id="method-M000072" class="method-detail">
|
253
|
+
<a name="M000072"></a>
|
254
|
+
|
255
|
+
<div class="method-heading">
|
256
|
+
<a href="RubyCache.src/M000072.html" target="Code" class="method-signature"
|
257
|
+
onclick="popupCode('RubyCache.src/M000072.html');return false;">
|
258
|
+
<span class="method-name">sweep_unlocked!</span><span class="method-args">()</span>
|
259
|
+
</a>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div class="method-description">
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
<div id="validator-badges">
|
274
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
</body>
|
278
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>new (ESI::RubyCache)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 162</span>
|
14
|
+
162: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">options</span> = {} )
|
15
|
+
163: <span class="ruby-keyword kw">super</span>()
|
16
|
+
164: <span class="ruby-ivar">@semaphore</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
17
|
+
165: <span class="ruby-ivar">@cache</span> = {}
|
18
|
+
166: <span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>cached? (ESI::RubyCache)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 168</span>
|
14
|
+
168: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cached?</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> )
|
15
|
+
169: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">cache_key</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">params</span>)
|
16
|
+
170: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
17
|
+
171: <span class="ruby-identifier">fragment</span> = <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">key</span>]
|
18
|
+
172: <span class="ruby-identifier">fragment</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">valid?</span>
|
19
|
+
173: <span class="ruby-keyword kw">end</span>
|
20
|
+
174: <span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>get (ESI::RubyCache)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 176</span>
|
14
|
+
176: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span> )
|
15
|
+
177: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
16
|
+
178: <span class="ruby-identifier">fragment</span> = <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_key</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">params</span>)]
|
17
|
+
179: <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">dup</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fragment</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:dup</span>)
|
18
|
+
180: <span class="ruby-keyword kw">end</span>
|
19
|
+
181: <span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>put (ESI::RubyCache)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 183</span>
|
14
|
+
183: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">params</span>, <span class="ruby-identifier">max_age</span>, <span class="ruby-identifier">body</span> )
|
15
|
+
184: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">cache_key</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">params</span>)
|
16
|
+
185: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
17
|
+
186: <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-constant">Fragment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>,<span class="ruby-identifier">max_age</span>,<span class="ruby-identifier">body</span>)
|
18
|
+
187: <span class="ruby-identifier">sweep_unlocked!</span>
|
19
|
+
188: <span class="ruby-keyword kw">end</span>
|
20
|
+
189: <span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>sweep! (ESI::RubyCache)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 192</span>
|
14
|
+
192: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sweep!</span>
|
15
|
+
193: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-identifier">sweep_unlocked!</span> }
|
16
|
+
194: <span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>
|
7
|
+
<head>
|
8
|
+
<title>keys (ESI::RubyCache)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 196</span>
|
14
|
+
196: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
15
|
+
197: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
16
|
+
198: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
|
17
|
+
199: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">data</span>
|
18
|
+
200: <span class="ruby-keyword kw">end</span>
|
19
|
+
201: <span class="ruby-keyword kw">end</span>
|
20
|
+
202: <span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|