wee 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/ChangeLog +132 -0
  2. data/INSTALL +13 -3
  3. data/README +3 -3
  4. data/Rakefile +5 -1
  5. data/bin/wee +100 -0
  6. data/doc/rdoc/classes/Array.html +12 -12
  7. data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
  8. data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
  9. data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
  10. data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
  11. data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
  12. data/doc/rdoc/classes/Enumerable.html +6 -6
  13. data/doc/rdoc/classes/Main.html +265 -0
  14. data/doc/rdoc/classes/Object.html +12 -12
  15. data/doc/rdoc/classes/OgApplication.html +2 -2
  16. data/doc/rdoc/classes/OgScaffolder.html +444 -64
  17. data/doc/rdoc/classes/OgScaffolder/Editor.html +490 -0
  18. data/doc/rdoc/classes/OgSession.html +4 -4
  19. data/doc/rdoc/classes/Recipe.html +113 -0
  20. data/doc/rdoc/classes/String.html +12 -12
  21. data/doc/rdoc/classes/Struct.html +12 -12
  22. data/doc/rdoc/classes/Wee.html +10 -1
  23. data/doc/rdoc/classes/Wee/AnswerDecoration.html +9 -9
  24. data/doc/rdoc/classes/Wee/Application.html +48 -47
  25. data/doc/rdoc/classes/Wee/Brush.html +19 -23
  26. data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +17 -14
  27. data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +20 -14
  28. data/doc/rdoc/classes/Wee/Brush/FormTag.html +25 -21
  29. data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
  30. data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +7 -7
  31. data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +234 -100
  32. data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
  33. data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +28 -22
  34. data/doc/rdoc/classes/Wee/Brush/ImageTag.html +23 -24
  35. data/doc/rdoc/classes/Wee/Brush/InputTag.html +14 -14
  36. data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +7 -7
  37. data/doc/rdoc/classes/Wee/Brush/Page.html +14 -14
  38. data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +33 -57
  39. data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +154 -0
  40. data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -7
  41. data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +20 -14
  42. data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +14 -14
  43. data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
  44. data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +42 -42
  45. data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
  46. data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +27 -21
  47. data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +20 -14
  48. data/doc/rdoc/classes/Wee/CallbackRegistry.html +64 -36
  49. data/doc/rdoc/classes/Wee/CallbackStream.html +21 -21
  50. data/doc/rdoc/classes/Wee/Canvas.html +24 -24
  51. data/doc/rdoc/classes/Wee/Component.html +179 -151
  52. data/doc/rdoc/classes/Wee/Component/OnAnswer.html +12 -12
  53. data/doc/rdoc/classes/Wee/Decoration.html +42 -42
  54. data/doc/rdoc/classes/Wee/Delegate.html +27 -27
  55. data/doc/rdoc/classes/Wee/ErrorResponse.html +14 -14
  56. data/doc/rdoc/classes/Wee/FormDecoration.html +6 -6
  57. data/doc/rdoc/classes/Wee/GenericResponse.html +7 -7
  58. data/doc/rdoc/classes/Wee/HtmlCanvas.html +326 -219
  59. data/doc/rdoc/classes/Wee/HtmlWriter.html +40 -40
  60. data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +19 -19
  61. data/doc/rdoc/classes/Wee/Md5IdGenerator.html +181 -0
  62. data/doc/rdoc/classes/Wee/MessageBox.html +12 -12
  63. data/doc/rdoc/classes/Wee/PageDecoration.html +18 -18
  64. data/doc/rdoc/classes/Wee/PagelessApplication.html +152 -0
  65. data/doc/rdoc/classes/Wee/PagelessRequest.html +177 -0
  66. data/doc/rdoc/classes/Wee/PagelessSession.html +320 -0
  67. data/doc/rdoc/classes/Wee/Presenter.html +145 -89
  68. data/doc/rdoc/classes/Wee/RedirectResponse.html +7 -7
  69. data/doc/rdoc/classes/Wee/RefreshResponse.html +7 -7
  70. data/doc/rdoc/classes/Wee/Request.html +116 -50
  71. data/doc/rdoc/classes/Wee/RequestHandler.html +31 -31
  72. data/doc/rdoc/classes/Wee/Response.html +76 -28
  73. data/doc/rdoc/classes/Wee/Session.html +129 -506
  74. data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +22 -40
  75. data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
  76. data/doc/rdoc/classes/Wee/Utils.html +70 -17
  77. data/doc/rdoc/classes/Wee/Utils/LRUCache.html +6 -6
  78. data/doc/rdoc/classes/Wee/ValueHolder.html +18 -18
  79. data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +82 -49
  80. data/doc/rdoc/classes/Wee/WrapperDecoration.html +6 -6
  81. data/doc/rdoc/created.rid +1 -1
  82. data/doc/rdoc/files/INSTALL.html +17 -5
  83. data/doc/rdoc/files/README.html +9 -11
  84. data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
  85. data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
  86. data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
  87. data/doc/rdoc/files/lib/wee/continuation/session_rb.html +1 -3
  88. data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
  89. data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
  90. data/doc/rdoc/files/lib/wee/core_rb.html +3 -3
  91. data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +101 -0
  92. data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +101 -0
  93. data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +108 -0
  94. data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +101 -0
  95. data/doc/rdoc/files/lib/wee/databases/og_rb.html +4 -1
  96. data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +115 -0
  97. data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +107 -0
  98. data/doc/rdoc/files/lib/wee/pageless/application_rb.html +101 -0
  99. data/doc/rdoc/files/lib/wee/pageless/request_rb.html +101 -0
  100. data/doc/rdoc/files/lib/wee/pageless/session_rb.html +108 -0
  101. data/doc/rdoc/files/lib/wee/pageless_rb.html +110 -0
  102. data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
  103. data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +8 -1
  104. data/doc/rdoc/files/lib/wee/request_rb.html +1 -1
  105. data/doc/rdoc/files/lib/wee/response_rb.html +1 -1
  106. data/doc/rdoc/files/lib/wee/session_rb.html +1 -1
  107. data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +101 -0
  108. data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +114 -0
  109. data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +101 -0
  110. data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +115 -0
  111. data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +101 -0
  112. data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +111 -0
  113. data/doc/rdoc/files/lib/wee/template_rb.html +101 -0
  114. data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
  115. data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -1
  116. data/doc/rdoc/files/lib/wee_rb.html +4 -2
  117. data/doc/rdoc/fr_class_index.html +8 -4
  118. data/doc/rdoc/fr_file_index.html +17 -1
  119. data/doc/rdoc/fr_method_index.html +312 -267
  120. data/examples/live-update.rb +1 -1
  121. data/install.rb +14 -0
  122. data/lib/wee.rb +6 -2
  123. data/lib/wee/adaptors/webrick.rb +17 -5
  124. data/lib/wee/application.rb +2 -1
  125. data/lib/wee/continuation/session.rb +1 -146
  126. data/lib/wee/core/callback.rb +11 -5
  127. data/lib/wee/core/component.rb +14 -10
  128. data/lib/wee/databases/og.rb +3 -113
  129. data/lib/wee/databases/og/application.rb +3 -0
  130. data/lib/wee/databases/og/old_scaffolder.rb +98 -0
  131. data/lib/wee/databases/og/scaffolder.rb +174 -0
  132. data/lib/wee/databases/og/session.rb +9 -0
  133. data/lib/wee/idgen/md5.rb +21 -0
  134. data/lib/wee/{idgen.rb → idgen/simple.rb} +2 -4
  135. data/lib/wee/pageless.rb +3 -0
  136. data/lib/wee/pageless/application.rb +9 -0
  137. data/lib/wee/pageless/request.rb +15 -0
  138. data/lib/wee/pageless/session.rb +89 -0
  139. data/lib/wee/renderer/html/brushes.rb +100 -115
  140. data/lib/wee/renderer/html/canvas.rb +32 -2
  141. data/lib/wee/request.rb +36 -24
  142. data/lib/wee/response.rb +8 -1
  143. data/lib/wee/session.rb +13 -7
  144. data/lib/wee/skeleton/og/README +38 -0
  145. data/lib/wee/skeleton/og/components/main.rb +16 -0
  146. data/lib/wee/skeleton/og/conf/db.rb +8 -0
  147. data/lib/wee/skeleton/og/models/recipe.rb +5 -0
  148. data/lib/wee/skeleton/og/run.rb +23 -0
  149. data/lib/wee/skeleton/simple/README +32 -0
  150. data/lib/wee/skeleton/simple/components/main.rb +25 -0
  151. data/lib/wee/skeleton/simple/run.rb +12 -0
  152. data/lib/wee/template.rb +28 -0
  153. data/lib/wee/utils/autoreload.rb +29 -0
  154. data/lib/wee/utils/helper.rb +9 -5
  155. data/test/test_request.rb +4 -3
  156. data/wee.gemspec +3 -1
  157. metadata +91 -22
@@ -88,7 +88,7 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000227">new</a>&nbsp;&nbsp;
91
+ <a href="#M000268">new</a>&nbsp;&nbsp;
92
92
  </div>
93
93
  </div>
94
94
 
@@ -110,21 +110,21 @@
110
110
  <div id="methods">
111
111
  <h3 class="section-bar">Public Class methods</h3>
112
112
 
113
- <div id="method-M000227" class="method-detail">
114
- <a name="M000227"></a>
113
+ <div id="method-M000268" class="method-detail">
114
+ <a name="M000268"></a>
115
115
 
116
116
  <div class="method-heading">
117
- <a href="#M000227" class="method-signature">
117
+ <a href="#M000268" class="method-signature">
118
118
  <span class="method-name">new</span><span class="method-args">(location)</span>
119
119
  </a>
120
120
  </div>
121
121
 
122
122
  <div class="method-description">
123
123
  <p><a class="source-toggle" href="#"
124
- onclick="toggleCode('M000227-source');return false;">[Source]</a></p>
125
- <div class="method-source-code" id="M000227-source">
124
+ onclick="toggleCode('M000268-source');return false;">[Source]</a></p>
125
+ <div class="method-source-code" id="M000268-source">
126
126
  <pre>
127
- <span class="ruby-comment cmt"># File lib/wee/response.rb, line 41</span>
127
+ <span class="ruby-comment cmt"># File lib/wee/response.rb, line 48</span>
128
128
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">location</span>)
129
129
  <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">'text/html'</span>, <span class="ruby-node">%[&lt;title&gt;302 - Redirect&lt;/title&gt;&lt;h1&gt;302 - Redirect&lt;/h1&gt;&lt;p&gt;You are being redirected to &lt;a href=&quot;#{location}&quot;&gt;#{location}&lt;/a&gt;]</span>)
130
130
  <span class="ruby-ivar">@status</span> = <span class="ruby-value">302</span>
@@ -88,7 +88,7 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000204">new</a>&nbsp;&nbsp;
91
+ <a href="#M000243">new</a>&nbsp;&nbsp;
92
92
  </div>
93
93
  </div>
94
94
 
@@ -110,21 +110,21 @@
110
110
  <div id="methods">
111
111
  <h3 class="section-bar">Public Class methods</h3>
112
112
 
113
- <div id="method-M000204" class="method-detail">
114
- <a name="M000204"></a>
113
+ <div id="method-M000243" class="method-detail">
114
+ <a name="M000243"></a>
115
115
 
116
116
  <div class="method-heading">
117
- <a href="#M000204" class="method-signature">
117
+ <a href="#M000243" class="method-signature">
118
118
  <span class="method-name">new</span><span class="method-args">(message, location, seconds=10)</span>
119
119
  </a>
120
120
  </div>
121
121
 
122
122
  <div class="method-description">
123
123
  <p><a class="source-toggle" href="#"
124
- onclick="toggleCode('M000204-source');return false;">[Source]</a></p>
125
- <div class="method-source-code" id="M000204-source">
124
+ onclick="toggleCode('M000243-source');return false;">[Source]</a></p>
125
+ <div class="method-source-code" id="M000243-source">
126
126
  <pre>
127
- <span class="ruby-comment cmt"># File lib/wee/response.rb, line 49</span>
127
+ <span class="ruby-comment cmt"># File lib/wee/response.rb, line 56</span>
128
128
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">location</span>, <span class="ruby-identifier">seconds</span>=<span class="ruby-value">10</span>)
129
129
  <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">'text/html'</span>, <span class="ruby-node">%[&lt;html&gt;
130
130
  &lt;head&gt;
@@ -100,9 +100,11 @@ NOTE that if there are fields named &quot;xxx&quot; and
100
100
  <h3 class="section-bar">Methods</h3>
101
101
 
102
102
  <div class="name-list">
103
- <a href="#M000248">application_path</a>&nbsp;&nbsp;
104
- <a href="#M000249">build_url</a>&nbsp;&nbsp;
105
- <a href="#M000247">new</a>&nbsp;&nbsp;
103
+ <a href="#M000278">application_path</a>&nbsp;&nbsp;
104
+ <a href="#M000279">build_url</a>&nbsp;&nbsp;
105
+ <a href="#M000277">new</a>&nbsp;&nbsp;
106
+ <a href="#M000280">parse_fields</a>&nbsp;&nbsp;
107
+ <a href="#M000281">parse_path</a>&nbsp;&nbsp;
106
108
  </div>
107
109
  </div>
108
110
 
@@ -114,6 +116,19 @@ NOTE that if there are fields named &quot;xxx&quot; and
114
116
  <div id="section">
115
117
 
116
118
 
119
+ <div id="constants-list">
120
+ <h3 class="section-bar">Constants</h3>
121
+
122
+ <div class="name-list">
123
+ <table summary="Constants">
124
+ <tr class="top-aligned-row context-row">
125
+ <td class="context-item-name">DELIM</td>
126
+ <td>=</td>
127
+ <td class="context-item-value">'=/'</td>
128
+ </tr>
129
+ </table>
130
+ </div>
131
+ </div>
117
132
 
118
133
 
119
134
 
@@ -122,6 +137,11 @@ NOTE that if there are fields named &quot;xxx&quot; and
122
137
 
123
138
  <div class="name-list">
124
139
  <table>
140
+ <tr class="top-aligned-row context-row">
141
+ <td class="context-item-name">cookies</td>
142
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
143
+ <td class="context-item-desc"></td>
144
+ </tr>
125
145
  <tr class="top-aligned-row context-row">
126
146
  <td class="context-item-name">fields</td>
127
147
  <td class="context-item-value">&nbsp;[R]&nbsp;</td>
@@ -134,7 +154,7 @@ NOTE that if there are fields named &quot;xxx&quot; and
134
154
  </tr>
135
155
  <tr class="top-aligned-row context-row">
136
156
  <td class="context-item-name">request_handler_id</td>
137
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
157
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
138
158
  <td class="context-item-desc"></td>
139
159
  </tr>
140
160
  </table>
@@ -147,46 +167,25 @@ NOTE that if there are fields named &quot;xxx&quot; and
147
167
  <div id="methods">
148
168
  <h3 class="section-bar">Public Class methods</h3>
149
169
 
150
- <div id="method-M000247" class="method-detail">
151
- <a name="M000247"></a>
170
+ <div id="method-M000277" class="method-detail">
171
+ <a name="M000277"></a>
152
172
 
153
173
  <div class="method-heading">
154
- <a href="#M000247" class="method-signature">
155
- <span class="method-name">new</span><span class="method-args">(app_path, path, headers, fields)</span>
174
+ <a href="#M000277" class="method-signature">
175
+ <span class="method-name">new</span><span class="method-args">(app_path, path, headers, fields, cookies)</span>
156
176
  </a>
157
177
  </div>
158
178
 
159
179
  <div class="method-description">
160
180
  <p><a class="source-toggle" href="#"
161
- onclick="toggleCode('M000247-source');return false;">[Source]</a></p>
162
- <div class="method-source-code" id="M000247-source">
181
+ onclick="toggleCode('M000277-source');return false;">[Source]</a></p>
182
+ <div class="method-source-code" id="M000277-source">
163
183
  <pre>
164
- <span class="ruby-comment cmt"># File lib/wee/request.rb, line 11</span>
165
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app_path</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">fields</span>)
166
- <span class="ruby-ivar">@app_path</span>, <span class="ruby-ivar">@path</span>, <span class="ruby-ivar">@headers</span> = <span class="ruby-identifier">app_path</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">headers</span>
167
-
168
- <span class="ruby-identifier">fields</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
169
- <span class="ruby-ivar">@fields</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
170
-
171
- <span class="ruby-comment cmt"># sorted by decreasing key length, e.g. &quot;2.x&quot; comes before &quot;2&quot;</span>
172
- <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">sort_by</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-operator">-</span><span class="ruby-identifier">k</span>.<span class="ruby-identifier">length</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-operator">|</span>
173
- <span class="ruby-identifier">val</span> = <span class="ruby-identifier">fields</span>[<span class="ruby-identifier">key</span>]
174
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;.&quot;</span>)
175
- <span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;.&quot;</span>, <span class="ruby-value">2</span>)
176
- <span class="ruby-ivar">@fields</span>[<span class="ruby-identifier">a</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
177
- <span class="ruby-ivar">@fields</span>[<span class="ruby-identifier">a</span>][<span class="ruby-identifier">b</span>] = <span class="ruby-identifier">val</span>
178
- <span class="ruby-keyword kw">else</span>
179
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@fields</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">key</span>)
180
- <span class="ruby-ivar">@fields</span>[<span class="ruby-identifier">key</span>][<span class="ruby-keyword kw">nil</span>] = <span class="ruby-identifier">val</span>
181
- <span class="ruby-keyword kw">else</span>
182
- <span class="ruby-ivar">@fields</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
183
- <span class="ruby-keyword kw">end</span>
184
- <span class="ruby-keyword kw">end</span>
185
- <span class="ruby-keyword kw">end</span>
186
-
187
- <span class="ruby-identifier">full_app_path</span>, <span class="ruby-identifier">req_path</span> = <span class="ruby-ivar">@path</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'@'</span>, <span class="ruby-value">2</span>)
188
- <span class="ruby-ivar">@request_handler_id</span> = <span class="ruby-ivar">@page_id</span> = <span class="ruby-keyword kw">nil</span>
189
- <span class="ruby-ivar">@request_handler_id</span>, <span class="ruby-ivar">@page_id</span> = <span class="ruby-identifier">req_path</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>, <span class="ruby-value">2</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">req_path</span>
184
+ <span class="ruby-comment cmt"># File lib/wee/request.rb, line 14</span>
185
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app_path</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">fields</span>, <span class="ruby-identifier">cookies</span>)
186
+ <span class="ruby-ivar">@app_path</span>, <span class="ruby-ivar">@path</span>, <span class="ruby-ivar">@headers</span>, <span class="ruby-ivar">@cookies</span> = <span class="ruby-identifier">app_path</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">cookies</span>
187
+ <span class="ruby-identifier">parse_fields</span>(<span class="ruby-identifier">fields</span>)
188
+ <span class="ruby-identifier">parse_path</span>
190
189
  <span class="ruby-keyword kw">end</span>
191
190
  </pre>
192
191
  </div>
@@ -195,21 +194,21 @@ NOTE that if there are fields named &quot;xxx&quot; and
195
194
 
196
195
  <h3 class="section-bar">Public Instance methods</h3>
197
196
 
198
- <div id="method-M000248" class="method-detail">
199
- <a name="M000248"></a>
197
+ <div id="method-M000278" class="method-detail">
198
+ <a name="M000278"></a>
200
199
 
201
200
  <div class="method-heading">
202
- <a href="#M000248" class="method-signature">
201
+ <a href="#M000278" class="method-signature">
203
202
  <span class="method-name">application_path</span><span class="method-args">()</span>
204
203
  </a>
205
204
  </div>
206
205
 
207
206
  <div class="method-description">
208
207
  <p><a class="source-toggle" href="#"
209
- onclick="toggleCode('M000248-source');return false;">[Source]</a></p>
210
- <div class="method-source-code" id="M000248-source">
208
+ onclick="toggleCode('M000278-source');return false;">[Source]</a></p>
209
+ <div class="method-source-code" id="M000278-source">
211
210
  <pre>
212
- <span class="ruby-comment cmt"># File lib/wee/request.rb, line 38</span>
211
+ <span class="ruby-comment cmt"># File lib/wee/request.rb, line 20</span>
213
212
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_path</span>
214
213
  <span class="ruby-ivar">@app_path</span>
215
214
  <span class="ruby-keyword kw">end</span>
@@ -218,21 +217,21 @@ NOTE that if there are fields named &quot;xxx&quot; and
218
217
  </div>
219
218
  </div>
220
219
 
221
- <div id="method-M000249" class="method-detail">
222
- <a name="M000249"></a>
220
+ <div id="method-M000279" class="method-detail">
221
+ <a name="M000279"></a>
223
222
 
224
223
  <div class="method-heading">
225
- <a href="#M000249" class="method-signature">
224
+ <a href="#M000279" class="method-signature">
226
225
  <span class="method-name">build_url</span><span class="method-args">(request_handler_id=nil, page_id=nil, callback_id=nil)</span>
227
226
  </a>
228
227
  </div>
229
228
 
230
229
  <div class="method-description">
231
230
  <p><a class="source-toggle" href="#"
232
- onclick="toggleCode('M000249-source');return false;">[Source]</a></p>
233
- <div class="method-source-code" id="M000249-source">
231
+ onclick="toggleCode('M000279-source');return false;">[Source]</a></p>
232
+ <div class="method-source-code" id="M000279-source">
234
233
  <pre>
235
- <span class="ruby-comment cmt"># File lib/wee/request.rb, line 42</span>
234
+ <span class="ruby-comment cmt"># File lib/wee/request.rb, line 24</span>
236
235
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_url</span>(<span class="ruby-identifier">request_handler_id</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">page_id</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">callback_id</span>=<span class="ruby-keyword kw">nil</span>)
237
236
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_handler_id</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">page_id</span>.<span class="ruby-identifier">nil?</span>
238
237
 
@@ -241,8 +240,8 @@ NOTE that if there are fields named &quot;xxx&quot; and
241
240
  <span class="ruby-identifier">url</span> = <span class="ruby-value str">&quot;&quot;</span>
242
241
  <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@app_path</span>
243
242
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">empty?</span>
244
- <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'/'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span>[<span class="ruby-value">-1</span>,<span class="ruby-value">1</span>] <span class="ruby-operator">!=</span> <span class="ruby-value str">'/'</span> <span class="ruby-comment cmt"># /app@ -&gt; /app/@</span>
245
- <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">'@'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'/'</span>))
243
+ <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'/'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span>[<span class="ruby-value">-1</span>,<span class="ruby-value">1</span>] <span class="ruby-operator">!=</span> <span class="ruby-value str">'/'</span> <span class="ruby-comment cmt"># /appXXX -&gt; /app/XXX</span>
244
+ <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-constant">DELIM</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'/'</span>))
246
245
  <span class="ruby-keyword kw">end</span>
247
246
  <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">'?'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">callback_id</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback_id</span>
248
247
 
@@ -253,6 +252,73 @@ NOTE that if there are fields named &quot;xxx&quot; and
253
252
  </div>
254
253
  </div>
255
254
 
255
+ <h3 class="section-bar">Private Instance methods</h3>
256
+
257
+ <div id="method-M000280" class="method-detail">
258
+ <a name="M000280"></a>
259
+
260
+ <div class="method-heading">
261
+ <a href="#M000280" class="method-signature">
262
+ <span class="method-name">parse_fields</span><span class="method-args">(fields)</span>
263
+ </a>
264
+ </div>
265
+
266
+ <div class="method-description">
267
+ <p><a class="source-toggle" href="#"
268
+ onclick="toggleCode('M000280-source');return false;">[Source]</a></p>
269
+ <div class="method-source-code" id="M000280-source">
270
+ <pre>
271
+ <span class="ruby-comment cmt"># File lib/wee/request.rb, line 42</span>
272
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_fields</span>(<span class="ruby-identifier">fields</span>)
273
+ <span class="ruby-identifier">fields</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
274
+ <span class="ruby-ivar">@fields</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
275
+
276
+ <span class="ruby-comment cmt"># sorted by decreasing key length, e.g. &quot;2.x&quot; comes before &quot;2&quot;</span>
277
+ <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">sort_by</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-operator">-</span><span class="ruby-identifier">k</span>.<span class="ruby-identifier">length</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-operator">|</span>
278
+ <span class="ruby-identifier">val</span> = <span class="ruby-identifier">fields</span>[<span class="ruby-identifier">key</span>]
279
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;.&quot;</span>)
280
+ <span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;.&quot;</span>, <span class="ruby-value">2</span>)
281
+ <span class="ruby-ivar">@fields</span>[<span class="ruby-identifier">a</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
282
+ <span class="ruby-ivar">@fields</span>[<span class="ruby-identifier">a</span>][<span class="ruby-identifier">b</span>] = <span class="ruby-identifier">val</span>
283
+ <span class="ruby-keyword kw">else</span>
284
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@fields</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">key</span>)
285
+ <span class="ruby-ivar">@fields</span>[<span class="ruby-identifier">key</span>][<span class="ruby-keyword kw">nil</span>] = <span class="ruby-identifier">val</span>
286
+ <span class="ruby-keyword kw">else</span>
287
+ <span class="ruby-ivar">@fields</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
288
+ <span class="ruby-keyword kw">end</span>
289
+ <span class="ruby-keyword kw">end</span>
290
+ <span class="ruby-keyword kw">end</span>
291
+ <span class="ruby-keyword kw">end</span>
292
+ </pre>
293
+ </div>
294
+ </div>
295
+ </div>
296
+
297
+ <div id="method-M000281" class="method-detail">
298
+ <a name="M000281"></a>
299
+
300
+ <div class="method-heading">
301
+ <a href="#M000281" class="method-signature">
302
+ <span class="method-name">parse_path</span><span class="method-args">()</span>
303
+ </a>
304
+ </div>
305
+
306
+ <div class="method-description">
307
+ <p><a class="source-toggle" href="#"
308
+ onclick="toggleCode('M000281-source');return false;">[Source]</a></p>
309
+ <div class="method-source-code" id="M000281-source">
310
+ <pre>
311
+ <span class="ruby-comment cmt"># File lib/wee/request.rb, line 63</span>
312
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_path</span>
313
+ <span class="ruby-identifier">full_app_path</span>, <span class="ruby-identifier">req_path</span> = <span class="ruby-ivar">@path</span>.<span class="ruby-identifier">split</span>(<span class="ruby-constant">DELIM</span>, <span class="ruby-value">2</span>)
314
+ <span class="ruby-ivar">@request_handler_id</span> = <span class="ruby-ivar">@page_id</span> = <span class="ruby-keyword kw">nil</span>
315
+ <span class="ruby-ivar">@request_handler_id</span>, <span class="ruby-ivar">@page_id</span> = <span class="ruby-identifier">req_path</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>, <span class="ruby-value">2</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">req_path</span>
316
+ <span class="ruby-keyword kw">end</span>
317
+ </pre>
318
+ </div>
319
+ </div>
320
+ </div>
321
+
256
322
 
257
323
  </div>
258
324
 
@@ -88,11 +88,11 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000261">alive?</a>&nbsp;&nbsp;
92
- <a href="#M000262">handle_request</a>&nbsp;&nbsp;
93
- <a href="#M000264">new</a>&nbsp;&nbsp;
94
- <a href="#M000263">statistics</a>&nbsp;&nbsp;
95
- <a href="#M000260">teminate</a>&nbsp;&nbsp;
91
+ <a href="#M000306">alive?</a>&nbsp;&nbsp;
92
+ <a href="#M000307">handle_request</a>&nbsp;&nbsp;
93
+ <a href="#M000309">new</a>&nbsp;&nbsp;
94
+ <a href="#M000308">statistics</a>&nbsp;&nbsp;
95
+ <a href="#M000305">teminate</a>&nbsp;&nbsp;
96
96
  </div>
97
97
  </div>
98
98
 
@@ -175,19 +175,19 @@ The maximum number of requests this handler should serve. A value of
175
175
  <div id="methods">
176
176
  <h3 class="section-bar">Public Class methods</h3>
177
177
 
178
- <div id="method-M000264" class="method-detail">
179
- <a name="M000264"></a>
178
+ <div id="method-M000309" class="method-detail">
179
+ <a name="M000309"></a>
180
180
 
181
181
  <div class="method-heading">
182
- <a href="#M000264" class="method-signature">
182
+ <a href="#M000309" class="method-signature">
183
183
  <span class="method-name">new</span><span class="method-args">()</span>
184
184
  </a>
185
185
  </div>
186
186
 
187
187
  <div class="method-description">
188
188
  <p><a class="source-toggle" href="#"
189
- onclick="toggleCode('M000264-source');return false;">[Source]</a></p>
190
- <div class="method-source-code" id="M000264-source">
189
+ onclick="toggleCode('M000309-source');return false;">[Source]</a></p>
190
+ <div class="method-source-code" id="M000309-source">
191
191
  <pre>
192
192
  <span class="ruby-comment cmt"># File lib/wee/requesthandler.rb, line 74</span>
193
193
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
@@ -203,11 +203,11 @@ The maximum number of requests this handler should serve. A value of
203
203
 
204
204
  <h3 class="section-bar">Public Instance methods</h3>
205
205
 
206
- <div id="method-M000261" class="method-detail">
207
- <a name="M000261"></a>
206
+ <div id="method-M000306" class="method-detail">
207
+ <a name="M000306"></a>
208
208
 
209
209
  <div class="method-heading">
210
- <a href="#M000261" class="method-signature">
210
+ <a href="#M000306" class="method-signature">
211
211
  <span class="method-name">alive?</span><span class="method-args">()</span>
212
212
  </a>
213
213
  </div>
@@ -217,8 +217,8 @@ The maximum number of requests this handler should serve. A value of
217
217
  Query whether this handler is still alive.
218
218
  </p>
219
219
  <p><a class="source-toggle" href="#"
220
- onclick="toggleCode('M000261-source');return false;">[Source]</a></p>
221
- <div class="method-source-code" id="M000261-source">
220
+ onclick="toggleCode('M000306-source');return false;">[Source]</a></p>
221
+ <div class="method-source-code" id="M000306-source">
222
222
  <pre>
223
223
  <span class="ruby-comment cmt"># File lib/wee/requesthandler.rb, line 43</span>
224
224
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">alive?</span>
@@ -238,23 +238,23 @@ Query whether this handler is still alive.
238
238
  </div>
239
239
  </div>
240
240
 
241
- <div id="method-M000262" class="method-detail">
242
- <a name="M000262"></a>
241
+ <div id="method-M000307" class="method-detail">
242
+ <a name="M000307"></a>
243
243
 
244
244
  <div class="method-heading">
245
- <a href="#M000262" class="method-signature">
245
+ <a href="#M000307" class="method-signature">
246
246
  <span class="method-name">handle_request</span><span class="method-args">(context)</span>
247
247
  </a>
248
248
  </div>
249
249
 
250
250
  <div class="method-description">
251
251
  <p>
252
- Extend <a href="RequestHandler.html#M000262">handle_request</a> in your own
252
+ Extend <a href="RequestHandler.html#M000307">handle_request</a> in your own
253
253
  subclass.
254
254
  </p>
255
255
  <p><a class="source-toggle" href="#"
256
- onclick="toggleCode('M000262-source');return false;">[Source]</a></p>
257
- <div class="method-source-code" id="M000262-source">
256
+ onclick="toggleCode('M000307-source');return false;">[Source]</a></p>
257
+ <div class="method-source-code" id="M000307-source">
258
258
  <pre>
259
259
  <span class="ruby-comment cmt"># File lib/wee/requesthandler.rb, line 58</span>
260
260
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_request</span>(<span class="ruby-identifier">context</span>)
@@ -266,19 +266,19 @@ subclass.
266
266
  </div>
267
267
  </div>
268
268
 
269
- <div id="method-M000263" class="method-detail">
270
- <a name="M000263"></a>
269
+ <div id="method-M000308" class="method-detail">
270
+ <a name="M000308"></a>
271
271
 
272
272
  <div class="method-heading">
273
- <a href="#M000263" class="method-signature">
273
+ <a href="#M000308" class="method-signature">
274
274
  <span class="method-name">statistics</span><span class="method-args">()</span>
275
275
  </a>
276
276
  </div>
277
277
 
278
278
  <div class="method-description">
279
279
  <p><a class="source-toggle" href="#"
280
- onclick="toggleCode('M000263-source');return false;">[Source]</a></p>
281
- <div class="method-source-code" id="M000263-source">
280
+ onclick="toggleCode('M000308-source');return false;">[Source]</a></p>
281
+ <div class="method-source-code" id="M000308-source">
282
282
  <pre>
283
283
  <span class="ruby-comment cmt"># File lib/wee/requesthandler.rb, line 63</span>
284
284
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">statistics</span>
@@ -296,11 +296,11 @@ subclass.
296
296
  </div>
297
297
  </div>
298
298
 
299
- <div id="method-M000260" class="method-detail">
300
- <a name="M000260"></a>
299
+ <div id="method-M000305" class="method-detail">
300
+ <a name="M000305"></a>
301
301
 
302
302
  <div class="method-heading">
303
- <a href="#M000260" class="method-signature">
303
+ <a href="#M000305" class="method-signature">
304
304
  <span class="method-name">teminate</span><span class="method-args">()</span>
305
305
  </a>
306
306
  </div>
@@ -314,8 +314,8 @@ This will usually not immediatly terminate the handler from running, but
314
314
  further requests will not be answered.
315
315
  </p>
316
316
  <p><a class="source-toggle" href="#"
317
- onclick="toggleCode('M000260-source');return false;">[Source]</a></p>
318
- <div class="method-source-code" id="M000260-source">
317
+ onclick="toggleCode('M000305-source');return false;">[Source]</a></p>
318
+ <div class="method-source-code" id="M000305-source">
319
319
  <pre>
320
320
  <span class="ruby-comment cmt"># File lib/wee/requesthandler.rb, line 37</span>
321
321
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">teminate</span>