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,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>send_chunk (ESI::Handler)</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/handler.rb, line 177</span>
|
14
|
+
177: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_chunk</span>( <span class="ruby-identifier">response</span>, <span class="ruby-identifier">buffer</span> )
|
15
|
+
178: <span class="ruby-comment cmt"># send a new chunk</span>
|
16
|
+
179: <span class="ruby-identifier">size</span> = <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">size</span>
|
17
|
+
180: <span class="ruby-identifier">chunk_header</span> = <span class="ruby-node">"#{"%x" % size}"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Mongrel</span><span class="ruby-operator">::</span><span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">LINE_END</span>
|
18
|
+
181: <span class="ruby-comment cmt">#puts chunk_header.inspect</span>
|
19
|
+
182: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">write</span>( <span class="ruby-identifier">chunk_header</span> ) <span class="ruby-comment cmt"># write the chunk size</span>
|
20
|
+
183: <span class="ruby-comment cmt">#puts buffer.inspect</span>
|
21
|
+
184: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">write</span>( <span class="ruby-identifier">buffer</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Mongrel</span><span class="ruby-operator">::</span><span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">LINE_END</span> ) <span class="ruby-comment cmt"># write the chunk</span>
|
22
|
+
185: <span class="ruby-keyword kw">end</span></pre>
|
23
|
+
</body>
|
24
|
+
</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>read_status (ESI::Handler)</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/handler.rb, line 187</span>
|
14
|
+
187: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_status</span>(<span class="ruby-identifier">response</span>)
|
15
|
+
188: <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPResponse</span><span class="ruby-operator">::</span><span class="ruby-constant">CODE_TO_OBJ</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">class</span> }.<span class="ruby-identifier">first</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-value">500</span>
|
16
|
+
189: <span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
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>http_params (ESI::Handler)</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/handler.rb, line 191</span>
|
14
|
+
191: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">http_params</span>(<span class="ruby-identifier">params</span>)
|
15
|
+
192: <span class="ruby-identifier">updated_params</span> = {}
|
16
|
+
193: <span class="ruby-identifier">params</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
17
|
+
194: <span class="ruby-identifier">k</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'_'</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">capitalize</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'-'</span>)
|
18
|
+
195: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span>[<span class="ruby-value">0</span>,<span class="ruby-value">5</span>] <span class="ruby-operator">==</span><span class="ruby-value str">'Http-'</span>
|
19
|
+
196: <span class="ruby-identifier">k</span>[<span class="ruby-value">0</span>,<span class="ruby-value">5</span>] = <span class="ruby-value str">''</span>
|
20
|
+
197: <span class="ruby-identifier">updated_params</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>
|
21
|
+
198: <span class="ruby-keyword kw">end</span>
|
22
|
+
199: <span class="ruby-keyword kw">end</span>
|
23
|
+
200: <span class="ruby-identifier">updated_params</span>
|
24
|
+
201: <span class="ruby-keyword kw">end</span></pre>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,30 @@
|
|
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>copy_headers (ESI::Handler)</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/handler.rb, line 203</span>
|
14
|
+
203: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">copy_headers</span>(<span class="ruby-identifier">head</span>,<span class="ruby-identifier">response</span>)
|
15
|
+
204: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">to_hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
16
|
+
205: <span class="ruby-comment cmt"># for Set-Cookie we need to split on ,</span>
|
17
|
+
206: <span class="ruby-comment cmt"># some edge cases with , since things like expires might be a date with , in them.</span>
|
18
|
+
207: <span class="ruby-identifier">k</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/-/</span>).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">capitalize</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'-'</span>)
|
19
|
+
208: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"Set-Cookie"</span>
|
20
|
+
209: <span class="ruby-identifier">v</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">cookie</span><span class="ruby-operator">|</span>
|
21
|
+
210: <span class="ruby-identifier">head</span>[<span class="ruby-value str">"Set-Cookie"</span>] = <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">strip</span> <span class="ruby-comment cmt"># mongrel is case sensitive about handling duplicates</span>
|
22
|
+
211: <span class="ruby-keyword kw">end</span>
|
23
|
+
212: <span class="ruby-keyword kw">else</span>
|
24
|
+
213: <span class="ruby-identifier">head</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"Content-Length"</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"Surrogate-Control"</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"Server"</span>
|
25
|
+
214: <span class="ruby-keyword kw">end</span>
|
26
|
+
215: <span class="ruby-keyword kw">end</span>
|
27
|
+
216: <span class="ruby-identifier">head</span>[<span class="ruby-value str">"Server"</span>] = <span class="ruby-value str">"MongrelESI 0.4"</span>
|
28
|
+
217: <span class="ruby-keyword kw">end</span></pre>
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,131 @@
|
|
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>Module: ESI::Invalidator</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">ESI::Invalidator</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/esi/invalidator_rb.html">
|
59
|
+
lib/esi/invalidator.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000004">start</a>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if includes -->
|
91
|
+
|
92
|
+
<div id="section">
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if method_list -->
|
102
|
+
<div id="methods">
|
103
|
+
<h3 class="section-bar">Public Class methods</h3>
|
104
|
+
|
105
|
+
<div id="method-M000004" class="method-detail">
|
106
|
+
<a name="M000004"></a>
|
107
|
+
|
108
|
+
<div class="method-heading">
|
109
|
+
<a href="Invalidator.src/M000004.html" target="Code" class="method-signature"
|
110
|
+
onclick="popupCode('Invalidator.src/M000004.html');return false;">
|
111
|
+
<span class="method-name">start</span><span class="method-args">( cache )</span>
|
112
|
+
</a>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="method-description">
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
<div id="validator-badges">
|
127
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
</body>
|
131
|
+
</html>
|
@@ -0,0 +1,41 @@
|
|
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>start (ESI::Invalidator)</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/invalidator.rb, line 11</span>
|
14
|
+
11: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">start</span>( <span class="ruby-identifier">cache</span> )
|
15
|
+
12: <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">cache</span> ) <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">cache</span><span class="ruby-operator">|</span>
|
16
|
+
13: <span class="ruby-identifier">s</span> = <span class="ruby-constant">WEBrick</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPServer</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">:Port</span> =<span class="ruby-operator">></span> <span class="ruby-value">4001</span> )
|
17
|
+
14:
|
18
|
+
15: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">mount_proc</span>(<span class="ruby-value str">"/invalidate"</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">req</span>, <span class="ruby-identifier">res</span><span class="ruby-operator">|</span>
|
19
|
+
16: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span> = <span class="ruby-value str">"<html>invalidate posted objects</html>"</span>
|
20
|
+
17: <span class="ruby-identifier">res</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">"text/html"</span>
|
21
|
+
18: }
|
22
|
+
19:
|
23
|
+
20: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">mount_proc</span>(<span class="ruby-value str">"/status"</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">req</span>, <span class="ruby-identifier">res</span><span class="ruby-operator">|</span>
|
24
|
+
21: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span> = <span class="ruby-value str">"<html><body><h1>Cached objects</h1>"</span>
|
25
|
+
22: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"<ul>"</span>
|
26
|
+
23: <span class="ruby-identifier">cache</span>.<span class="ruby-identifier">keys</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>
|
27
|
+
24: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<li>#{key}</li>"</span>
|
28
|
+
25: <span class="ruby-keyword kw">end</span>
|
29
|
+
26: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</ul>"</span>
|
30
|
+
27: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</body>"</span>
|
31
|
+
28: <span class="ruby-identifier">res</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</html>"</span>
|
32
|
+
29: <span class="ruby-identifier">res</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">"text/html"</span>
|
33
|
+
30: }
|
34
|
+
31:
|
35
|
+
32: <span class="ruby-comment cmt"># XXX: this doesn't chain so ends up removing the mongrel trap locking the server up</span>
|
36
|
+
33: <span class="ruby-comment cmt">#trap("INT"){ s.shutdown }</span>
|
37
|
+
34: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">start</span>
|
38
|
+
35: <span class="ruby-keyword kw">end</span>
|
39
|
+
36: <span class="ruby-keyword kw">end</span></pre>
|
40
|
+
</body>
|
41
|
+
</html>
|
@@ -0,0 +1,251 @@
|
|
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>Module: ESI::Log</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>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">ESI::Log</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/esi/logger_rb.html">
|
59
|
+
lib/esi/logger.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000007">log</a>
|
84
|
+
<a href="#M000010">log_debug</a>
|
85
|
+
<a href="#M000011">log_error</a>
|
86
|
+
<a href="#M000012">log_info</a>
|
87
|
+
<a href="#M000009">log_request</a>
|
88
|
+
<a href="#M000013">log_warn</a>
|
89
|
+
<a href="#M000008">msg</a>
|
90
|
+
<a href="#M000006">print</a>
|
91
|
+
<a href="#M000005">puts</a>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
|
98
|
+
<!-- if includes -->
|
99
|
+
|
100
|
+
<div id="section">
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<!-- if method_list -->
|
110
|
+
<div id="methods">
|
111
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
112
|
+
|
113
|
+
<div id="method-M000007" class="method-detail">
|
114
|
+
<a name="M000007"></a>
|
115
|
+
|
116
|
+
<div class="method-heading">
|
117
|
+
<a href="Log.src/M000007.html" target="Code" class="method-signature"
|
118
|
+
onclick="popupCode('Log.src/M000007.html');return false;">
|
119
|
+
<span class="method-name">log</span><span class="method-args">( io, msg )</span>
|
120
|
+
</a>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div class="method-description">
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div id="method-M000010" class="method-detail">
|
128
|
+
<a name="M000010"></a>
|
129
|
+
|
130
|
+
<div class="method-heading">
|
131
|
+
<a href="Log.src/M000010.html" target="Code" class="method-signature"
|
132
|
+
onclick="popupCode('Log.src/M000010.html');return false;">
|
133
|
+
<span class="method-name">log_debug</span><span class="method-args">( msg )</span>
|
134
|
+
</a>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="method-description">
|
138
|
+
</div>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div id="method-M000011" class="method-detail">
|
142
|
+
<a name="M000011"></a>
|
143
|
+
|
144
|
+
<div class="method-heading">
|
145
|
+
<a href="Log.src/M000011.html" target="Code" class="method-signature"
|
146
|
+
onclick="popupCode('Log.src/M000011.html');return false;">
|
147
|
+
<span class="method-name">log_error</span><span class="method-args">( msg )</span>
|
148
|
+
</a>
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<div class="method-description">
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div id="method-M000012" class="method-detail">
|
156
|
+
<a name="M000012"></a>
|
157
|
+
|
158
|
+
<div class="method-heading">
|
159
|
+
<a href="Log.src/M000012.html" target="Code" class="method-signature"
|
160
|
+
onclick="popupCode('Log.src/M000012.html');return false;">
|
161
|
+
<span class="method-name">log_info</span><span class="method-args">( msg )</span>
|
162
|
+
</a>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="method-description">
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div id="method-M000009" class="method-detail">
|
170
|
+
<a name="M000009"></a>
|
171
|
+
|
172
|
+
<div class="method-heading">
|
173
|
+
<a href="Log.src/M000009.html" target="Code" class="method-signature"
|
174
|
+
onclick="popupCode('Log.src/M000009.html');return false;">
|
175
|
+
<span class="method-name">log_request</span><span class="method-args">( msg )</span>
|
176
|
+
</a>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div class="method-description">
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div id="method-M000013" class="method-detail">
|
184
|
+
<a name="M000013"></a>
|
185
|
+
|
186
|
+
<div class="method-heading">
|
187
|
+
<a href="Log.src/M000013.html" target="Code" class="method-signature"
|
188
|
+
onclick="popupCode('Log.src/M000013.html');return false;">
|
189
|
+
<span class="method-name">log_warn</span><span class="method-args">( msg )</span>
|
190
|
+
</a>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div id="method-M000008" class="method-detail">
|
198
|
+
<a name="M000008"></a>
|
199
|
+
|
200
|
+
<div class="method-heading">
|
201
|
+
<a href="Log.src/M000008.html" target="Code" class="method-signature"
|
202
|
+
onclick="popupCode('Log.src/M000008.html');return false;">
|
203
|
+
<span class="method-name">msg</span><span class="method-args">( io, msg )</span>
|
204
|
+
</a>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div class="method-description">
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
<div id="method-M000006" class="method-detail">
|
212
|
+
<a name="M000006"></a>
|
213
|
+
|
214
|
+
<div class="method-heading">
|
215
|
+
<a href="Log.src/M000006.html" target="Code" class="method-signature"
|
216
|
+
onclick="popupCode('Log.src/M000006.html');return false;">
|
217
|
+
<span class="method-name">print</span><span class="method-args">( msg )</span>
|
218
|
+
</a>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="method-description">
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<div id="method-M000005" class="method-detail">
|
226
|
+
<a name="M000005"></a>
|
227
|
+
|
228
|
+
<div class="method-heading">
|
229
|
+
<a href="Log.src/M000005.html" target="Code" class="method-signature"
|
230
|
+
onclick="popupCode('Log.src/M000005.html');return false;">
|
231
|
+
<span class="method-name">puts</span><span class="method-args">( msg )</span>
|
232
|
+
</a>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div class="method-description">
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
|
240
|
+
</div>
|
241
|
+
|
242
|
+
|
243
|
+
</div>
|
244
|
+
|
245
|
+
|
246
|
+
<div id="validator-badges">
|
247
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
248
|
+
</div>
|
249
|
+
|
250
|
+
</body>
|
251
|
+
</html>
|