wee 0.4.0 → 0.5.0
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.
- data/ChangeLog +75 -0
- data/README +17 -9
- data/Rakefile +2 -2
- data/TODO +20 -0
- data/benchmark/Makefile +14 -9
- data/benchmark/counter.rb +11 -30
- data/benchmark/report_req.rb +12 -0
- data/doc/rdoc/classes/Array.html +12 -12
- data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
- data/doc/rdoc/classes/Enumerable.html +6 -6
- data/doc/rdoc/classes/Object.html +12 -12
- data/doc/rdoc/classes/OgApplication.html +126 -0
- data/doc/rdoc/classes/OgScaffolder.html +401 -0
- data/doc/rdoc/classes/OgSession.html +172 -0
- data/doc/rdoc/classes/String.html +12 -12
- data/doc/rdoc/classes/Struct.html +12 -12
- data/doc/rdoc/classes/Wee.html +5 -62
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +9 -9
- data/doc/rdoc/classes/Wee/Application.html +107 -39
- data/doc/rdoc/classes/Wee/Brush.html +22 -18
- data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +17 -11
- data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +18 -10
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +30 -64
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +8 -10
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +27 -79
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +146 -0
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +179 -65
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +16 -18
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +203 -0
- data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +17 -11
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +15 -15
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +147 -0
- data/doc/rdoc/classes/Wee/Brush/Page.html +17 -17
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +25 -50
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -38
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +15 -16
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +65 -50
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +14 -64
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/ToCallback.html +146 -0
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +40 -40
- data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
- data/doc/rdoc/classes/Wee/Canvas.html +24 -24
- data/doc/rdoc/classes/Wee/Component.html +232 -149
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +153 -0
- data/doc/rdoc/classes/Wee/Decoration.html +42 -42
- data/doc/rdoc/classes/Wee/Delegate.html +27 -27
- data/doc/rdoc/classes/Wee/ErrorResponse.html +12 -12
- data/doc/rdoc/classes/Wee/FormDecoration.html +148 -0
- data/doc/rdoc/classes/Wee/GenericResponse.html +6 -6
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +296 -215
- data/doc/rdoc/classes/Wee/HtmlWriter.html +83 -81
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +21 -16
- data/doc/rdoc/classes/Wee/MessageBox.html +180 -0
- data/doc/rdoc/classes/Wee/PageDecoration.html +30 -30
- data/doc/rdoc/classes/Wee/Presenter.html +237 -69
- data/doc/rdoc/classes/Wee/RedirectResponse.html +6 -6
- data/doc/rdoc/classes/Wee/RefreshResponse.html +6 -6
- data/doc/rdoc/classes/Wee/Request.html +18 -18
- data/doc/rdoc/classes/Wee/RequestHandler.html +43 -39
- data/doc/rdoc/classes/Wee/Response.html +24 -24
- data/doc/rdoc/classes/Wee/Session.html +746 -72
- data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +18 -18
- data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
- data/doc/rdoc/classes/Wee/Utils.html +138 -2
- data/doc/rdoc/classes/Wee/Utils/LRUCache.html +7 -7
- data/doc/rdoc/classes/Wee/ValueHolder.html +18 -18
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +43 -68
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +150 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +29 -15
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components_rb.html +4 -1
- data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +110 -0
- data/doc/rdoc/files/lib/wee/continuation_rb.html +116 -0
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core_rb.html +3 -3
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/session_rb.html +1 -2
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -8
- data/doc/rdoc/files/lib/wee/utils_rb.html +110 -0
- data/doc/rdoc/files/lib/wee_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +11 -1
- data/doc/rdoc/fr_file_index.html +8 -0
- data/doc/rdoc/fr_method_index.html +269 -228
- data/examples/calculator.rb +69 -0
- data/examples/calendar.rb +5 -17
- data/examples/example.rb +2 -2
- data/examples/hw.rb +17 -0
- data/examples/live-update.rb +45 -0
- data/examples/og-test.rb +51 -0
- data/lib/wee.rb +1 -1
- data/lib/wee/adaptors/webrick.rb +2 -0
- data/lib/wee/application.rb +16 -0
- data/lib/wee/components.rb +3 -0
- data/lib/wee/components/form_decoration.rb +7 -0
- data/{test → lib/wee}/components/messagebox.rb +1 -1
- data/lib/wee/components/page_decoration.rb +5 -5
- data/lib/wee/components/wrapper_decoration.rb +7 -0
- data/lib/wee/continuation.rb +5 -0
- data/lib/wee/continuation/core/component.rb +55 -0
- data/lib/wee/continuation/session.rb +217 -0
- data/lib/wee/core/callback.rb +11 -6
- data/lib/wee/core/component.rb +45 -33
- data/lib/wee/core/presenter.rb +68 -0
- data/lib/wee/databases/og.rb +114 -0
- data/lib/wee/renderer/html/brushes.rb +179 -98
- data/lib/wee/renderer/html/canvas.rb +37 -13
- data/lib/wee/renderer/html/writer.rb +34 -32
- data/lib/wee/requesthandler.rb +6 -3
- data/lib/wee/session.rb +73 -54
- data/lib/wee/utils.rb +5 -0
- data/lib/wee/utils/autoreload.rb +1 -1
- data/lib/wee/utils/cache.rb +0 -2
- data/lib/wee/utils/helper.rb +40 -8
- data/test/components/calltest-cont.rb +16 -0
- data/test/components/calltest.rb +15 -10
- data/test/stress.rb +31 -28
- data/test/stress_and_measure.rb +53 -0
- data/test/stressed_application.rb +15 -0
- data/test/test_html_writer.rb +9 -4
- metadata +236 -195
- 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 => 2000)
|
|
88
|
-
s.mount '/app', Wee::WEBrickAdaptor, application
|
|
89
|
-
|
|
90
|
-
trap("INT") { 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' => application).
|
|
100
|
-
register('/cnt' => application2).
|
|
101
|
-
mount('/', WEBrick::HTTPServlet::FileHandler, '.').
|
|
102
|
-
start(:Port => 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="#
|
|
115
|
-
<a href="#
|
|
116
|
-
<a href="#
|
|
117
|
-
<a href="#
|
|
118
|
-
<a href="#
|
|
119
|
-
<a href="#
|
|
120
|
-
<a href="#
|
|
89
|
+
<a href="#M000052">do_GET</a>
|
|
90
|
+
<a href="#M000053">do_POST</a>
|
|
91
|
+
<a href="#M000051">handle_request</a>
|
|
92
|
+
<a href="#M000049">mount</a>
|
|
93
|
+
<a href="#M000050">new</a>
|
|
94
|
+
<a href="#M000048">register</a>
|
|
95
|
+
<a href="#M000047">start</a>
|
|
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-
|
|
143
|
-
<a name="
|
|
117
|
+
<div id="method-M000049" class="method-detail">
|
|
118
|
+
<a name="M000049"></a>
|
|
144
119
|
|
|
145
120
|
<div class="method-heading">
|
|
146
|
-
<a href="#
|
|
121
|
+
<a href="#M000049" class="method-signature">
|
|
147
122
|
<span class="method-name">mount</span><span class="method-args">(*args, &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('
|
|
157
|
-
<div class="method-source-code" id="
|
|
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
|
|
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">&</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"><<</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-
|
|
171
|
-
<a name="
|
|
145
|
+
<div id="method-M000050" class="method-detail">
|
|
146
|
+
<a name="M000050"></a>
|
|
172
147
|
|
|
173
148
|
<div class="method-heading">
|
|
174
|
-
<a href="#
|
|
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('
|
|
182
|
-
<div class="method-source-code" id="
|
|
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
|
|
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-
|
|
196
|
-
<a name="
|
|
170
|
+
<div id="method-M000048" class="method-detail">
|
|
171
|
+
<a name="M000048"></a>
|
|
197
172
|
|
|
198
173
|
<div class="method-heading">
|
|
199
|
-
<a href="#
|
|
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('
|
|
210
|
-
<div class="method-source-code" id="
|
|
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
|
|
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-
|
|
226
|
-
<a name="
|
|
200
|
+
<div id="method-M000047" class="method-detail">
|
|
201
|
+
<a name="M000047"></a>
|
|
227
202
|
|
|
228
203
|
<div class="method-heading">
|
|
229
|
-
<a href="#
|
|
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('
|
|
240
|
-
<div class="method-source-code" id="
|
|
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
|
|
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">></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">"INT"</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-
|
|
268
|
-
<a name="
|
|
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#
|
|
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-
|
|
282
|
-
<a name="
|
|
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#
|
|
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-
|
|
296
|
-
<a name="
|
|
270
|
+
<div id="method-M000051" class="method-detail">
|
|
271
|
+
<a name="M000051"></a>
|
|
297
272
|
|
|
298
273
|
<div class="method-heading">
|
|
299
|
-
<a href="#
|
|
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('
|
|
307
|
-
<div class="method-source-code" id="
|
|
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
|
|
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>
|
|
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
|
|
1
|
+
Wed Jan 26 22:18:42 CET 2005
|
data/doc/rdoc/files/README.html
CHANGED
|
@@ -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
|
|
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
|
|
85
|
-
|
|
84
|
+
<a href="../classes/Wee.html">Wee</a> is now considered pretty stable (if
|
|
85
|
+
you don’t use continuations). Nevertheless I wouldn’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>
|
|
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’t changed anything at the continuation implementation, I
|
|
99
|
+
can’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>
|
|
172
|
+
<h3>Optional use of Continuations</h3>
|
|
167
173
|
<p>
|
|
168
174
|
<b>IMPORTANT:</b> <em>The current implementation of continuations in Ruby
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
to
|
|
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’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… ;-)
|
|
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’t need continuations, <a
|
|
@@ -210,8 +223,9 @@ href="http://www.dragonflybsd.org">DragonFly</a>. But with this approach
|
|
|
210
223
|
it’s still impossible to store sessions <em>selectively</em> to disk.
|
|
211
224
|
|
|
212
225
|
</li>
|
|
213
|
-
<li>
|
|
214
|
-
|
|
226
|
+
<li>When using continuations, each session runs in it’s own
|
|
227
|
+
(light-weigth) thread. This is not the case if you don’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#
|
|
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#
|
|
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#
|
|
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#
|
|
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#
|
|
409
|
+
href="../classes/Wee/Presenter.html#M000229">Wee::Presenter#do_render</a>
|
|
396
410
|
|
|
397
411
|
</li>
|
|
398
412
|
</ul>
|