mongrel_esi 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. data/Rakefile +14 -6
  2. data/doc/rdoc/classes/ESI/CParser.html +122 -0
  3. data/doc/rdoc/classes/ESI/Cache.html +178 -0
  4. data/doc/rdoc/classes/ESI/Cache.src/M000085.html +17 -0
  5. data/doc/rdoc/classes/ESI/Cache.src/M000086.html +20 -0
  6. data/doc/rdoc/classes/ESI/Config.html +333 -0
  7. data/doc/rdoc/classes/ESI/Config.src/M000052.html +18 -0
  8. data/doc/rdoc/classes/ESI/Config.src/M000053.html +18 -0
  9. data/doc/rdoc/classes/ESI/Config.src/M000054.html +35 -0
  10. data/doc/rdoc/classes/ESI/Config.src/M000055.html +38 -0
  11. data/doc/rdoc/classes/ESI/Config.src/M000056.html +23 -0
  12. data/doc/rdoc/classes/ESI/Config.src/M000057.html +18 -0
  13. data/doc/rdoc/classes/ESI/Config.src/M000058.html +20 -0
  14. data/doc/rdoc/classes/ESI/Config.src/M000059.html +18 -0
  15. data/doc/rdoc/classes/ESI/Config.src/M000060.html +24 -0
  16. data/doc/rdoc/classes/ESI/Config/CacheConfig.html +212 -0
  17. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000064.html +19 -0
  18. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000065.html +19 -0
  19. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000066.html +18 -0
  20. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000067.html +18 -0
  21. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000068.html +18 -0
  22. data/doc/rdoc/classes/ESI/Config/ConfigRouter.html +187 -0
  23. data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000061.html +19 -0
  24. data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000062.html +21 -0
  25. data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/M000063.html +21 -0
  26. data/doc/rdoc/classes/ESI/Dispatcher.html +172 -0
  27. data/doc/rdoc/classes/ESI/Dispatcher.src/M000087.html +22 -0
  28. data/doc/rdoc/classes/ESI/Dispatcher.src/M000088.html +18 -0
  29. data/doc/rdoc/classes/ESI/Fragment.html +218 -0
  30. data/doc/rdoc/classes/ESI/Fragment.src/M000100.html +20 -0
  31. data/doc/rdoc/classes/ESI/Fragment.src/M000101.html +18 -0
  32. data/doc/rdoc/classes/ESI/Fragment.src/M000102.html +18 -0
  33. data/doc/rdoc/classes/ESI/Invalidator.html +131 -0
  34. data/doc/rdoc/classes/ESI/Invalidator.src/M000004.html +41 -0
  35. data/doc/rdoc/classes/ESI/Log.html +221 -0
  36. data/doc/rdoc/classes/ESI/Log.src/M000030.html +18 -0
  37. data/doc/rdoc/classes/ESI/Log.src/M000031.html +18 -0
  38. data/doc/rdoc/classes/ESI/Log.src/M000032.html +18 -0
  39. data/doc/rdoc/classes/ESI/Log.src/M000033.html +18 -0
  40. data/doc/rdoc/classes/ESI/Log.src/M000034.html +18 -0
  41. data/doc/rdoc/classes/ESI/Log.src/M000035.html +18 -0
  42. data/doc/rdoc/classes/ESI/Log.src/M000036.html +18 -0
  43. data/doc/rdoc/classes/ESI/MemcachedCache.html +314 -0
  44. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000040.html +24 -0
  45. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000041.html +22 -0
  46. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000042.html +19 -0
  47. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000043.html +23 -0
  48. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000044.html +18 -0
  49. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000045.html +19 -0
  50. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000046.html +18 -0
  51. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000047.html +18 -0
  52. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000048.html +17 -0
  53. data/doc/rdoc/classes/ESI/Parser.html +184 -0
  54. data/doc/rdoc/classes/ESI/Parser.src/M000049.html +51 -0
  55. data/doc/rdoc/classes/ESI/Parser.src/M000050.html +39 -0
  56. data/doc/rdoc/classes/ESI/Parser.src/M000051.html +19 -0
  57. data/doc/rdoc/classes/ESI/Processor.html +194 -0
  58. data/doc/rdoc/classes/ESI/Processor.src/M000037.html +26 -0
  59. data/doc/rdoc/classes/ESI/Processor.src/M000038.html +44 -0
  60. data/doc/rdoc/classes/ESI/Processor.src/M000039.html +26 -0
  61. data/doc/rdoc/classes/ESI/Proxy.html +304 -0
  62. data/doc/rdoc/classes/ESI/Proxy.src/M000069.html +20 -0
  63. data/doc/rdoc/classes/ESI/Proxy.src/M000070.html +55 -0
  64. data/doc/rdoc/classes/ESI/Proxy.src/M000071.html +53 -0
  65. data/doc/rdoc/classes/ESI/Proxy.src/M000072.html +25 -0
  66. data/doc/rdoc/classes/ESI/Proxy.src/M000073.html +19 -0
  67. data/doc/rdoc/classes/ESI/Proxy.src/M000074.html +27 -0
  68. data/doc/rdoc/classes/ESI/Proxy.src/M000075.html +18 -0
  69. data/doc/rdoc/classes/ESI/Proxy.src/M000076.html +28 -0
  70. data/doc/rdoc/classes/ESI/Proxy.src/M000077.html +29 -0
  71. data/doc/rdoc/classes/ESI/Response.html +250 -0
  72. data/doc/rdoc/classes/ESI/Response.src/M000078.html +23 -0
  73. data/doc/rdoc/classes/ESI/Response.src/M000079.html +18 -0
  74. data/doc/rdoc/classes/ESI/Response.src/M000080.html +21 -0
  75. data/doc/rdoc/classes/ESI/Response.src/M000081.html +20 -0
  76. data/doc/rdoc/classes/ESI/Response.src/M000082.html +25 -0
  77. data/doc/rdoc/classes/ESI/Response.src/M000083.html +18 -0
  78. data/doc/rdoc/classes/ESI/Response.src/M000084.html +33 -0
  79. data/doc/rdoc/classes/ESI/Router.html +212 -0
  80. data/doc/rdoc/classes/ESI/Router.src/M000098.html +36 -0
  81. data/doc/rdoc/classes/ESI/Router.src/M000099.html +25 -0
  82. data/doc/rdoc/classes/ESI/RubyCache.html +278 -0
  83. data/doc/rdoc/classes/ESI/RubyCache.src/M000089.html +20 -0
  84. data/doc/rdoc/classes/ESI/RubyCache.src/M000090.html +20 -0
  85. data/doc/rdoc/classes/ESI/RubyCache.src/M000091.html +20 -0
  86. data/doc/rdoc/classes/ESI/RubyCache.src/M000092.html +22 -0
  87. data/doc/rdoc/classes/ESI/RubyCache.src/M000093.html +18 -0
  88. data/doc/rdoc/classes/ESI/RubyCache.src/M000094.html +22 -0
  89. data/doc/rdoc/classes/ESI/RubyCache.src/M000095.html +18 -0
  90. data/doc/rdoc/classes/ESI/RubyCache.src/M000096.html +18 -0
  91. data/doc/rdoc/classes/ESI/RubyCache.src/M000097.html +18 -0
  92. data/doc/rdoc/classes/ESI/Tag.html +141 -0
  93. data/doc/rdoc/classes/ESI/Tag/Attempt.html +113 -0
  94. data/doc/rdoc/classes/ESI/Tag/Base.html +237 -0
  95. data/doc/rdoc/classes/ESI/Tag/Base.src/M000026.html +23 -0
  96. data/doc/rdoc/classes/ESI/Tag/Base.src/M000027.html +22 -0
  97. data/doc/rdoc/classes/ESI/Tag/Base.src/M000028.html +22 -0
  98. data/doc/rdoc/classes/ESI/Tag/Base.src/M000029.html +17 -0
  99. data/doc/rdoc/classes/ESI/Tag/Container.html +206 -0
  100. data/doc/rdoc/classes/ESI/Tag/Container.src/M000015.html +20 -0
  101. data/doc/rdoc/classes/ESI/Tag/Container.src/M000016.html +22 -0
  102. data/doc/rdoc/classes/ESI/Tag/Container.src/M000017.html +25 -0
  103. data/doc/rdoc/classes/ESI/Tag/Except.html +184 -0
  104. data/doc/rdoc/classes/ESI/Tag/Except.src/M000018.html +21 -0
  105. data/doc/rdoc/classes/ESI/Tag/Except.src/M000019.html +20 -0
  106. data/doc/rdoc/classes/ESI/Tag/Except.src/M000020.html +18 -0
  107. data/doc/rdoc/classes/ESI/Tag/Include.html +257 -0
  108. data/doc/rdoc/classes/ESI/Tag/Include.src/M000005.html +20 -0
  109. data/doc/rdoc/classes/ESI/Tag/Include.src/M000006.html +18 -0
  110. data/doc/rdoc/classes/ESI/Tag/Include.src/M000007.html +34 -0
  111. data/doc/rdoc/classes/ESI/Tag/Include.src/M000008.html +22 -0
  112. data/doc/rdoc/classes/ESI/Tag/Include.src/M000009.html +27 -0
  113. data/doc/rdoc/classes/ESI/Tag/Include.src/M000010.html +30 -0
  114. data/doc/rdoc/classes/ESI/Tag/Include.src/M000011.html +51 -0
  115. data/doc/rdoc/classes/ESI/Tag/Include/Request.html +199 -0
  116. data/doc/rdoc/classes/ESI/Tag/Include/Request.src/M000012.html +18 -0
  117. data/doc/rdoc/classes/ESI/Tag/Include/Request.src/M000013.html +44 -0
  118. data/doc/rdoc/classes/ESI/Tag/Include/Request/Error.html +155 -0
  119. data/doc/rdoc/classes/ESI/Tag/Include/Request/Error.src/M000014.html +19 -0
  120. data/doc/rdoc/classes/ESI/Tag/Invalidate.html +171 -0
  121. data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000023.html +19 -0
  122. data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000024.html +51 -0
  123. data/doc/rdoc/classes/ESI/Tag/Invalidate.src/M000025.html +19 -0
  124. data/doc/rdoc/classes/ESI/Tag/Try.html +154 -0
  125. data/doc/rdoc/classes/ESI/Tag/Try.src/M000021.html +38 -0
  126. data/doc/rdoc/classes/ESI/Tag/Try.src/M000022.html +18 -0
  127. data/doc/rdoc/classes/MultiDirHandler.html +198 -0
  128. data/doc/rdoc/classes/MultiDirHandler.src/M000001.html +20 -0
  129. data/doc/rdoc/classes/MultiDirHandler.src/M000002.html +28 -0
  130. data/doc/rdoc/classes/MultiDirHandler.src/M000003.html +22 -0
  131. data/doc/rdoc/created.rid +1 -0
  132. data/doc/rdoc/files/COPYING.html +167 -0
  133. data/doc/rdoc/files/LICENSE.html +605 -0
  134. data/doc/rdoc/files/README.html +359 -0
  135. data/doc/rdoc/files/ext/esi/common_rl.html +160 -0
  136. data/doc/rdoc/files/ext/esi/esi_parser_c.html +101 -0
  137. data/doc/rdoc/files/ext/esi/parser_c.html +101 -0
  138. data/doc/rdoc/files/ext/esi/parser_h.html +101 -0
  139. data/doc/rdoc/files/ext/esi/parser_rl.html +827 -0
  140. data/doc/rdoc/files/ext/esi/test/common_rl.html +160 -0
  141. data/doc/rdoc/files/ext/esi/test/parser_c.html +101 -0
  142. data/doc/rdoc/files/ext/esi/test/parser_h.html +101 -0
  143. data/doc/rdoc/files/ext/esi/test/parser_rl.html +827 -0
  144. data/doc/rdoc/files/ext/esi/test/sp_c.html +101 -0
  145. data/doc/rdoc/files/ext/esi/test/test_c.html +101 -0
  146. data/doc/rdoc/files/lib/esi/cache_rb.html +119 -0
  147. data/doc/rdoc/files/lib/esi/config_rb.html +114 -0
  148. data/doc/rdoc/files/lib/esi/dispatcher_rb.html +108 -0
  149. data/doc/rdoc/files/lib/esi/invalidator_rb.html +114 -0
  150. data/doc/rdoc/files/lib/esi/logger_rb.html +108 -0
  151. data/doc/rdoc/files/lib/esi/parser_rb.html +120 -0
  152. data/doc/rdoc/files/lib/esi/processor_rb.html +115 -0
  153. data/doc/rdoc/files/lib/esi/proxy_rb.html +123 -0
  154. data/doc/rdoc/files/lib/esi/response_rb.html +116 -0
  155. data/doc/rdoc/files/lib/esi/router_rb.html +107 -0
  156. data/doc/rdoc/files/lib/esi/tag/attempt_rb.html +114 -0
  157. data/doc/rdoc/files/lib/esi/tag/base_rb.html +114 -0
  158. data/doc/rdoc/files/lib/esi/tag/container_rb.html +115 -0
  159. data/doc/rdoc/files/lib/esi/tag/except_rb.html +114 -0
  160. data/doc/rdoc/files/lib/esi/tag/include_rb.html +116 -0
  161. data/doc/rdoc/files/lib/esi/tag/invalidate_rb.html +115 -0
  162. data/doc/rdoc/files/lib/esi/tag/try_rb.html +115 -0
  163. data/doc/rdoc/files/lib/esi/version_rb.html +101 -0
  164. data/doc/rdoc/files/lib/multi_dirhandler_rb.html +109 -0
  165. data/doc/rdoc/fr_class_index.html +53 -0
  166. data/doc/rdoc/fr_file_index.html +59 -0
  167. data/doc/rdoc/fr_method_index.html +128 -0
  168. data/doc/rdoc/index.html +24 -0
  169. data/doc/rdoc/rdoc-style.css +208 -0
  170. data/ext/esi/esi_parser.c +12 -1
  171. data/ext/esi/parser.c +492 -3927
  172. data/ext/esi/parser.rl +83 -14
  173. data/ext/esi/test/parser.c +1587 -367
  174. data/ext/esi/test/parser.rl +83 -14
  175. data/ext/esi/test/sp.c +125 -0
  176. data/ext/esi/test/test.c +198 -6
  177. data/lib/esi/cache.rb +5 -8
  178. data/lib/esi/config.rb +3 -3
  179. data/lib/esi/dispatcher.rb +2 -4
  180. data/lib/esi/parser.rb +26 -13
  181. data/lib/esi/processor.rb +13 -35
  182. data/lib/esi/proxy.rb +113 -44
  183. data/lib/esi/response.rb +23 -55
  184. data/lib/esi/router.rb +0 -11
  185. data/lib/esi/tag/attempt.rb +2 -1
  186. data/lib/esi/tag/base.rb +1 -24
  187. data/lib/esi/tag/container.rb +40 -0
  188. data/lib/esi/tag/except.rb +3 -1
  189. data/lib/esi/tag/include.rb +53 -62
  190. data/lib/esi/tag/try.rb +16 -18
  191. data/lib/esi/version.rb +9 -0
  192. data/test/integration/handler_test.rb +49 -12
  193. data/test/integration/help.rb +12 -0
  194. data/test/load_test.rb +8 -4
  195. data/test/load_test_ab.rb +8 -0
  196. data/test/sample.html +31 -0
  197. data/test/unit/help.rb +12 -8
  198. data/test/unit/include_request_test.rb +14 -21
  199. data/test/unit/parser_test.rb +2 -1
  200. data/test/unit/response_test.rb +4 -8
  201. data/tools/rakehelp.rb +1 -1
  202. metadata +216 -5
@@ -0,0 +1,23 @@
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::Response)</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/response.rb, line 12</span>
14
+ 12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">output</span> )
15
+ 13: <span class="ruby-ivar">@count</span> = <span class="ruby-value">0</span>
16
+ 14: <span class="ruby-ivar">@back_buffer</span> = []
17
+ 15: <span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
18
+ 16: <span class="ruby-ivar">@last_out</span> = <span class="ruby-value">0</span>
19
+ 17: <span class="ruby-ivar">@threads</span> = []
20
+ 18: <span class="ruby-ivar">@active_buffer</span> = <span class="ruby-identifier">reserve_buffer</span>
21
+ 19: <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </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>update_output (ESI::Response)</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/response.rb, line 21</span>
14
+ 21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_output</span>(<span class="ruby-identifier">output</span>)
15
+ 22: <span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
16
+ 23: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </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>partial_buffer (ESI::Response)</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/response.rb, line 25</span>
14
+ 25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">partial_buffer</span>
15
+ 26: <span class="ruby-ivar">@active_buffer</span>.<span class="ruby-identifier">close_write</span>
16
+ 27: <span class="ruby-identifier">temp</span> = <span class="ruby-identifier">reserve_buffer</span>
17
+ 28: <span class="ruby-ivar">@active_buffer</span> = <span class="ruby-identifier">reserve_buffer</span>
18
+ 29: <span class="ruby-identifier">temp</span>
19
+ 30: <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </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>reserve_buffer (ESI::Response)</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/response.rb, line 33</span>
14
+ 33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reserve_buffer</span>
15
+ 34: <span class="ruby-identifier">buffer</span> = <span class="ruby-ivar">@back_buffer</span>[<span class="ruby-ivar">@count</span>] = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
16
+ 35: <span class="ruby-ivar">@count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
17
+ 36: <span class="ruby-identifier">buffer</span>
18
+ 37: <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -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>send (ESI::Response)</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/response.rb, line 39</span>
14
+ 39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send</span>
15
+ 40: <span class="ruby-identifier">check_buffers</span> = <span class="ruby-ivar">@back_buffer</span>[<span class="ruby-ivar">@last_out</span><span class="ruby-operator">..</span><span class="ruby-ivar">@count</span>]
16
+ 41:
17
+ 42: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">buffer</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">check_buffers</span> <span class="ruby-keyword kw">do</span>
18
+ 43: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-operator">!</span><span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">closed_write?</span>
19
+ 44: <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">rewind</span>
20
+ 45: <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">read</span>
21
+ 46: <span class="ruby-ivar">@last_out</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
22
+ 47: <span class="ruby-keyword kw">end</span>
23
+ 48: <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </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>wait_thread (ESI::Response)</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/response.rb, line 50</span>
14
+ 50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">wait_thread</span>(<span class="ruby-identifier">thread</span>)
15
+ 51: <span class="ruby-ivar">@threads</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thread</span>
16
+ 52: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,33 @@
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>flush (ESI::Response)</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/response.rb, line 54</span>
14
+ 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flush</span>
15
+ 55: <span class="ruby-ivar">@threads</span>.<span class="ruby-identifier">each</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">join</span> }
16
+ 56: <span class="ruby-ivar">@active_buffer</span>.<span class="ruby-identifier">close_write</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@active_buffer</span>.<span class="ruby-identifier">closed_write?</span>
17
+ 57: <span class="ruby-comment cmt"># roll up requests</span>
18
+ 58: <span class="ruby-ivar">@last_out</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@last_out</span> <span class="ruby-operator">==</span> <span class="ruby-value">-1</span>
19
+ 59: <span class="ruby-identifier">tail_buffer</span> = (<span class="ruby-ivar">@back_buffer</span>[<span class="ruby-ivar">@last_out</span><span class="ruby-operator">..</span><span class="ruby-ivar">@back_buffer</span>.<span class="ruby-identifier">size</span>]<span class="ruby-operator">||</span>[])
20
+ 60: <span class="ruby-comment cmt">#puts &quot;\nflushing: #{tail_buffer.inspect} from #{@back_buffer.inspect}&quot;</span>
21
+ 61: <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span><span class="ruby-identifier">tail_buffer</span>.<span class="ruby-identifier">empty?</span>
22
+ 62: <span class="ruby-identifier">o</span> = <span class="ruby-identifier">tail_buffer</span>.<span class="ruby-identifier">shift</span>
23
+ 63: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">nil?</span>
24
+ 64: <span class="ruby-identifier">o</span>.<span class="ruby-identifier">rewind</span>
25
+ 65: <span class="ruby-identifier">buf</span> = <span class="ruby-identifier">o</span>.<span class="ruby-identifier">read</span>
26
+ 66: <span class="ruby-comment cmt">#puts &quot;flush : #{buf.inspect}&quot;</span>
27
+ 67: <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">buf</span>
28
+ 68: <span class="ruby-keyword kw">end</span>
29
+ 69: <span class="ruby-comment cmt">#puts &quot;#{self} sending: #{@count-tail_buffer.size}&quot;</span>
30
+ 70: <span class="ruby-keyword kw">end</span>
31
+ 71: <span class="ruby-keyword kw">end</span></pre>
32
+ </body>
33
+ </html>
@@ -0,0 +1,212 @@
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::Router</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::Router</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/esi/router_rb.html">
59
+ lib/esi/router.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
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ ESI Server is a reverse proxy caching server. It will forward all requests
84
+ to app servers by processing a config_file that specifies routes:
85
+ </p>
86
+ <p>
87
+ content:
88
+ </p>
89
+ <pre>
90
+ host: 127.0.0.1
91
+ port: 3000
92
+ match_url: ^\/(content|samples|extra).*
93
+ </pre>
94
+ <p>
95
+ default:
96
+ </p>
97
+ <pre>
98
+ host: 127.0.0.1
99
+ port: 3001
100
+ </pre>
101
+ <p>
102
+ This sample configuration will route all urls starting with /content,
103
+ /samples, or /extras to the server running at 127.0.0.1 on port 3000
104
+ everything else that matches the .* will be routed to the server running on
105
+ port 3001 optionally the caching duration can be specificied explicity for
106
+ each host, this will be the default per host if the esi:include tag does
107
+ not specify otherwise
108
+ </p>
109
+ <p>
110
+ default:
111
+ </p>
112
+ <pre>
113
+ host: 127.0.01
114
+ port: 3001
115
+ </pre>
116
+ <p>
117
+ This example will cache all requests for 300 seconds, by default.
118
+ </p>
119
+ <p>
120
+ To create a router load either from memory or file the above YAML
121
+ </p>
122
+ <pre>
123
+ router = ESI::Router.new( YAML.load_file('config.yml') )
124
+ </pre>
125
+ <p>
126
+ or from memory
127
+ </p>
128
+ <pre>
129
+ router = ESI::Router.new( YAML.load(config_str) )
130
+ </pre>
131
+
132
+ </div>
133
+
134
+
135
+ </div>
136
+
137
+ <div id="method-list">
138
+ <h3 class="section-bar">Methods</h3>
139
+
140
+ <div class="name-list">
141
+ <a href="#M000098">new</a>&nbsp;&nbsp;
142
+ <a href="#M000099">url_for</a>&nbsp;&nbsp;
143
+ </div>
144
+ </div>
145
+
146
+ </div>
147
+
148
+
149
+ <!-- if includes -->
150
+
151
+ <div id="section">
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+ <!-- if method_list -->
161
+ <div id="methods">
162
+ <h3 class="section-bar">Public Class methods</h3>
163
+
164
+ <div id="method-M000098" class="method-detail">
165
+ <a name="M000098"></a>
166
+
167
+ <div class="method-heading">
168
+ <a href="Router.src/M000098.html" target="Code" class="method-signature"
169
+ onclick="popupCode('Router.src/M000098.html');return false;">
170
+ <span class="method-name">new</span><span class="method-args">( routes )</span>
171
+ </a>
172
+ </div>
173
+
174
+ <div class="method-description">
175
+ <p>
176
+ config is a routing table as defined above
177
+ </p>
178
+ </div>
179
+ </div>
180
+
181
+ <h3 class="section-bar">Public Instance methods</h3>
182
+
183
+ <div id="method-M000099" class="method-detail">
184
+ <a name="M000099"></a>
185
+
186
+ <div class="method-heading">
187
+ <a href="Router.src/M000099.html" target="Code" class="method-signature"
188
+ onclick="popupCode('Router.src/M000099.html');return false;">
189
+ <span class="method-name">url_for</span><span class="method-args">( request_uri )</span>
190
+ </a>
191
+ </div>
192
+
193
+ <div class="method-description">
194
+ <p>
195
+ return a uri given a request_uri
196
+ </p>
197
+ </div>
198
+ </div>
199
+
200
+
201
+ </div>
202
+
203
+
204
+ </div>
205
+
206
+
207
+ <div id="validator-badges">
208
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
209
+ </div>
210
+
211
+ </body>
212
+ </html>
@@ -0,0 +1,36 @@
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::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 40</span>
14
+ 40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">routes</span> )
15
+ 41: <span class="ruby-ivar">@hosts</span> = []
16
+ 42: <span class="ruby-ivar">@default</span> = <span class="ruby-keyword kw">nil</span>
17
+ 43:
18
+ 44: <span class="ruby-identifier">routes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">cfg</span><span class="ruby-operator">|</span>
19
+ 45:
20
+ 46: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Configuration error missing host for #{cfg.inspect}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:host</span>]
21
+ 47: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Configuration error missing port for #{cfg.inspect}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:port</span>]
22
+ 48: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Configuration error missing match_url for #{cfg.inspect}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>]
23
+ 49:
24
+ 50: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'default'</span>
25
+ 51: <span class="ruby-ivar">@default</span> = <span class="ruby-identifier">cfg</span>
26
+ 52: <span class="ruby-keyword kw">else</span>
27
+ 53: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Configuration error missing match_url for #{cfg.inspect}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cfg</span>[<span class="ruby-identifier">:match_url</span>]
28
+ 54: <span class="ruby-ivar">@hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cfg</span>
29
+ 55: <span class="ruby-keyword kw">end</span>
30
+ 56:
31
+ 57: <span class="ruby-keyword kw">end</span>
32
+ 58:
33
+ 59: <span class="ruby-ivar">@default</span> = {<span class="ruby-identifier">:host</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'127.0.0.1'</span>, <span class="ruby-identifier">:port</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'3000'</span>} <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@default</span>
34
+ 60: <span class="ruby-keyword kw">end</span></pre>
35
+ </body>
36
+ </html>
@@ -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 63</span>
14
+ 63: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url_for</span>( <span class="ruby-identifier">request_uri</span> )
15
+ 64: <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
+ 65: <span class="ruby-comment cmt"># locate the first entry to match the given uri</span>
17
+ 66: <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
+ 67: <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
+ 68: <span class="ruby-keyword kw">end</span>
20
+ 69: <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
+ 70: <span class="ruby-comment cmt"># build a url given a valid config or abort 404 not found</span>
22
+ 71: <span class="ruby-value str">&quot;http://&quot;</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">&quot;:&quot;</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">&quot;&quot;</span>).<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">request_uri</span>).<span class="ruby-identifier">squeeze</span>(<span class="ruby-value str">&quot;/&quot;</span>)
23
+ 72: <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </html>