wee 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -65,8 +65,8 @@
|
|
65
65
|
<tr class="top-aligned-row">
|
66
66
|
<td><strong>Parent:</strong></td>
|
67
67
|
<td>
|
68
|
-
<a href="
|
69
|
-
Wee::
|
68
|
+
<a href="WrapperDecoration.html">
|
69
|
+
Wee::WrapperDecoration
|
70
70
|
</a>
|
71
71
|
</td>
|
72
72
|
</tr>
|
@@ -88,9 +88,9 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
91
|
+
<a href="#M000251">global?</a>
|
92
|
+
<a href="#M000250">new</a>
|
93
|
+
<a href="#M000252">render_wrapper</a>
|
94
94
|
</div>
|
95
95
|
</div>
|
96
96
|
|
@@ -112,19 +112,19 @@
|
|
112
112
|
<div id="methods">
|
113
113
|
<h3 class="section-bar">Public Class methods</h3>
|
114
114
|
|
115
|
-
<div id="method-
|
116
|
-
<a name="
|
115
|
+
<div id="method-M000250" class="method-detail">
|
116
|
+
<a name="M000250"></a>
|
117
117
|
|
118
118
|
<div class="method-heading">
|
119
|
-
<a href="#
|
119
|
+
<a href="#M000250" class="method-signature">
|
120
120
|
<span class="method-name">new</span><span class="method-args">(title='')</span>
|
121
121
|
</a>
|
122
122
|
</div>
|
123
123
|
|
124
124
|
<div class="method-description">
|
125
125
|
<p><a class="source-toggle" href="#"
|
126
|
-
onclick="toggleCode('
|
127
|
-
<div class="method-source-code" id="
|
126
|
+
onclick="toggleCode('M000250-source');return false;">[Source]</a></p>
|
127
|
+
<div class="method-source-code" id="M000250-source">
|
128
128
|
<pre>
|
129
129
|
<span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 2</span>
|
130
130
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">title</span>=<span class="ruby-value str">''</span>)
|
@@ -138,47 +138,47 @@
|
|
138
138
|
|
139
139
|
<h3 class="section-bar">Public Instance methods</h3>
|
140
140
|
|
141
|
-
<div id="method-
|
142
|
-
<a name="
|
141
|
+
<div id="method-M000251" class="method-detail">
|
142
|
+
<a name="M000251"></a>
|
143
143
|
|
144
144
|
<div class="method-heading">
|
145
|
-
<a href="#
|
146
|
-
<span class="method-name">
|
145
|
+
<a href="#M000251" class="method-signature">
|
146
|
+
<span class="method-name">global?</span><span class="method-args">()</span>
|
147
147
|
</a>
|
148
148
|
</div>
|
149
149
|
|
150
150
|
<div class="method-description">
|
151
151
|
<p><a class="source-toggle" href="#"
|
152
|
-
onclick="toggleCode('
|
153
|
-
<div class="method-source-code" id="
|
152
|
+
onclick="toggleCode('M000251-source');return false;">[Source]</a></p>
|
153
|
+
<div class="method-source-code" id="M000251-source">
|
154
154
|
<pre>
|
155
|
-
<span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line
|
156
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
157
|
-
<span class="ruby-identifier">with_renderer_for</span>(<span class="ruby-identifier">rendering_context</span>) <span class="ruby-keyword kw">do</span>
|
158
|
-
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">page</span>.<span class="ruby-identifier">title</span>(<span class="ruby-ivar">@title</span>).<span class="ruby-identifier">with</span> { <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">rendering_context</span>) }
|
159
|
-
<span class="ruby-keyword kw">end</span>
|
160
|
-
<span class="ruby-keyword kw">end</span>
|
155
|
+
<span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 7</span>
|
156
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">global?</span>() <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">end</span>
|
161
157
|
</pre>
|
162
158
|
</div>
|
163
159
|
</div>
|
164
160
|
</div>
|
165
161
|
|
166
|
-
<
|
167
|
-
|
162
|
+
<h3 class="section-bar">Private Instance methods</h3>
|
163
|
+
|
164
|
+
<div id="method-M000252" class="method-detail">
|
165
|
+
<a name="M000252"></a>
|
168
166
|
|
169
167
|
<div class="method-heading">
|
170
|
-
<a href="#
|
171
|
-
<span class="method-name">
|
168
|
+
<a href="#M000252" class="method-signature">
|
169
|
+
<span class="method-name">render_wrapper</span><span class="method-args">() {|| ...}</span>
|
172
170
|
</a>
|
173
171
|
</div>
|
174
172
|
|
175
173
|
<div class="method-description">
|
176
174
|
<p><a class="source-toggle" href="#"
|
177
|
-
onclick="toggleCode('
|
178
|
-
<div class="method-source-code" id="
|
175
|
+
onclick="toggleCode('M000252-source');return false;">[Source]</a></p>
|
176
|
+
<div class="method-source-code" id="M000252-source">
|
179
177
|
<pre>
|
180
|
-
<span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line
|
181
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
178
|
+
<span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 11</span>
|
179
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_wrapper</span>
|
180
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">page</span>.<span class="ruby-identifier">title</span>(<span class="ruby-ivar">@title</span>).<span class="ruby-identifier">with</span> { <span class="ruby-keyword kw">yield</span> }
|
181
|
+
<span class="ruby-keyword kw">end</span>
|
182
182
|
</pre>
|
183
183
|
</div>
|
184
184
|
</div>
|
@@ -95,10 +95,11 @@ important subclasses.
|
|
95
95
|
<div id="contents-list">
|
96
96
|
<h3 class="section-bar">Contents</h3>
|
97
97
|
<ul>
|
98
|
-
<li><a href="#
|
99
|
-
<li><a href="#
|
100
|
-
<li><a href="#
|
101
|
-
<li><a href="#
|
98
|
+
<li><a href="#SEC00091">Render</a></li>
|
99
|
+
<li><a href="#SEC00092">Callback</a></li>
|
100
|
+
<li><a href="#SEC00093">Backtrack</a></li>
|
101
|
+
<li><a href="#SEC00094">Session</a></li>
|
102
|
+
<li><a href="#SEC00095">Properties</a></li>
|
102
103
|
</ul>
|
103
104
|
</div>
|
104
105
|
|
@@ -106,15 +107,18 @@ important subclasses.
|
|
106
107
|
<h3 class="section-bar">Methods</h3>
|
107
108
|
|
108
109
|
<div class="name-list">
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
113
|
-
<a href="#
|
114
|
-
<a href="#
|
115
|
-
<a href="#
|
116
|
-
<a href="#
|
117
|
-
<a href="#
|
110
|
+
<a href="#M000235">backtrack_state</a>
|
111
|
+
<a href="#M000229">do_render</a>
|
112
|
+
<a href="#M000237">get_property</a>
|
113
|
+
<a href="#M000238">lookup_property</a>
|
114
|
+
<a href="#M000234">process_callbacks</a>
|
115
|
+
<a href="#M000231">r</a>
|
116
|
+
<a href="#M000228">render</a>
|
117
|
+
<a href="#M000230">renderer</a>
|
118
|
+
<a href="#M000233">renderer_class</a>
|
119
|
+
<a href="#M000236">session</a>
|
120
|
+
<a href="#M000239">uses_property</a>
|
121
|
+
<a href="#M000232">with_renderer_for</a>
|
118
122
|
</div>
|
119
123
|
</div>
|
120
124
|
|
@@ -134,7 +138,7 @@ important subclasses.
|
|
134
138
|
|
135
139
|
<!-- if method_list -->
|
136
140
|
<div id="section">
|
137
|
-
<h2 class="section-title"><a name="
|
141
|
+
<h2 class="section-title"><a name="SEC00091">Render</a></h2>
|
138
142
|
<div class="section-comment">
|
139
143
|
|
140
144
|
</div>
|
@@ -150,11 +154,11 @@ important subclasses.
|
|
150
154
|
<div id="methods">
|
151
155
|
<h3 class="section-bar">Public Instance methods</h3>
|
152
156
|
|
153
|
-
<div id="method-
|
154
|
-
<a name="
|
157
|
+
<div id="method-M000229" class="method-detail">
|
158
|
+
<a name="M000229"></a>
|
155
159
|
|
156
160
|
<div class="method-heading">
|
157
|
-
<a href="#
|
161
|
+
<a href="#M000229" class="method-signature">
|
158
162
|
<span class="method-name">do_render</span><span class="method-args">(rendering_context)</span>
|
159
163
|
</a>
|
160
164
|
</div>
|
@@ -166,8 +170,8 @@ overwrite this method, unless you know exactly what you’re doing!
|
|
166
170
|
</p>
|
167
171
|
<p>
|
168
172
|
Creates a new renderer object of the class returned by method <a
|
169
|
-
href="Presenter.html#
|
170
|
-
renderer, then invokes method <a href="Presenter.html#
|
173
|
+
href="Presenter.html#M000233">renderer_class</a>, makes this the current
|
174
|
+
renderer, then invokes method <a href="Presenter.html#M000228">render</a>.
|
171
175
|
</p>
|
172
176
|
<dl>
|
173
177
|
<dt><tt>rendering_context</tt></dt><dd>An object of class <a href="RenderingContext.html">RenderingContext</a>
|
@@ -175,8 +179,8 @@ renderer, then invokes method <a href="Presenter.html#M000190">render</a>.
|
|
175
179
|
</dd>
|
176
180
|
</dl>
|
177
181
|
<p><a class="source-toggle" href="#"
|
178
|
-
onclick="toggleCode('
|
179
|
-
<div class="method-source-code" id="
|
182
|
+
onclick="toggleCode('M000229-source');return false;">[Source]</a></p>
|
183
|
+
<div class="method-source-code" id="M000229-source">
|
180
184
|
<pre>
|
181
185
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 33</span>
|
182
186
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_render</span>(<span class="ruby-identifier">rendering_context</span>)
|
@@ -187,11 +191,11 @@ renderer, then invokes method <a href="Presenter.html#M000190">render</a>.
|
|
187
191
|
</div>
|
188
192
|
</div>
|
189
193
|
|
190
|
-
<div id="method-
|
191
|
-
<a name="
|
194
|
+
<div id="method-M000228" class="method-detail">
|
195
|
+
<a name="M000228"></a>
|
192
196
|
|
193
197
|
<div class="method-heading">
|
194
|
-
<a href="#
|
198
|
+
<a href="#M000228" class="method-signature">
|
195
199
|
<span class="method-name">render</span><span class="method-args">()</span>
|
196
200
|
</a>
|
197
201
|
</div>
|
@@ -206,12 +210,12 @@ view. By default this method does nothing!
|
|
206
210
|
</p>
|
207
211
|
<p>
|
208
212
|
Use the current renderer as returned by <a
|
209
|
-
href="Presenter.html#
|
210
|
-
href="Presenter.html#
|
213
|
+
href="Presenter.html#M000230">renderer</a> or it’s short-cut <a
|
214
|
+
href="Presenter.html#M000231">r</a>.
|
211
215
|
</p>
|
212
216
|
<p><a class="source-toggle" href="#"
|
213
|
-
onclick="toggleCode('
|
214
|
-
<div class="method-source-code" id="
|
217
|
+
onclick="toggleCode('M000228-source');return false;">[Source]</a></p>
|
218
|
+
<div class="method-source-code" id="M000228-source">
|
215
219
|
<pre>
|
216
220
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 20</span>
|
217
221
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>
|
@@ -223,22 +227,22 @@ href="Presenter.html#M000193">r</a>.
|
|
223
227
|
|
224
228
|
<h3 class="section-bar">Protected Instance methods</h3>
|
225
229
|
|
226
|
-
<div id="method-
|
227
|
-
<a name="
|
230
|
+
<div id="method-M000231" class="method-detail">
|
231
|
+
<a name="M000231"></a>
|
228
232
|
|
229
233
|
<div class="method-heading">
|
230
|
-
<a href="#
|
234
|
+
<a href="#M000231" class="method-signature">
|
231
235
|
<span class="method-name">r</span><span class="method-args">()</span>
|
232
236
|
</a>
|
233
237
|
</div>
|
234
238
|
|
235
239
|
<div class="method-description">
|
236
240
|
<p>
|
237
|
-
Short cut for <a href="Presenter.html#
|
241
|
+
Short cut for <a href="Presenter.html#M000230">renderer</a>.
|
238
242
|
</p>
|
239
243
|
<p><a class="source-toggle" href="#"
|
240
|
-
onclick="toggleCode('
|
241
|
-
<div class="method-source-code" id="
|
244
|
+
onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
|
245
|
+
<div class="method-source-code" id="M000231-source">
|
242
246
|
<pre>
|
243
247
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 43</span>
|
244
248
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">r</span>() <span class="ruby-ivar">@renderer</span> <span class="ruby-keyword kw">end</span>
|
@@ -247,11 +251,11 @@ Short cut for <a href="Presenter.html#M000192">renderer</a>.
|
|
247
251
|
</div>
|
248
252
|
</div>
|
249
253
|
|
250
|
-
<div id="method-
|
251
|
-
<a name="
|
254
|
+
<div id="method-M000230" class="method-detail">
|
255
|
+
<a name="M000230"></a>
|
252
256
|
|
253
257
|
<div class="method-heading">
|
254
|
-
<a href="#
|
258
|
+
<a href="#M000230" class="method-signature">
|
255
259
|
<span class="method-name">renderer</span><span class="method-args">()</span>
|
256
260
|
</a>
|
257
261
|
</div>
|
@@ -261,8 +265,8 @@ Short cut for <a href="Presenter.html#M000192">renderer</a>.
|
|
261
265
|
Returns the current renderer object for use by the render methods.
|
262
266
|
</p>
|
263
267
|
<p><a class="source-toggle" href="#"
|
264
|
-
onclick="toggleCode('
|
265
|
-
<div class="method-source-code" id="
|
268
|
+
onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
|
269
|
+
<div class="method-source-code" id="M000230-source">
|
266
270
|
<pre>
|
267
271
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 40</span>
|
268
272
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer</span>() <span class="ruby-ivar">@renderer</span> <span class="ruby-keyword kw">end</span>
|
@@ -271,11 +275,11 @@ Returns the current renderer object for use by the render methods.
|
|
271
275
|
</div>
|
272
276
|
</div>
|
273
277
|
|
274
|
-
<div id="method-
|
275
|
-
<a name="
|
278
|
+
<div id="method-M000233" class="method-detail">
|
279
|
+
<a name="M000233"></a>
|
276
280
|
|
277
281
|
<div class="method-heading">
|
278
|
-
<a href="#
|
282
|
+
<a href="#M000233" class="method-signature">
|
279
283
|
<span class="method-name">renderer_class</span><span class="method-args">()</span>
|
280
284
|
</a>
|
281
285
|
</div>
|
@@ -286,8 +290,8 @@ Returns the class used as renderer for this presenter. Overwrite this
|
|
286
290
|
method if you want to use a different renderer.
|
287
291
|
</p>
|
288
292
|
<p><a class="source-toggle" href="#"
|
289
|
-
onclick="toggleCode('
|
290
|
-
<div class="method-source-code" id="
|
293
|
+
onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
|
294
|
+
<div class="method-source-code" id="M000233-source">
|
291
295
|
<pre>
|
292
296
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 66</span>
|
293
297
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer_class</span>
|
@@ -298,11 +302,11 @@ method if you want to use a different renderer.
|
|
298
302
|
</div>
|
299
303
|
</div>
|
300
304
|
|
301
|
-
<div id="method-
|
302
|
-
<a name="
|
305
|
+
<div id="method-M000232" class="method-detail">
|
306
|
+
<a name="M000232"></a>
|
303
307
|
|
304
308
|
<div class="method-heading">
|
305
|
-
<a href="#
|
309
|
+
<a href="#M000232" class="method-signature">
|
306
310
|
<span class="method-name">with_renderer_for</span><span class="method-args">(rendering_context) {|| ...}</span>
|
307
311
|
</a>
|
308
312
|
</div>
|
@@ -310,14 +314,14 @@ method if you want to use a different renderer.
|
|
310
314
|
<div class="method-description">
|
311
315
|
<p>
|
312
316
|
Creates a new renderer object of the class returned by method <a
|
313
|
-
href="Presenter.html#
|
317
|
+
href="Presenter.html#M000233">renderer_class</a>, then makes this the
|
314
318
|
current renderer for the time the block it yields to executes. Finally, it
|
315
319
|
restores the current renderer to the former one and closes the newly
|
316
320
|
created renderer.
|
317
321
|
</p>
|
318
322
|
<p><a class="source-toggle" href="#"
|
319
|
-
onclick="toggleCode('
|
320
|
-
<div class="method-source-code" id="
|
323
|
+
onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
|
324
|
+
<div class="method-source-code" id="M000232-source">
|
321
325
|
<pre>
|
322
326
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 50</span>
|
323
327
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_renderer_for</span>(<span class="ruby-identifier">rendering_context</span>)
|
@@ -340,7 +344,7 @@ created renderer.
|
|
340
344
|
|
341
345
|
</div>
|
342
346
|
<div id="section">
|
343
|
-
<h2 class="section-title"><a name="
|
347
|
+
<h2 class="section-title"><a name="SEC00092">Callback</a></h2>
|
344
348
|
<div class="section-comment">
|
345
349
|
|
346
350
|
</div>
|
@@ -356,11 +360,11 @@ created renderer.
|
|
356
360
|
<div id="methods">
|
357
361
|
<h3 class="section-bar">Public Instance methods</h3>
|
358
362
|
|
359
|
-
<div id="method-
|
360
|
-
<a name="
|
363
|
+
<div id="method-M000234" class="method-detail">
|
364
|
+
<a name="M000234"></a>
|
361
365
|
|
362
366
|
<div class="method-heading">
|
363
|
-
<a href="#
|
367
|
+
<a href="#M000234" class="method-signature">
|
364
368
|
<span class="method-name">process_callbacks</span><span class="method-args">(callback_stream) {|| ...}</span>
|
365
369
|
</a>
|
366
370
|
</div>
|
@@ -383,8 +387,8 @@ NOTE: Input callbacks should never call other components!
|
|
383
387
|
</dd>
|
384
388
|
</dl>
|
385
389
|
<p><a class="source-toggle" href="#"
|
386
|
-
onclick="toggleCode('
|
387
|
-
<div class="method-source-code" id="
|
390
|
+
onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
|
391
|
+
<div class="method-source-code" id="M000234-source">
|
388
392
|
<pre>
|
389
393
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 87</span>
|
390
394
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_callbacks</span>(<span class="ruby-identifier">callback_stream</span>) <span class="ruby-comment cmt"># :yields:</span>
|
@@ -411,7 +415,7 @@ NOTE: Input callbacks should never call other components!
|
|
411
415
|
|
412
416
|
</div>
|
413
417
|
<div id="section">
|
414
|
-
<h2 class="section-title"><a name="
|
418
|
+
<h2 class="section-title"><a name="SEC00093">Backtrack</a></h2>
|
415
419
|
<div class="section-comment">
|
416
420
|
|
417
421
|
</div>
|
@@ -427,11 +431,11 @@ NOTE: Input callbacks should never call other components!
|
|
427
431
|
<div id="methods">
|
428
432
|
<h3 class="section-bar">Public Instance methods</h3>
|
429
433
|
|
430
|
-
<div id="method-
|
431
|
-
<a name="
|
434
|
+
<div id="method-M000235" class="method-detail">
|
435
|
+
<a name="M000235"></a>
|
432
436
|
|
433
437
|
<div class="method-heading">
|
434
|
-
<a href="#
|
438
|
+
<a href="#M000235" class="method-signature">
|
435
439
|
<span class="method-name">backtrack_state</span><span class="method-args">(snapshot)</span>
|
436
440
|
</a>
|
437
441
|
</div>
|
@@ -439,7 +443,7 @@ NOTE: Input callbacks should never call other components!
|
|
439
443
|
<div class="method-description">
|
440
444
|
<p>
|
441
445
|
Dummy implementation. See <a
|
442
|
-
href="Component.html#
|
446
|
+
href="Component.html#M000222">Component#backtrack_state</a> for more
|
443
447
|
information.
|
444
448
|
</p>
|
445
449
|
<dl>
|
@@ -448,8 +452,8 @@ information.
|
|
448
452
|
</dd>
|
449
453
|
</dl>
|
450
454
|
<p><a class="source-toggle" href="#"
|
451
|
-
onclick="toggleCode('
|
452
|
-
<div class="method-source-code" id="
|
455
|
+
onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
|
456
|
+
<div class="method-source-code" id="M000235-source">
|
453
457
|
<pre>
|
454
458
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 115</span>
|
455
459
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backtrack_state</span>(<span class="ruby-identifier">snapshot</span>)
|
@@ -462,7 +466,7 @@ information.
|
|
462
466
|
|
463
467
|
</div>
|
464
468
|
<div id="section">
|
465
|
-
<h2 class="section-title"><a name="
|
469
|
+
<h2 class="section-title"><a name="SEC00094">Session</a></h2>
|
466
470
|
<div class="section-comment">
|
467
471
|
|
468
472
|
</div>
|
@@ -478,11 +482,11 @@ information.
|
|
478
482
|
<div id="methods">
|
479
483
|
<h3 class="section-bar">Public Instance methods</h3>
|
480
484
|
|
481
|
-
<div id="method-
|
482
|
-
<a name="
|
485
|
+
<div id="method-M000236" class="method-detail">
|
486
|
+
<a name="M000236"></a>
|
483
487
|
|
484
488
|
<div class="method-heading">
|
485
|
-
<a href="#
|
489
|
+
<a href="#M000236" class="method-signature">
|
486
490
|
<span class="method-name">session</span><span class="method-args">()</span>
|
487
491
|
</a>
|
488
492
|
</div>
|
@@ -494,8 +498,8 @@ associated session. The returned object is of class <a
|
|
494
498
|
href="Session.html">Wee::Session</a> or a subclass thereof.
|
495
499
|
</p>
|
496
500
|
<p><a class="source-toggle" href="#"
|
497
|
-
onclick="toggleCode('
|
498
|
-
<div class="method-source-code" id="
|
501
|
+
onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
|
502
|
+
<div class="method-source-code" id="M000236-source">
|
499
503
|
<pre>
|
500
504
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 128</span>
|
501
505
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">session</span>
|
@@ -508,6 +512,170 @@ href="Session.html">Wee::Session</a> or a subclass thereof.
|
|
508
512
|
|
509
513
|
|
510
514
|
</div>
|
515
|
+
<div id="section">
|
516
|
+
<h2 class="section-title"><a name="SEC00095">Properties</a></h2>
|
517
|
+
<div class="section-comment">
|
518
|
+
|
519
|
+
</div>
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
<div id="attribute-list">
|
526
|
+
<h3 class="section-bar">Attributes</h3>
|
527
|
+
|
528
|
+
<div class="name-list">
|
529
|
+
<table>
|
530
|
+
<tr class="top-aligned-row context-row">
|
531
|
+
<td class="context-item-name">properties</td>
|
532
|
+
<td class="context-item-value"> [RW] </td>
|
533
|
+
<td class="context-item-desc"></td>
|
534
|
+
</tr>
|
535
|
+
</table>
|
536
|
+
</div>
|
537
|
+
</div>
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
<!-- if method_list -->
|
542
|
+
<div id="methods">
|
543
|
+
<h3 class="section-bar">Public Class methods</h3>
|
544
|
+
|
545
|
+
<div id="method-M000239" class="method-detail">
|
546
|
+
<a name="M000239"></a>
|
547
|
+
|
548
|
+
<div class="method-heading">
|
549
|
+
<a href="#M000239" class="method-signature">
|
550
|
+
<span class="method-name">uses_property</span><span class="method-args">(*args)</span>
|
551
|
+
</a>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
<div class="method-description">
|
555
|
+
<p>
|
556
|
+
This is currently only used for describing which properties are required by
|
557
|
+
the underlying component.
|
558
|
+
</p>
|
559
|
+
<p><a class="source-toggle" href="#"
|
560
|
+
onclick="toggleCode('M000239-source');return false;">[Source]</a></p>
|
561
|
+
<div class="method-source-code" id="M000239-source">
|
562
|
+
<pre>
|
563
|
+
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 197</span>
|
564
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">uses_property</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
565
|
+
<span class="ruby-keyword kw">end</span>
|
566
|
+
</pre>
|
567
|
+
</div>
|
568
|
+
</div>
|
569
|
+
</div>
|
570
|
+
|
571
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
572
|
+
|
573
|
+
<div id="method-M000237" class="method-detail">
|
574
|
+
<a name="M000237"></a>
|
575
|
+
|
576
|
+
<div class="method-heading">
|
577
|
+
<a href="#M000237" class="method-signature">
|
578
|
+
<span class="method-name">get_property</span><span class="method-args">(prop)</span>
|
579
|
+
</a>
|
580
|
+
</div>
|
581
|
+
|
582
|
+
<div class="method-description">
|
583
|
+
<p>
|
584
|
+
Returns an "owned" property.
|
585
|
+
</p>
|
586
|
+
<p><a class="source-toggle" href="#"
|
587
|
+
onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
|
588
|
+
<div class="method-source-code" id="M000237-source">
|
589
|
+
<pre>
|
590
|
+
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 140</span>
|
591
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>)
|
592
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@properties</span>
|
593
|
+
<span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">prop</span>]
|
594
|
+
<span class="ruby-keyword kw">else</span>
|
595
|
+
<span class="ruby-keyword kw">nil</span>
|
596
|
+
<span class="ruby-keyword kw">end</span>
|
597
|
+
<span class="ruby-keyword kw">end</span>
|
598
|
+
</pre>
|
599
|
+
</div>
|
600
|
+
</div>
|
601
|
+
</div>
|
602
|
+
|
603
|
+
<div id="method-M000238" class="method-detail">
|
604
|
+
<a name="M000238"></a>
|
605
|
+
|
606
|
+
<div class="method-heading">
|
607
|
+
<a href="#M000238" class="method-signature">
|
608
|
+
<span class="method-name">lookup_property</span><span class="method-args">(prop)</span>
|
609
|
+
</a>
|
610
|
+
</div>
|
611
|
+
|
612
|
+
<div class="method-description">
|
613
|
+
<p>
|
614
|
+
Tries to lookup a property from different places. <tt>nil</tt> as property
|
615
|
+
value is not allowed!
|
616
|
+
</p>
|
617
|
+
<p>
|
618
|
+
Search order:
|
619
|
+
</p>
|
620
|
+
<ol>
|
621
|
+
<li>self.get_property(prop)
|
622
|
+
|
623
|
+
</li>
|
624
|
+
<li>session.get_property(prop, self.class)
|
625
|
+
|
626
|
+
</li>
|
627
|
+
<li>application.get_property(prop, self.class)
|
628
|
+
|
629
|
+
</li>
|
630
|
+
<li>session.get_property(prop, nil)
|
631
|
+
|
632
|
+
</li>
|
633
|
+
<li>application.get_property(prop, nil)
|
634
|
+
|
635
|
+
</li>
|
636
|
+
<li>@@properties[prop]
|
637
|
+
|
638
|
+
</li>
|
639
|
+
</ol>
|
640
|
+
<p><a class="source-toggle" href="#"
|
641
|
+
onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
|
642
|
+
<div class="method-source-code" id="M000238-source">
|
643
|
+
<pre>
|
644
|
+
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 166</span>
|
645
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup_property</span>(<span class="ruby-identifier">prop</span>)
|
646
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>)
|
647
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
648
|
+
|
649
|
+
<span class="ruby-identifier">sess</span> = <span class="ruby-identifier">session</span>()
|
650
|
+
<span class="ruby-identifier">app</span> = <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">application</span>
|
651
|
+
<span class="ruby-identifier">klass</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>
|
652
|
+
|
653
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-identifier">klass</span>)
|
654
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
655
|
+
|
656
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-identifier">klass</span>)
|
657
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
658
|
+
|
659
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-keyword kw">nil</span>)
|
660
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
661
|
+
|
662
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-keyword kw">nil</span>)
|
663
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
664
|
+
|
665
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@@properties</span>)
|
666
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-ivar">@@properties</span>[<span class="ruby-identifier">prop</span>]
|
667
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
|
668
|
+
<span class="ruby-keyword kw">end</span>
|
669
|
+
|
670
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
671
|
+
<span class="ruby-keyword kw">end</span>
|
672
|
+
</pre>
|
673
|
+
</div>
|
674
|
+
</div>
|
675
|
+
</div>
|
676
|
+
|
677
|
+
|
678
|
+
</div>
|
511
679
|
|
512
680
|
|
513
681
|
</div>
|