wee 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/ChangeLog +75 -0
  2. data/README +17 -9
  3. data/Rakefile +2 -2
  4. data/TODO +20 -0
  5. data/benchmark/Makefile +14 -9
  6. data/benchmark/counter.rb +11 -30
  7. data/benchmark/report_req.rb +12 -0
  8. data/doc/rdoc/classes/Array.html +12 -12
  9. data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
  10. data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
  11. data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
  12. data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
  13. data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
  14. data/doc/rdoc/classes/Enumerable.html +6 -6
  15. data/doc/rdoc/classes/Object.html +12 -12
  16. data/doc/rdoc/classes/OgApplication.html +126 -0
  17. data/doc/rdoc/classes/OgScaffolder.html +401 -0
  18. data/doc/rdoc/classes/OgSession.html +172 -0
  19. data/doc/rdoc/classes/String.html +12 -12
  20. data/doc/rdoc/classes/Struct.html +12 -12
  21. data/doc/rdoc/classes/Wee.html +5 -62
  22. data/doc/rdoc/classes/Wee/AnswerDecoration.html +9 -9
  23. data/doc/rdoc/classes/Wee/Application.html +107 -39
  24. data/doc/rdoc/classes/Wee/Brush.html +22 -18
  25. data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +17 -11
  26. data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +18 -10
  27. data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +30 -64
  28. data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +8 -10
  29. data/doc/rdoc/classes/Wee/Brush/FormTag.html +27 -79
  30. data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
  31. data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +146 -0
  32. data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +179 -65
  33. data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
  34. data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +16 -18
  35. data/doc/rdoc/classes/Wee/Brush/ImageTag.html +203 -0
  36. data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +17 -11
  37. data/doc/rdoc/classes/Wee/Brush/InputTag.html +15 -15
  38. data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +147 -0
  39. data/doc/rdoc/classes/Wee/Brush/Page.html +17 -17
  40. data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +25 -50
  41. data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -38
  42. data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +7 -7
  43. data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +15 -16
  44. data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
  45. data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +65 -50
  46. data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
  47. data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +14 -64
  48. data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
  49. data/doc/rdoc/classes/Wee/Brush/ToCallback.html +146 -0
  50. data/doc/rdoc/classes/Wee/CallbackRegistry.html +40 -40
  51. data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
  52. data/doc/rdoc/classes/Wee/Canvas.html +24 -24
  53. data/doc/rdoc/classes/Wee/Component.html +232 -149
  54. data/doc/rdoc/classes/Wee/Component/OnAnswer.html +153 -0
  55. data/doc/rdoc/classes/Wee/Decoration.html +42 -42
  56. data/doc/rdoc/classes/Wee/Delegate.html +27 -27
  57. data/doc/rdoc/classes/Wee/ErrorResponse.html +12 -12
  58. data/doc/rdoc/classes/Wee/FormDecoration.html +148 -0
  59. data/doc/rdoc/classes/Wee/GenericResponse.html +6 -6
  60. data/doc/rdoc/classes/Wee/HtmlCanvas.html +296 -215
  61. data/doc/rdoc/classes/Wee/HtmlWriter.html +83 -81
  62. data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +21 -16
  63. data/doc/rdoc/classes/Wee/MessageBox.html +180 -0
  64. data/doc/rdoc/classes/Wee/PageDecoration.html +30 -30
  65. data/doc/rdoc/classes/Wee/Presenter.html +237 -69
  66. data/doc/rdoc/classes/Wee/RedirectResponse.html +6 -6
  67. data/doc/rdoc/classes/Wee/RefreshResponse.html +6 -6
  68. data/doc/rdoc/classes/Wee/Request.html +18 -18
  69. data/doc/rdoc/classes/Wee/RequestHandler.html +43 -39
  70. data/doc/rdoc/classes/Wee/Response.html +24 -24
  71. data/doc/rdoc/classes/Wee/Session.html +746 -72
  72. data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +18 -18
  73. data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
  74. data/doc/rdoc/classes/Wee/Utils.html +138 -2
  75. data/doc/rdoc/classes/Wee/Utils/LRUCache.html +7 -7
  76. data/doc/rdoc/classes/Wee/ValueHolder.html +18 -18
  77. data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +43 -68
  78. data/doc/rdoc/classes/Wee/WrapperDecoration.html +150 -0
  79. data/doc/rdoc/created.rid +1 -1
  80. data/doc/rdoc/files/README.html +29 -15
  81. data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
  82. data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
  83. data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +101 -0
  84. data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +101 -0
  85. data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
  86. data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +101 -0
  87. data/doc/rdoc/files/lib/wee/components_rb.html +4 -1
  88. data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +101 -0
  89. data/doc/rdoc/files/lib/wee/continuation/session_rb.html +110 -0
  90. data/doc/rdoc/files/lib/wee/continuation_rb.html +116 -0
  91. data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
  92. data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
  93. data/doc/rdoc/files/lib/wee/core/presenter_rb.html +1 -1
  94. data/doc/rdoc/files/lib/wee/core_rb.html +3 -3
  95. data/doc/rdoc/files/lib/wee/databases/og_rb.html +108 -0
  96. data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
  97. data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +1 -1
  98. data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +1 -1
  99. data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
  100. data/doc/rdoc/files/lib/wee/session_rb.html +1 -2
  101. data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
  102. data/doc/rdoc/files/lib/wee/utils/cache_rb.html +1 -1
  103. data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -8
  104. data/doc/rdoc/files/lib/wee/utils_rb.html +110 -0
  105. data/doc/rdoc/files/lib/wee_rb.html +1 -1
  106. data/doc/rdoc/fr_class_index.html +11 -1
  107. data/doc/rdoc/fr_file_index.html +8 -0
  108. data/doc/rdoc/fr_method_index.html +269 -228
  109. data/examples/calculator.rb +69 -0
  110. data/examples/calendar.rb +5 -17
  111. data/examples/example.rb +2 -2
  112. data/examples/hw.rb +17 -0
  113. data/examples/live-update.rb +45 -0
  114. data/examples/og-test.rb +51 -0
  115. data/lib/wee.rb +1 -1
  116. data/lib/wee/adaptors/webrick.rb +2 -0
  117. data/lib/wee/application.rb +16 -0
  118. data/lib/wee/components.rb +3 -0
  119. data/lib/wee/components/form_decoration.rb +7 -0
  120. data/{test → lib/wee}/components/messagebox.rb +1 -1
  121. data/lib/wee/components/page_decoration.rb +5 -5
  122. data/lib/wee/components/wrapper_decoration.rb +7 -0
  123. data/lib/wee/continuation.rb +5 -0
  124. data/lib/wee/continuation/core/component.rb +55 -0
  125. data/lib/wee/continuation/session.rb +217 -0
  126. data/lib/wee/core/callback.rb +11 -6
  127. data/lib/wee/core/component.rb +45 -33
  128. data/lib/wee/core/presenter.rb +68 -0
  129. data/lib/wee/databases/og.rb +114 -0
  130. data/lib/wee/renderer/html/brushes.rb +179 -98
  131. data/lib/wee/renderer/html/canvas.rb +37 -13
  132. data/lib/wee/renderer/html/writer.rb +34 -32
  133. data/lib/wee/requesthandler.rb +6 -3
  134. data/lib/wee/session.rb +73 -54
  135. data/lib/wee/utils.rb +5 -0
  136. data/lib/wee/utils/autoreload.rb +1 -1
  137. data/lib/wee/utils/cache.rb +0 -2
  138. data/lib/wee/utils/helper.rb +40 -8
  139. data/test/components/calltest-cont.rb +16 -0
  140. data/test/components/calltest.rb +15 -10
  141. data/test/stress.rb +31 -28
  142. data/test/stress_and_measure.rb +53 -0
  143. data/test/stressed_application.rb +15 -0
  144. data/test/test_html_writer.rb +9 -4
  145. metadata +236 -195
  146. data/benchmark/bench.sh +0 -24
@@ -78,31 +78,6 @@
78
78
 
79
79
  <div id="contextContent">
80
80
 
81
- <div id="description">
82
- <p>
83
- Example of usage:
84
- </p>
85
- <pre>
86
- require 'wee/adaptors/webrick'
87
- s = WEBrick::HTTPServer.new(:Port =&gt; 2000)
88
- s.mount '/app', Wee::WEBrickAdaptor, application
89
-
90
- trap(&quot;INT&quot;) { s.shutdown; exit }
91
- s.start
92
- </pre>
93
- <p>
94
- Or when using the convenience methods:
95
- </p>
96
- <pre>
97
- require 'wee/adaptors/webrick'
98
- Wee::WEBrickAdaptor.
99
- register('/app' =&gt; application).
100
- register('/cnt' =&gt; application2).
101
- mount('/', WEBrick::HTTPServlet::FileHandler, '.').
102
- start(:Port =&gt; 2000)
103
- </pre>
104
-
105
- </div>
106
81
 
107
82
 
108
83
  </div>
@@ -111,13 +86,13 @@ Or when using the convenience methods:
111
86
  <h3 class="section-bar">Methods</h3>
112
87
 
113
88
  <div class="name-list">
114
- <a href="#M000041">do_GET</a>&nbsp;&nbsp;
115
- <a href="#M000042">do_POST</a>&nbsp;&nbsp;
116
- <a href="#M000040">handle_request</a>&nbsp;&nbsp;
117
- <a href="#M000038">mount</a>&nbsp;&nbsp;
118
- <a href="#M000039">new</a>&nbsp;&nbsp;
119
- <a href="#M000037">register</a>&nbsp;&nbsp;
120
- <a href="#M000036">start</a>&nbsp;&nbsp;
89
+ <a href="#M000052">do_GET</a>&nbsp;&nbsp;
90
+ <a href="#M000053">do_POST</a>&nbsp;&nbsp;
91
+ <a href="#M000051">handle_request</a>&nbsp;&nbsp;
92
+ <a href="#M000049">mount</a>&nbsp;&nbsp;
93
+ <a href="#M000050">new</a>&nbsp;&nbsp;
94
+ <a href="#M000048">register</a>&nbsp;&nbsp;
95
+ <a href="#M000047">start</a>&nbsp;&nbsp;
121
96
  </div>
122
97
  </div>
123
98
 
@@ -139,11 +114,11 @@ Or when using the convenience methods:
139
114
  <div id="methods">
140
115
  <h3 class="section-bar">Public Class methods</h3>
141
116
 
142
- <div id="method-M000038" class="method-detail">
143
- <a name="M000038"></a>
117
+ <div id="method-M000049" class="method-detail">
118
+ <a name="M000049"></a>
144
119
 
145
120
  <div class="method-heading">
146
- <a href="#M000038" class="method-signature">
121
+ <a href="#M000049" class="method-signature">
147
122
  <span class="method-name">mount</span><span class="method-args">(*args, &amp;block)</span>
148
123
  </a>
149
124
  </div>
@@ -153,10 +128,10 @@ Or when using the convenience methods:
153
128
  Convenience method
154
129
  </p>
155
130
  <p><a class="source-toggle" href="#"
156
- onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
157
- <div class="method-source-code" id="M000038-source">
131
+ onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
132
+ <div class="method-source-code" id="M000049-source">
158
133
  <pre>
159
- <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 53</span>
134
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 55</span>
160
135
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">mount</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
161
136
  <span class="ruby-ivar">@mounts</span> <span class="ruby-operator">||=</span> []
162
137
  <span class="ruby-ivar">@mounts</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>]
@@ -167,21 +142,21 @@ Convenience method
167
142
  </div>
168
143
  </div>
169
144
 
170
- <div id="method-M000039" class="method-detail">
171
- <a name="M000039"></a>
145
+ <div id="method-M000050" class="method-detail">
146
+ <a name="M000050"></a>
172
147
 
173
148
  <div class="method-heading">
174
- <a href="#M000039" class="method-signature">
149
+ <a href="#M000050" class="method-signature">
175
150
  <span class="method-name">new</span><span class="method-args">(server, mount_path, application)</span>
176
151
  </a>
177
152
  </div>
178
153
 
179
154
  <div class="method-description">
180
155
  <p><a class="source-toggle" href="#"
181
- onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
182
- <div class="method-source-code" id="M000039-source">
156
+ onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
157
+ <div class="method-source-code" id="M000050-source">
183
158
  <pre>
184
- <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 59</span>
159
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 61</span>
185
160
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">server</span>, <span class="ruby-identifier">mount_path</span>, <span class="ruby-identifier">application</span>)
186
161
  <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">server</span>)
187
162
  <span class="ruby-ivar">@mount_path</span> = <span class="ruby-identifier">mount_path</span>
@@ -192,11 +167,11 @@ Convenience method
192
167
  </div>
193
168
  </div>
194
169
 
195
- <div id="method-M000037" class="method-detail">
196
- <a name="M000037"></a>
170
+ <div id="method-M000048" class="method-detail">
171
+ <a name="M000048"></a>
197
172
 
198
173
  <div class="method-heading">
199
- <a href="#M000037" class="method-signature">
174
+ <a href="#M000048" class="method-signature">
200
175
  <span class="method-name">register</span><span class="method-args">(hash)</span>
201
176
  </a>
202
177
  </div>
@@ -206,10 +181,10 @@ Convenience method
206
181
  Convenience method
207
182
  </p>
208
183
  <p><a class="source-toggle" href="#"
209
- onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
210
- <div class="method-source-code" id="M000037-source">
184
+ onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
185
+ <div class="method-source-code" id="M000048-source">
211
186
  <pre>
212
- <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 44</span>
187
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 46</span>
213
188
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">hash</span>)
214
189
  <span class="ruby-ivar">@apps</span> <span class="ruby-operator">||=</span> []
215
190
  <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span>, <span class="ruby-identifier">application</span><span class="ruby-operator">|</span>
@@ -222,11 +197,11 @@ Convenience method
222
197
  </div>
223
198
  </div>
224
199
 
225
- <div id="method-M000036" class="method-detail">
226
- <a name="M000036"></a>
200
+ <div id="method-M000047" class="method-detail">
201
+ <a name="M000047"></a>
227
202
 
228
203
  <div class="method-heading">
229
- <a href="#M000036" class="method-signature">
204
+ <a href="#M000047" class="method-signature">
230
205
  <span class="method-name">start</span><span class="method-args">(options={}) {|server if block_given?| ...}</span>
231
206
  </a>
232
207
  </div>
@@ -236,10 +211,10 @@ Convenience method
236
211
  Convenience method
237
212
  </p>
238
213
  <p><a class="source-toggle" href="#"
239
- onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
240
- <div class="method-source-code" id="M000036-source">
214
+ onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
215
+ <div class="method-source-code" id="M000047-source">
241
216
  <pre>
242
- <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 25</span>
217
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 27</span>
243
218
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">start</span>(<span class="ruby-identifier">options</span>={})
244
219
  <span class="ruby-identifier">server</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">&gt;</span> <span class="ruby-value">2000</span>}.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>))
245
220
  <span class="ruby-identifier">trap</span>(<span class="ruby-value str">&quot;INT&quot;</span>) { <span class="ruby-identifier">server</span>.<span class="ruby-identifier">shutdown</span> }
@@ -264,8 +239,8 @@ Convenience method
264
239
 
265
240
  <h3 class="section-bar">Public Instance methods</h3>
266
241
 
267
- <div id="method-M000041" class="method-detail">
268
- <a name="M000041"></a>
242
+ <div id="method-M000052" class="method-detail">
243
+ <a name="M000052"></a>
269
244
 
270
245
  <div class="method-heading">
271
246
  <span class="method-name">do_GET</span><span class="method-args">(req, res)</span>
@@ -273,13 +248,13 @@ Convenience method
273
248
 
274
249
  <div class="method-description">
275
250
  <p>
276
- Alias for <a href="WEBrickAdaptor.html#M000040">handle_request</a>
251
+ Alias for <a href="WEBrickAdaptor.html#M000051">handle_request</a>
277
252
  </p>
278
253
  </div>
279
254
  </div>
280
255
 
281
- <div id="method-M000042" class="method-detail">
282
- <a name="M000042"></a>
256
+ <div id="method-M000053" class="method-detail">
257
+ <a name="M000053"></a>
283
258
 
284
259
  <div class="method-heading">
285
260
  <span class="method-name">do_POST</span><span class="method-args">(req, res)</span>
@@ -287,26 +262,26 @@ Alias for <a href="WEBrickAdaptor.html#M000040">handle_request</a>
287
262
 
288
263
  <div class="method-description">
289
264
  <p>
290
- Alias for <a href="WEBrickAdaptor.html#M000040">handle_request</a>
265
+ Alias for <a href="WEBrickAdaptor.html#M000051">handle_request</a>
291
266
  </p>
292
267
  </div>
293
268
  </div>
294
269
 
295
- <div id="method-M000040" class="method-detail">
296
- <a name="M000040"></a>
270
+ <div id="method-M000051" class="method-detail">
271
+ <a name="M000051"></a>
297
272
 
298
273
  <div class="method-heading">
299
- <a href="#M000040" class="method-signature">
274
+ <a href="#M000051" class="method-signature">
300
275
  <span class="method-name">handle_request</span><span class="method-args">(req, res)</span>
301
276
  </a>
302
277
  </div>
303
278
 
304
279
  <div class="method-description">
305
280
  <p><a class="source-toggle" href="#"
306
- onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
307
- <div class="method-source-code" id="M000040-source">
281
+ onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
282
+ <div class="method-source-code" id="M000051-source">
308
283
  <pre>
309
- <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 65</span>
284
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/webrick.rb, line 67</span>
310
285
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_request</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">res</span>)
311
286
  <span class="ruby-identifier">context</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@mount_path</span>, <span class="ruby-identifier">req</span>.<span class="ruby-identifier">path</span>, <span class="ruby-identifier">req</span>.<span class="ruby-identifier">header</span>, <span class="ruby-identifier">req</span>.<span class="ruby-identifier">query</span>))
312
287
  <span class="ruby-ivar">@application</span>.<span class="ruby-identifier">handle_request</span>(<span class="ruby-identifier">context</span>)
@@ -0,0 +1,150 @@
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: Wee::WrapperDecoration</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">Wee::WrapperDecoration</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/wee/components/wrapper_decoration_rb.html">
59
+ lib/wee/components/wrapper_decoration.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Decoration.html">
69
+ Wee::Decoration
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+
84
+
85
+ </div>
86
+
87
+ <div id="method-list">
88
+ <h3 class="section-bar">Methods</h3>
89
+
90
+ <div class="name-list">
91
+ <a href="#M000056">do_render</a>&nbsp;&nbsp;
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-M000056" class="method-detail">
114
+ <a name="M000056"></a>
115
+
116
+ <div class="method-heading">
117
+ <a href="#M000056" class="method-signature">
118
+ <span class="method-name">do_render</span><span class="method-args">(rendering_context)</span>
119
+ </a>
120
+ </div>
121
+
122
+ <div class="method-description">
123
+ <p><a class="source-toggle" href="#"
124
+ onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
125
+ <div class="method-source-code" id="M000056-source">
126
+ <pre>
127
+ <span class="ruby-comment cmt"># File lib/wee/components/wrapper_decoration.rb, line 2</span>
128
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_render</span>(<span class="ruby-identifier">rendering_context</span>)
129
+ <span class="ruby-identifier">with_renderer_for</span>(<span class="ruby-identifier">rendering_context</span>) <span class="ruby-keyword kw">do</span>
130
+ <span class="ruby-identifier">render_wrapper</span> { <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">rendering_context</span>) }
131
+ <span class="ruby-keyword kw">end</span>
132
+ <span class="ruby-keyword kw">end</span>
133
+ </pre>
134
+ </div>
135
+ </div>
136
+ </div>
137
+
138
+
139
+ </div>
140
+
141
+
142
+ </div>
143
+
144
+
145
+ <div id="validator-badges">
146
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
147
+ </div>
148
+
149
+ </body>
150
+ </html>
data/doc/rdoc/created.rid CHANGED
@@ -1 +1 @@
1
- Wed Jan 12 16:54:33 CET 2005
1
+ Wed Jan 26 22:18:42 CET 2005
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Jan 12 16:49:13 CET 2005</td>
59
+ <td>Wed Jan 26 20:20:05 CET 2005</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -81,17 +81,23 @@ licensed under different terms.
81
81
  </p>
82
82
  <h2>Status and Bugs</h2>
83
83
  <p>
84
- <a href="../classes/Wee.html">Wee</a> is not considered production ready!
85
- It should only be used for small things.
84
+ <a href="../classes/Wee.html">Wee</a> is now considered pretty stable (if
85
+ you don&#8217;t use continuations). Nevertheless I wouldn&#8217;t use it
86
+ yet for mission-critical applications ;-)
86
87
  </p>
87
88
  <p>
88
89
  Known Bugs:
89
90
  </p>
90
91
  <ul>
91
- <li>Continuations leak memory!
92
+ <li>Using continuations might leak memory, at least they did in the past. The
92
93
 
93
94
  </li>
94
95
  </ul>
96
+ <p>
97
+ latest memory stress-test has not showed up any memory problems, but since
98
+ I haven&#8217;t changed anything at the continuation implementation, I
99
+ can&#8217;t say for sure whether the problem has been fixed or not.
100
+ </p>
95
101
  <h2>Introduction</h2>
96
102
  <p>
97
103
  <a href="../classes/Wee.html">Wee</a> is a light-weight, very high-level
@@ -163,12 +169,13 @@ array. Items can be any object, e.g. whole components:
163
169
  items = labels.collect {|m| MessageBox.new(m)}
164
170
  r.select_list(items).labels(labels).callback {|choosen| call choosen.first}
165
171
  </pre>
166
- <h3>Continuation based (Optional)</h3>
172
+ <h3>Optional use of Continuations</h3>
167
173
  <p>
168
174
  <b>IMPORTANT:</b> <em>The current implementation of continuations in Ruby
169
- might lead to memory leaks, if you use continuations. Furthermore, if you
170
- use continuations, it&#8217;s no longer possible to store the session state
171
- to disk.</em>
175
+ (or their use in <a href="../classes/Wee.html">Wee</a>) might lead to
176
+ memory leaks, if you use continuations. Furthermore, if you use
177
+ continuations, it&#8217;s no longer possible to store the session state to
178
+ disk.</em>
172
179
  </p>
173
180
  <p>
174
181
  Continuation-based frameworks are also known as <em>modal</em> frameworks.
@@ -191,6 +198,12 @@ emails) where each method displays a new page:
191
198
  Try to implement the same in a non-continuation based framework and show me
192
199
  your code&#8230; ;-)
193
200
  </p>
201
+ <p>
202
+ To enable continuations, you have to require:
203
+ </p>
204
+ <pre>
205
+ require 'wee/continuation'
206
+ </pre>
194
207
  <h3>Fully Marshallable (drops Continuation support)</h3>
195
208
  <p>
196
209
  If you don&#8217;t need continuations, <a
@@ -210,8 +223,9 @@ href="http://www.dragonflybsd.org">DragonFly</a>. But with this approach
210
223
  it&#8217;s still impossible to store sessions <em>selectively</em> to disk.
211
224
 
212
225
  </li>
213
- <li>Each session runs in it&#8217;s own (light-weigth) thread (this is a
214
- neccessity when using continuations).
226
+ <li>When using continuations, each session runs in it&#8217;s own
227
+ (light-weigth) thread. This is not the case if you don&#8217;t use
228
+ continuations.
215
229
 
216
230
  </li>
217
231
  <li>Only one action callback can be invoked per request (a former version of <a
@@ -254,7 +268,7 @@ Decorations are used to modify the look and behaviour of a component,
254
268
  without modifying the components tree. A component can have more than one
255
269
  decoration. This is implemented as a linked list of decorations
256
270
  (Wee::Decoration#owner points to the next decoration). <a
257
- href="../classes/Wee/Component.html#M000179">Wee::Component#decoration</a>
271
+ href="../classes/Wee/Component.html#M000215">Wee::Component#decoration</a>
258
272
  points to the first decoration in the chain or to the component itself, if
259
273
  no decorations were specified. We actually use a <a
260
274
  href="../classes/Wee/ValueHolder.html">Wee::ValueHolder</a> for the
@@ -347,11 +361,11 @@ There are two methods related to callback processing:
347
361
  </p>
348
362
  <ul>
349
363
  <li><a
350
- href="../classes/Wee/Component.html#M000174">Wee::Component#process_callbacks_chain</a>
364
+ href="../classes/Wee/Component.html#M000210">Wee::Component#process_callbacks_chain</a>
351
365
 
352
366
  </li>
353
367
  <li><a
354
- href="../classes/Wee/Presenter.html#M000196">Wee::Presenter#process_callbacks</a>
368
+ href="../classes/Wee/Presenter.html#M000234">Wee::Presenter#process_callbacks</a>
355
369
 
356
370
  </li>
357
371
  </ul>
@@ -388,11 +402,11 @@ a page:
388
402
  </p>
389
403
  <ul>
390
404
  <li><a
391
- href="../classes/Wee/Component.html#M000172">Wee::Component#do_render_chain</a>
405
+ href="../classes/Wee/Component.html#M000208">Wee::Component#do_render_chain</a>
392
406
 
393
407
  </li>
394
408
  <li><a
395
- href="../classes/Wee/Presenter.html#M000191">Wee::Presenter#do_render</a>
409
+ href="../classes/Wee/Presenter.html#M000229">Wee::Presenter#do_render</a>
396
410
 
397
411
  </li>
398
412
  </ul>