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
@@ -86,12 +86,15 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000113">css_class</a>&nbsp;&nbsp;
90
- <a href="#M000114">id</a>&nbsp;&nbsp;
91
- <a href="#M000115">method_missing</a>&nbsp;&nbsp;
92
- <a href="#M000111">new</a>&nbsp;&nbsp;
93
- <a href="#M000112">type</a>&nbsp;&nbsp;
94
- <a href="#M000116">with</a>&nbsp;&nbsp;
89
+ <a href="#M000127">bool_attr</a>&nbsp;&nbsp;
90
+ <a href="#M000132">css_class</a>&nbsp;&nbsp;
91
+ <a href="#M000134">css_class_for</a>&nbsp;&nbsp;
92
+ <a href="#M000129">html_attr</a>&nbsp;&nbsp;
93
+ <a href="#M000128">html_attr</a>&nbsp;&nbsp;
94
+ <a href="#M000130">method_missing</a>&nbsp;&nbsp;
95
+ <a href="#M000131">new</a>&nbsp;&nbsp;
96
+ <a href="#M000133">onclick_callback</a>&nbsp;&nbsp;
97
+ <a href="#M000135">with</a>&nbsp;&nbsp;
95
98
  </div>
96
99
  </div>
97
100
 
@@ -99,6 +102,13 @@
99
102
 
100
103
 
101
104
  <!-- if includes -->
105
+ <div id="includes">
106
+ <h3 class="section-bar">Included Modules</h3>
107
+
108
+ <div id="includes-list">
109
+ <span class="include-name"><a href="ToCallback.html">Brush::ToCallback</a></span>
110
+ </div>
111
+ </div>
102
112
 
103
113
  <div id="section">
104
114
 
@@ -113,24 +123,87 @@
113
123
  <div id="methods">
114
124
  <h3 class="section-bar">Public Class methods</h3>
115
125
 
116
- <div id="method-M000111" class="method-detail">
117
- <a name="M000111"></a>
126
+ <div id="method-M000127" class="method-detail">
127
+ <a name="M000127"></a>
128
+
129
+ <div class="method-heading">
130
+ <a href="#M000127" class="method-signature">
131
+ <span class="method-name">bool_attr</span><span class="method-args">(*attrs)</span>
132
+ </a>
133
+ </div>
134
+
135
+ <div class="method-description">
136
+ <p><a class="source-toggle" href="#"
137
+ onclick="toggleCode('M000127-source');return false;">[Source]</a></p>
138
+ <div class="method-source-code" id="M000127-source">
139
+ <pre>
140
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 66</span>
141
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bool_attr</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
142
+ <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
143
+ <span class="ruby-identifier">class_eval</span> <span class="ruby-node">&quot;
144
+ def #{ a }(bool=true)
145
+ if bool
146
+ @attributes['#{ a }'] = nil
147
+ else
148
+ @attributes.delete('#{ a }')
149
+ end
150
+ self
151
+ end
152
+ &quot;</span>
153
+ }
154
+ <span class="ruby-keyword kw">end</span>
155
+ </pre>
156
+ </div>
157
+ </div>
158
+ </div>
159
+
160
+ <div id="method-M000128" class="method-detail">
161
+ <a name="M000128"></a>
118
162
 
119
163
  <div class="method-heading">
120
- <a href="#M000111" class="method-signature">
121
- <span class="method-name">new</span><span class="method-args">(tag)</span>
164
+ <a href="#M000128" class="method-signature">
165
+ <span class="method-name">html_attr</span><span class="method-args">(*attrs)</span>
122
166
  </a>
123
167
  </div>
124
168
 
125
169
  <div class="method-description">
126
170
  <p><a class="source-toggle" href="#"
127
- onclick="toggleCode('M000111-source');return false;">[Source]</a></p>
128
- <div class="method-source-code" id="M000111-source">
171
+ onclick="toggleCode('M000128-source');return false;">[Source]</a></p>
172
+ <div class="method-source-code" id="M000128-source">
129
173
  <pre>
130
- <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 51</span>
131
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">tag</span>)
174
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 81</span>
175
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">html_attr</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
176
+ <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
177
+ <span class="ruby-identifier">class_eval</span> <span class="ruby-node">&quot;
178
+ def #{ a }(value)
179
+ html_attr('#{ a }', value)
180
+ end
181
+ &quot;</span>
182
+ }
183
+ <span class="ruby-keyword kw">end</span>
184
+ </pre>
185
+ </div>
186
+ </div>
187
+ </div>
188
+
189
+ <div id="method-M000131" class="method-detail">
190
+ <a name="M000131"></a>
191
+
192
+ <div class="method-heading">
193
+ <a href="#M000131" class="method-signature">
194
+ <span class="method-name">new</span><span class="method-args">(tag, is_single_tag=false)</span>
195
+ </a>
196
+ </div>
197
+
198
+ <div class="method-description">
199
+ <p><a class="source-toggle" href="#"
200
+ onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
201
+ <div class="method-source-code" id="M000131-source">
202
+ <pre>
203
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 108</span>
204
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">is_single_tag</span>=<span class="ruby-keyword kw">false</span>)
132
205
  <span class="ruby-keyword kw">super</span>()
133
- <span class="ruby-ivar">@tag</span> = <span class="ruby-identifier">tag</span>
206
+ <span class="ruby-ivar">@tag</span>, <span class="ruby-ivar">@is_single_tag</span> = <span class="ruby-identifier">tag</span>, <span class="ruby-identifier">is_single_tag</span>
134
207
  <span class="ruby-ivar">@attributes</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
135
208
  <span class="ruby-keyword kw">end</span>
136
209
  </pre>
@@ -140,127 +213,138 @@
140
213
 
141
214
  <h3 class="section-bar">Public Instance methods</h3>
142
215
 
143
- <div id="method-M000113" class="method-detail">
144
- <a name="M000113"></a>
216
+ <div id="method-M000132" class="method-detail">
217
+ <a name="M000132"></a>
145
218
 
146
219
  <div class="method-heading">
147
- <a href="#M000113" class="method-signature">
220
+ <a href="#M000132" class="method-signature">
148
221
  <span class="method-name">css_class</span><span class="method-args">(c)</span>
149
222
  </a>
150
223
  </div>
151
224
 
152
225
  <div class="method-description">
153
226
  <p><a class="source-toggle" href="#"
154
- onclick="toggleCode('M000113-source');return false;">[Source]</a></p>
155
- <div class="method-source-code" id="M000113-source">
227
+ onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
228
+ <div class="method-source-code" id="M000132-source">
156
229
  <pre>
157
- <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 62</span>
230
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 116</span>
158
231
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">css_class</span>(<span class="ruby-identifier">c</span>)
159
- <span class="ruby-ivar">@attributes</span>[<span class="ruby-value str">&quot;class&quot;</span>] = <span class="ruby-identifier">c</span>
160
- <span class="ruby-keyword kw">self</span>
232
+ <span class="ruby-identifier">html_attr</span>(<span class="ruby-value str">&quot;class&quot;</span>, <span class="ruby-identifier">c</span>)
161
233
  <span class="ruby-keyword kw">end</span>
162
234
  </pre>
163
235
  </div>
164
236
  </div>
165
237
  </div>
166
238
 
167
- <div id="method-M000114" class="method-detail">
168
- <a name="M000114"></a>
239
+ <div id="method-M000134" class="method-detail">
240
+ <a name="M000134"></a>
169
241
 
170
242
  <div class="method-heading">
171
- <a href="#M000114" class="method-signature">
172
- <span class="method-name">id</span><span class="method-args">(x)</span>
243
+ <a href="#M000134" class="method-signature">
244
+ <span class="method-name">css_class_for</span><span class="method-args">(c)</span>
173
245
  </a>
174
246
  </div>
175
247
 
176
248
  <div class="method-description">
249
+ <p>
250
+ This method construct the css-class attribute by looking up the property
251
+ from the current component.
252
+ </p>
177
253
  <p><a class="source-toggle" href="#"
178
- onclick="toggleCode('M000114-source');return false;">[Source]</a></p>
179
- <div class="method-source-code" id="M000114-source">
254
+ onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
255
+ <div class="method-source-code" id="M000134-source">
180
256
  <pre>
181
- <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 67</span>
182
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">id</span>(<span class="ruby-identifier">x</span>)
183
- <span class="ruby-ivar">@attributes</span>[<span class="ruby-value str">&quot;id&quot;</span>] = <span class="ruby-identifier">x</span>
184
- <span class="ruby-keyword kw">self</span>
257
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 131</span>
258
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">css_class_for</span>(<span class="ruby-identifier">c</span>)
259
+ <span class="ruby-identifier">prop</span> = <span class="ruby-value str">'css.'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">c</span>
260
+ <span class="ruby-identifier">val</span> = <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">current_component</span>.<span class="ruby-identifier">lookup_property</span>(<span class="ruby-identifier">prop</span>)
261
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;no property found for: &lt;#{ prop }&gt;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">nil?</span>
262
+ <span class="ruby-identifier">css_class</span>(<span class="ruby-identifier">val</span>)
185
263
  <span class="ruby-keyword kw">end</span>
186
264
  </pre>
187
265
  </div>
188
266
  </div>
189
267
  </div>
190
268
 
191
- <div id="method-M000115" class="method-detail">
192
- <a name="M000115"></a>
269
+ <div id="method-M000130" class="method-detail">
270
+ <a name="M000130"></a>
193
271
 
194
272
  <div class="method-heading">
195
- <a href="#M000115" class="method-signature">
196
- <span class="method-name">method_missing</span><span class="method-args">(m, arg)</span>
273
+ <a href="#M000130" class="method-signature">
274
+ <span class="method-name">method_missing</span><span class="method-args">(id, attr)</span>
197
275
  </a>
198
276
  </div>
199
277
 
200
278
  <div class="method-description">
201
279
  <p><a class="source-toggle" href="#"
202
- onclick="toggleCode('M000115-source');return false;">[Source]</a></p>
203
- <div class="method-source-code" id="M000115-source">
280
+ onclick="toggleCode('M000130-source');return false;">[Source]</a></p>
281
+ <div class="method-source-code" id="M000130-source">
204
282
  <pre>
205
- <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 72</span>
206
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">m</span>, <span class="ruby-identifier">arg</span>)
207
- <span class="ruby-ivar">@attributes</span>[<span class="ruby-identifier">m</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_s</span>
208
- <span class="ruby-keyword kw">self</span>
283
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 104</span>
284
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">attr</span>)
285
+ <span class="ruby-identifier">html_attr</span>(<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">attr</span>)
209
286
  <span class="ruby-keyword kw">end</span>
210
287
  </pre>
211
288
  </div>
212
289
  </div>
213
290
  </div>
214
291
 
215
- <div id="method-M000112" class="method-detail">
216
- <a name="M000112"></a>
292
+ <div id="method-M000133" class="method-detail">
293
+ <a name="M000133"></a>
217
294
 
218
295
  <div class="method-heading">
219
- <a href="#M000112" class="method-signature">
220
- <span class="method-name">type</span><span class="method-args">(t)</span>
296
+ <a href="#M000133" class="method-signature">
297
+ <span class="method-name">onclick_callback</span><span class="method-args">(symbol=nil, *args, &amp;block)</span>
221
298
  </a>
222
299
  </div>
223
300
 
224
301
  <div class="method-description">
225
302
  <p><a class="source-toggle" href="#"
226
- onclick="toggleCode('M000112-source');return false;">[Source]</a></p>
227
- <div class="method-source-code" id="M000112-source">
303
+ onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
304
+ <div class="method-source-code" id="M000133-source">
228
305
  <pre>
229
- <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 57</span>
230
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type</span>(<span class="ruby-identifier">t</span>)
231
- <span class="ruby-ivar">@attributes</span>[<span class="ruby-value str">&quot;type&quot;</span>] = <span class="ruby-identifier">t</span>
232
- <span class="ruby-keyword kw">self</span>
306
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 122</span>
307
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">onclick_callback</span>(<span class="ruby-identifier">symbol</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
308
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">symbol</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">block</span>
309
+ <span class="ruby-identifier">url</span> = <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">url_for_callback</span>(<span class="ruby-identifier">to_callback</span>(<span class="ruby-identifier">symbol</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>))
310
+ <span class="ruby-identifier">onclick</span>(<span class="ruby-node">&quot;javascript: document.location.href='#{ url }';&quot;</span>)
233
311
  <span class="ruby-keyword kw">end</span>
234
312
  </pre>
235
313
  </div>
236
314
  </div>
237
315
  </div>
238
316
 
239
- <div id="method-M000116" class="method-detail">
240
- <a name="M000116"></a>
317
+ <div id="method-M000135" class="method-detail">
318
+ <a name="M000135"></a>
241
319
 
242
320
  <div class="method-heading">
243
- <a href="#M000116" class="method-signature">
321
+ <a href="#M000135" class="method-signature">
244
322
  <span class="method-name">with</span><span class="method-args">(text=nil, &amp;block)</span>
245
323
  </a>
246
324
  </div>
247
325
 
248
326
  <div class="method-description">
249
327
  <p><a class="source-toggle" href="#"
250
- onclick="toggleCode('M000116-source');return false;">[Source]</a></p>
251
- <div class="method-source-code" id="M000116-source">
328
+ onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
329
+ <div class="method-source-code" id="M000135-source">
252
330
  <pre>
253
- <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 77</span>
331
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 138</span>
254
332
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>(<span class="ruby-identifier">text</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
255
333
  <span class="ruby-identifier">doc</span> = <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">document</span>
256
- <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">start_tag</span>(<span class="ruby-ivar">@tag</span>, <span class="ruby-ivar">@attributes</span>)
257
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>
258
- <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">text</span>(<span class="ruby-identifier">text</span>)
259
- <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">text</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
334
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@is_single_tag</span>
335
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">block</span>
336
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">single_tag</span>(<span class="ruby-ivar">@tag</span>, <span class="ruby-ivar">@attributes</span>)
337
+ <span class="ruby-ivar">@closed</span> = <span class="ruby-keyword kw">true</span>
260
338
  <span class="ruby-keyword kw">else</span>
261
- <span class="ruby-keyword kw">super</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
339
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">start_tag</span>(<span class="ruby-ivar">@tag</span>, <span class="ruby-ivar">@attributes</span>)
340
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>
341
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">text</span>(<span class="ruby-identifier">text</span>)
342
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">text</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
343
+ <span class="ruby-keyword kw">else</span>
344
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
345
+ <span class="ruby-keyword kw">end</span>
346
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-ivar">@tag</span>)
262
347
  <span class="ruby-keyword kw">end</span>
263
- <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-ivar">@tag</span>)
264
348
  <span class="ruby-keyword kw">nil</span>
265
349
  <span class="ruby-keyword kw">end</span>
266
350
  </pre>
@@ -268,6 +352,36 @@
268
352
  </div>
269
353
  </div>
270
354
 
355
+ <h3 class="section-bar">Private Instance methods</h3>
356
+
357
+ <div id="method-M000129" class="method-detail">
358
+ <a name="M000129"></a>
359
+
360
+ <div class="method-heading">
361
+ <a href="#M000129" class="method-signature">
362
+ <span class="method-name">html_attr</span><span class="method-args">(attr, value)</span>
363
+ </a>
364
+ </div>
365
+
366
+ <div class="method-description">
367
+ <p><a class="source-toggle" href="#"
368
+ onclick="toggleCode('M000129-source');return false;">[Source]</a></p>
369
+ <div class="method-source-code" id="M000129-source">
370
+ <pre>
371
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 93</span>
372
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">html_attr</span>(<span class="ruby-identifier">attr</span>, <span class="ruby-identifier">value</span>)
373
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
374
+ <span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">attr</span>)
375
+ <span class="ruby-keyword kw">else</span>
376
+ <span class="ruby-ivar">@attributes</span>[<span class="ruby-identifier">attr</span>] = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>
377
+ <span class="ruby-keyword kw">end</span>
378
+ <span class="ruby-keyword kw">self</span>
379
+ <span class="ruby-keyword kw">end</span>
380
+ </pre>
381
+ </div>
382
+ </div>
383
+ </div>
384
+
271
385
 
272
386
  </div>
273
387
 
@@ -86,8 +86,8 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000092">new</a>&nbsp;&nbsp;
90
- <a href="#M000093">with</a>&nbsp;&nbsp;
89
+ <a href="#M000106">new</a>&nbsp;&nbsp;
90
+ <a href="#M000107">with</a>&nbsp;&nbsp;
91
91
  </div>
92
92
  </div>
93
93
 
@@ -109,19 +109,19 @@
109
109
  <div id="methods">
110
110
  <h3 class="section-bar">Public Class methods</h3>
111
111
 
112
- <div id="method-M000092" class="method-detail">
113
- <a name="M000092"></a>
112
+ <div id="method-M000106" class="method-detail">
113
+ <a name="M000106"></a>
114
114
 
115
115
  <div class="method-heading">
116
- <a href="#M000092" class="method-signature">
116
+ <a href="#M000106" class="method-signature">
117
117
  <span class="method-name">new</span><span class="method-args">(text)</span>
118
118
  </a>
119
119
  </div>
120
120
 
121
121
  <div class="method-description">
122
122
  <p><a class="source-toggle" href="#"
123
- onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
124
- <div class="method-source-code" id="M000092-source">
123
+ onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
124
+ <div class="method-source-code" id="M000106-source">
125
125
  <pre>
126
126
  <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 23</span>
127
127
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">text</span>)
@@ -135,19 +135,19 @@
135
135
 
136
136
  <h3 class="section-bar">Public Instance methods</h3>
137
137
 
138
- <div id="method-M000093" class="method-detail">
139
- <a name="M000093"></a>
138
+ <div id="method-M000107" class="method-detail">
139
+ <a name="M000107"></a>
140
140
 
141
141
  <div class="method-heading">
142
- <a href="#M000093" class="method-signature">
142
+ <a href="#M000107" class="method-signature">
143
143
  <span class="method-name">with</span><span class="method-args">()</span>
144
144
  </a>
145
145
  </div>
146
146
 
147
147
  <div class="method-description">
148
148
  <p><a class="source-toggle" href="#"
149
- onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
150
- <div class="method-source-code" id="M000093-source">
149
+ onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
150
+ <div class="method-source-code" id="M000107-source">
151
151
  <pre>
152
152
  <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 28</span>
153
153
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>
@@ -65,9 +65,7 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
- <a href="InputTag.html">
69
- Wee::Brush::InputTag
70
- </a>
68
+ Brush::InputTag
71
69
  </td>
72
70
  </tr>
73
71
  </table>
@@ -87,7 +85,7 @@ Most browsers do not send the &quot;name&quot; key together with the value
87
85
  specified by &quot;value&quot;, only &quot;name.x&quot; and
88
86
  &quot;name.y&quot;. This conforms to the standard. But Firefox also sends
89
87
  &quot;name&quot;=&quot;value&quot;. This is why I raise an exception from
90
- the <a href="ImageButtonTag.html#M000118">value</a> method. Note that
88
+ the <a href="ImageButtonTag.html#M000137">value</a> method. Note that
91
89
  it&#8217;s neccessary to parse the passed form-fields and generate a
92
90
  &quot;name&quot; fields in the request, to make this image-button work.
93
91
  </p>
@@ -101,8 +99,8 @@ it&#8217;s neccessary to parse the passed form-fields and generate a
101
99
  <h3 class="section-bar">Methods</h3>
102
100
 
103
101
  <div class="name-list">
104
- <a href="#M000117">new</a>&nbsp;&nbsp;
105
- <a href="#M000118">value</a>&nbsp;&nbsp;
102
+ <a href="#M000136">new</a>&nbsp;&nbsp;
103
+ <a href="#M000137">value</a>&nbsp;&nbsp;
106
104
  </div>
107
105
  </div>
108
106
 
@@ -131,21 +129,21 @@ it&#8217;s neccessary to parse the passed form-fields and generate a
131
129
  <div id="methods">
132
130
  <h3 class="section-bar">Public Class methods</h3>
133
131
 
134
- <div id="method-M000117" class="method-detail">
135
- <a name="M000117"></a>
132
+ <div id="method-M000136" class="method-detail">
133
+ <a name="M000136"></a>
136
134
 
137
135
  <div class="method-heading">
138
- <a href="#M000117" class="method-signature">
136
+ <a href="#M000136" class="method-signature">
139
137
  <span class="method-name">new</span><span class="method-args">()</span>
140
138
  </a>
141
139
  </div>
142
140
 
143
141
  <div class="method-description">
144
142
  <p><a class="source-toggle" href="#"
145
- onclick="toggleCode('M000117-source');return false;">[Source]</a></p>
146
- <div class="method-source-code" id="M000117-source">
143
+ onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
144
+ <div class="method-source-code" id="M000136-source">
147
145
  <pre>
148
- <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 324</span>
146
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 417</span>
149
147
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
150
148
  <span class="ruby-keyword kw">super</span>
151
149
  <span class="ruby-identifier">type</span>(<span class="ruby-value str">'image'</span>)
@@ -157,21 +155,21 @@ it&#8217;s neccessary to parse the passed form-fields and generate a
157
155
 
158
156
  <h3 class="section-bar">Public Instance methods</h3>
159
157
 
160
- <div id="method-M000118" class="method-detail">
161
- <a name="M000118"></a>
158
+ <div id="method-M000137" class="method-detail">
159
+ <a name="M000137"></a>
162
160
 
163
161
  <div class="method-heading">
164
- <a href="#M000118" class="method-signature">
162
+ <a href="#M000137" class="method-signature">
165
163
  <span class="method-name">value</span><span class="method-args">(v)</span>
166
164
  </a>
167
165
  </div>
168
166
 
169
167
  <div class="method-description">
170
168
  <p><a class="source-toggle" href="#"
171
- onclick="toggleCode('M000118-source');return false;">[Source]</a></p>
172
- <div class="method-source-code" id="M000118-source">
169
+ onclick="toggleCode('M000137-source');return false;">[Source]</a></p>
170
+ <div class="method-source-code" id="M000137-source">
173
171
  <pre>
174
- <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 329</span>
172
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 422</span>
175
173
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">value</span>(<span class="ruby-identifier">v</span>)
176
174
  <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;specified value will not be used in the request&quot;</span>
177
175
  <span class="ruby-keyword kw">end</span>