wee 0.1.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. data/INSTALL +7 -0
  2. data/README +268 -0
  3. data/Rakefile +26 -0
  4. data/TODO +116 -0
  5. data/benchmark/Centrino1300/result.2000.counter.action +45 -0
  6. data/benchmark/Centrino1300/result.2000.counter.render +43 -0
  7. data/benchmark/Centrino1300/result.2000.filehandler +43 -0
  8. data/benchmark/Centrino600/result.2000.counter.action +47 -0
  9. data/benchmark/Centrino600/result.2000.counter.render +45 -0
  10. data/benchmark/Centrino600/result.2000.filehandler +43 -0
  11. data/benchmark/Makefile +48 -0
  12. data/benchmark/bench.sh +24 -0
  13. data/benchmark/counter.rb +96 -0
  14. data/benchmark/filehandler.rb +6 -0
  15. data/doc/rdoc/classes/Array.html +172 -0
  16. data/doc/rdoc/classes/Cache.html +126 -0
  17. data/doc/rdoc/classes/Cache/StorageCache.html +320 -0
  18. data/doc/rdoc/classes/Cache/Strategy.html +128 -0
  19. data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +269 -0
  20. data/doc/rdoc/classes/Cache/Strategy/LFU.html +238 -0
  21. data/doc/rdoc/classes/Cache/Strategy/LFU/Item.html +111 -0
  22. data/doc/rdoc/classes/Cache/Strategy/LRU.html +238 -0
  23. data/doc/rdoc/classes/Cache/Strategy/LRU/Item.html +111 -0
  24. data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +225 -0
  25. data/doc/rdoc/classes/Cache/Strategy/Unbounded/Item.html +111 -0
  26. data/doc/rdoc/classes/Enumerable.html +146 -0
  27. data/doc/rdoc/classes/LiteralMethod.html +196 -0
  28. data/doc/rdoc/classes/Object.html +178 -0
  29. data/doc/rdoc/classes/String.html +172 -0
  30. data/doc/rdoc/classes/Struct.html +174 -0
  31. data/doc/rdoc/classes/Wee.html +160 -0
  32. data/doc/rdoc/classes/Wee/AnswerDecoration.html +182 -0
  33. data/doc/rdoc/classes/Wee/Application.html +337 -0
  34. data/doc/rdoc/classes/Wee/Brush.html +245 -0
  35. data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +149 -0
  36. data/doc/rdoc/classes/Wee/Brush/ActionMixin.html +146 -0
  37. data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +157 -0
  38. data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +210 -0
  39. data/doc/rdoc/classes/Wee/Brush/AssignMixin.html +141 -0
  40. data/doc/rdoc/classes/Wee/Brush/CallbackMixin.html +141 -0
  41. data/doc/rdoc/classes/Wee/Brush/FormTag.html +225 -0
  42. data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +176 -0
  43. data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +283 -0
  44. data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +176 -0
  45. data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +195 -0
  46. data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +149 -0
  47. data/doc/rdoc/classes/Wee/Brush/InputTag.html +172 -0
  48. data/doc/rdoc/classes/Wee/Brush/Page.html +193 -0
  49. data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +267 -0
  50. data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +177 -0
  51. data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +154 -0
  52. data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +173 -0
  53. data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +146 -0
  54. data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +277 -0
  55. data/doc/rdoc/classes/Wee/Brush/TableTag.html +146 -0
  56. data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +229 -0
  57. data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +154 -0
  58. data/doc/rdoc/classes/Wee/Callback.html +231 -0
  59. data/doc/rdoc/classes/Wee/CallbackRegistry.html +308 -0
  60. data/doc/rdoc/classes/Wee/CallbackStream.html +227 -0
  61. data/doc/rdoc/classes/Wee/Canvas.html +235 -0
  62. data/doc/rdoc/classes/Wee/Component.html +933 -0
  63. data/doc/rdoc/classes/Wee/Context.html +111 -0
  64. data/doc/rdoc/classes/Wee/Decoration.html +338 -0
  65. data/doc/rdoc/classes/Wee/Delegate.html +247 -0
  66. data/doc/rdoc/classes/Wee/ErrorPage.html +175 -0
  67. data/doc/rdoc/classes/Wee/ErrorResponse.html +180 -0
  68. data/doc/rdoc/classes/Wee/GenericResponse.html +162 -0
  69. data/doc/rdoc/classes/Wee/HtmlCanvas.html +751 -0
  70. data/doc/rdoc/classes/Wee/HtmlWriter.html +351 -0
  71. data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +180 -0
  72. data/doc/rdoc/classes/Wee/MethodCallback.html +193 -0
  73. data/doc/rdoc/classes/Wee/Page.html +111 -0
  74. data/doc/rdoc/classes/Wee/Presenter.html +521 -0
  75. data/doc/rdoc/classes/Wee/RedirectResponse.html +150 -0
  76. data/doc/rdoc/classes/Wee/RefreshResponse.html +157 -0
  77. data/doc/rdoc/classes/Wee/RenderingContext.html +111 -0
  78. data/doc/rdoc/classes/Wee/Request.html +268 -0
  79. data/doc/rdoc/classes/Wee/RequestHandler.html +336 -0
  80. data/doc/rdoc/classes/Wee/Response.html +260 -0
  81. data/doc/rdoc/classes/Wee/Session.html +469 -0
  82. data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +198 -0
  83. data/doc/rdoc/classes/Wee/Snapshot.html +211 -0
  84. data/doc/rdoc/classes/Wee/StateHolder.html +149 -0
  85. data/doc/rdoc/classes/Wee/StateRegistry.html +434 -0
  86. data/doc/rdoc/classes/Wee/StateRegistry/Snapshot.html +320 -0
  87. data/doc/rdoc/classes/Wee/StateRegistry/WithObject.html +153 -0
  88. data/doc/rdoc/classes/Wee/Utils.html +111 -0
  89. data/doc/rdoc/classes/Wee/Utils/LRUCache.html +148 -0
  90. data/doc/rdoc/classes/Wee/ValueHolder.html +220 -0
  91. data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +330 -0
  92. data/doc/rdoc/created.rid +1 -0
  93. data/doc/rdoc/files/INSTALL.html +118 -0
  94. data/doc/rdoc/files/README.html +466 -0
  95. data/doc/rdoc/files/lib/cache/cache_rb.html +101 -0
  96. data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +108 -0
  97. data/doc/rdoc/files/lib/wee/application_rb.html +112 -0
  98. data/doc/rdoc/files/lib/wee/callback_rb.html +107 -0
  99. data/doc/rdoc/files/lib/wee/component_ext_rb.html +101 -0
  100. data/doc/rdoc/files/lib/wee/component_rb.html +109 -0
  101. data/doc/rdoc/files/lib/wee/context_rb.html +101 -0
  102. data/doc/rdoc/files/lib/wee/core/callback_rb.html +115 -0
  103. data/doc/rdoc/files/lib/wee/core/component_rb.html +108 -0
  104. data/doc/rdoc/files/lib/wee/core/decoration_rb.html +133 -0
  105. data/doc/rdoc/files/lib/wee/core/presenter_rb.html +112 -0
  106. data/doc/rdoc/files/lib/wee/core/snapshot_rb.html +113 -0
  107. data/doc/rdoc/files/lib/wee/core/valueholder_rb.html +110 -0
  108. data/doc/rdoc/files/lib/wee/core_rb.html +131 -0
  109. data/doc/rdoc/files/lib/wee/decoration_rb.html +101 -0
  110. data/doc/rdoc/files/lib/wee/holder_rb.html +101 -0
  111. data/doc/rdoc/files/lib/wee/html_canvas_rb.html +108 -0
  112. data/doc/rdoc/files/lib/wee/html_writer_rb.html +108 -0
  113. data/doc/rdoc/files/lib/wee/idgen_rb.html +101 -0
  114. data/doc/rdoc/files/lib/wee/page_rb.html +101 -0
  115. data/doc/rdoc/files/lib/wee/presenter_rb.html +112 -0
  116. data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +101 -0
  117. data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +101 -0
  118. data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +108 -0
  119. data/doc/rdoc/files/lib/wee/rendering/html/brushes_rb.html +101 -0
  120. data/doc/rdoc/files/lib/wee/rendering/html/canvas_rb.html +101 -0
  121. data/doc/rdoc/files/lib/wee/rendering/html/writer_rb.html +108 -0
  122. data/doc/rdoc/files/lib/wee/request_rb.html +113 -0
  123. data/doc/rdoc/files/lib/wee/requesthandler_rb.html +101 -0
  124. data/doc/rdoc/files/lib/wee/response_rb.html +108 -0
  125. data/doc/rdoc/files/lib/wee/session_rb.html +109 -0
  126. data/doc/rdoc/files/lib/wee/snapshot_ext_rb.html +101 -0
  127. data/doc/rdoc/files/lib/wee/snapshot_rb.html +107 -0
  128. data/doc/rdoc/files/lib/wee/state_registry_rb.html +110 -0
  129. data/doc/rdoc/files/lib/wee/stuff_rb.html +144 -0
  130. data/doc/rdoc/files/lib/wee/utils/cache_rb.html +108 -0
  131. data/doc/rdoc/files/lib/wee/webrick_rb.html +108 -0
  132. data/doc/rdoc/files/lib/wee_rb.html +132 -0
  133. data/doc/rdoc/fr_class_index.html +93 -0
  134. data/doc/rdoc/fr_file_index.html +51 -0
  135. data/doc/rdoc/fr_method_index.html +242 -0
  136. data/doc/rdoc/index.html +24 -0
  137. data/doc/rdoc/rdoc-style.css +208 -0
  138. data/examples/ObjectSpaceBrowser.rb +199 -0
  139. data/examples/calendar.rb +366 -0
  140. data/examples/cc.rb +94 -0
  141. data/examples/draw.rb +91 -0
  142. data/examples/example.rb +223 -0
  143. data/examples/test.rb +66 -0
  144. data/examples/window.rb +53 -0
  145. data/lib/cache/cache.rb +9 -0
  146. data/lib/wee.rb +18 -8
  147. data/lib/wee/adaptors/webrick.rb +73 -0
  148. data/lib/wee/application.rb +69 -71
  149. data/lib/wee/context.rb +2 -12
  150. data/lib/wee/core.rb +15 -0
  151. data/lib/wee/core/callback.rb +108 -0
  152. data/lib/wee/core/component.rb +314 -0
  153. data/lib/wee/core/decoration.rb +129 -0
  154. data/lib/wee/core/presenter.rb +132 -0
  155. data/lib/wee/core/snapshot.rb +21 -0
  156. data/lib/wee/core/valueholder.rb +19 -0
  157. data/lib/wee/idgen.rb +13 -0
  158. data/lib/wee/page.rb +1 -1
  159. data/lib/wee/renderer/html/brushes.rb +435 -0
  160. data/lib/wee/renderer/html/canvas.rb +148 -0
  161. data/lib/wee/{html_writer.rb → renderer/html/writer.rb} +31 -16
  162. data/lib/wee/request.rb +57 -0
  163. data/lib/wee/requesthandler.rb +77 -0
  164. data/lib/wee/response.rb +77 -0
  165. data/lib/wee/session.rb +70 -64
  166. data/lib/wee/{snapshot.rb → snapshot_ext.rb} +4 -4
  167. data/test/components/calltest.rb +16 -0
  168. data/test/components/counter.rb +17 -0
  169. data/test/components/messagebox.rb +15 -0
  170. data/test/components/page.rb +14 -0
  171. data/test/components/page_decoration.rb +7 -0
  172. data/test/stress.rb +64 -0
  173. data/test/test_component.rb +106 -0
  174. data/test/test_html_canvas.rb +25 -0
  175. data/test/test_html_writer.rb +27 -0
  176. data/test/test_request.rb +13 -0
  177. data/test/utils/cross.rb +65 -0
  178. data/test/utils/generic_plotter.rb +28 -0
  179. data/test/utils/gnuplot.rb +31 -0
  180. data/test/utils/measure_memory.rb +9 -0
  181. data/test/utils/memory_plotter.rb +10 -0
  182. data/test/utils/object_plotter.rb +10 -0
  183. data/test/utils/webrick_background.rb +31 -0
  184. data/wee.gemspec +22 -0
  185. metadata +222 -18
  186. data/lib/wee/component.rb +0 -126
  187. data/lib/wee/delegate_decoration.rb +0 -22
  188. data/lib/wee/handler_registry.rb +0 -89
  189. data/lib/wee/holder.rb +0 -14
  190. data/lib/wee/html_canvas.rb +0 -379
  191. data/lib/wee/state_registry.rb +0 -173
  192. data/lib/wee/stuff.rb +0 -29
  193. data/lib/wee/webrick.rb +0 -15
@@ -0,0 +1,172 @@
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::Brush::InputTag</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::Brush::InputTag</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/wee/renderer/html/brushes_rb.html">
59
+ lib/wee/renderer/html/brushes.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
+ Brush::GenericTagBrush
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="method-list">
86
+ <h3 class="section-bar">Methods</h3>
87
+
88
+ <div class="name-list">
89
+ <a href="#M000122">new</a>&nbsp;&nbsp;
90
+ <a href="#M000123">with</a>&nbsp;&nbsp;
91
+ </div>
92
+ </div>
93
+
94
+ </div>
95
+
96
+
97
+ <!-- if includes -->
98
+
99
+ <div id="section">
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <!-- if method_list -->
109
+ <div id="methods">
110
+ <h3 class="section-bar">Public Class methods</h3>
111
+
112
+ <div id="method-M000122" class="method-detail">
113
+ <a name="M000122"></a>
114
+
115
+ <div class="method-heading">
116
+ <a href="#M000122" class="method-signature">
117
+ <span class="method-name">new</span><span class="method-args">()</span>
118
+ </a>
119
+ </div>
120
+
121
+ <div class="method-description">
122
+ <p><a class="source-toggle" href="#"
123
+ onclick="toggleCode('M000122-source');return false;">[Source]</a></p>
124
+ <div class="method-source-code" id="M000122-source">
125
+ <pre>
126
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 134</span>
127
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
128
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">'input'</span>)
129
+ <span class="ruby-keyword kw">end</span>
130
+ </pre>
131
+ </div>
132
+ </div>
133
+ </div>
134
+
135
+ <h3 class="section-bar">Public Instance methods</h3>
136
+
137
+ <div id="method-M000123" class="method-detail">
138
+ <a name="M000123"></a>
139
+
140
+ <div class="method-heading">
141
+ <a href="#M000123" class="method-signature">
142
+ <span class="method-name">with</span><span class="method-args">()</span>
143
+ </a>
144
+ </div>
145
+
146
+ <div class="method-description">
147
+ <p><a class="source-toggle" href="#"
148
+ onclick="toggleCode('M000123-source');return false;">[Source]</a></p>
149
+ <div class="method-source-code" id="M000123-source">
150
+ <pre>
151
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 147</span>
152
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>
153
+ <span class="ruby-keyword kw">super</span>
154
+ <span class="ruby-keyword kw">end</span>
155
+ </pre>
156
+ </div>
157
+ </div>
158
+ </div>
159
+
160
+
161
+ </div>
162
+
163
+
164
+ </div>
165
+
166
+
167
+ <div id="validator-badges">
168
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
169
+ </div>
170
+
171
+ </body>
172
+ </html>
@@ -0,0 +1,193 @@
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::Brush::Page</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::Brush::Page</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/wee/renderer/html/brushes_rb.html">
59
+ lib/wee/renderer/html/brushes.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
+ Brush
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="method-list">
86
+ <h3 class="section-bar">Methods</h3>
87
+
88
+ <div class="name-list">
89
+ <a href="#M000114">title</a>&nbsp;&nbsp;
90
+ <a href="#M000115">with</a>&nbsp;&nbsp;
91
+ </div>
92
+ </div>
93
+
94
+ </div>
95
+
96
+
97
+ <!-- if includes -->
98
+
99
+ <div id="section">
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <!-- if method_list -->
109
+ <div id="methods">
110
+ <h3 class="section-bar">Public Instance methods</h3>
111
+
112
+ <div id="method-M000114" class="method-detail">
113
+ <a name="M000114"></a>
114
+
115
+ <div class="method-heading">
116
+ <a href="#M000114" class="method-signature">
117
+ <span class="method-name">title</span><span class="method-args">(str)</span>
118
+ </a>
119
+ </div>
120
+
121
+ <div class="method-description">
122
+ <p><a class="source-toggle" href="#"
123
+ onclick="toggleCode('M000114-source');return false;">[Source]</a></p>
124
+ <div class="method-source-code" id="M000114-source">
125
+ <pre>
126
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 403</span>
127
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">title</span>(<span class="ruby-identifier">str</span>)
128
+ <span class="ruby-ivar">@title</span> = <span class="ruby-identifier">str</span>
129
+ <span class="ruby-keyword kw">self</span>
130
+ <span class="ruby-keyword kw">end</span>
131
+ </pre>
132
+ </div>
133
+ </div>
134
+ </div>
135
+
136
+ <div id="method-M000115" class="method-detail">
137
+ <a name="M000115"></a>
138
+
139
+ <div class="method-heading">
140
+ <a href="#M000115" class="method-signature">
141
+ <span class="method-name">with</span><span class="method-args">(text=nil, &amp;block)</span>
142
+ </a>
143
+ </div>
144
+
145
+ <div class="method-description">
146
+ <p><a class="source-toggle" href="#"
147
+ onclick="toggleCode('M000115-source');return false;">[Source]</a></p>
148
+ <div class="method-source-code" id="M000115-source">
149
+ <pre>
150
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 408</span>
151
+ <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>)
152
+ <span class="ruby-identifier">doc</span> = <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">document</span>
153
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">start_tag</span>(<span class="ruby-value str">&quot;html&quot;</span>)
154
+
155
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@title</span>
156
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">start_tag</span>(<span class="ruby-value str">&quot;head&quot;</span>)
157
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">start_tag</span>(<span class="ruby-value str">&quot;title&quot;</span>)
158
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">text</span>(<span class="ruby-ivar">@title</span>)
159
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-value str">&quot;title&quot;</span>)
160
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-value str">&quot;head&quot;</span>)
161
+ <span class="ruby-keyword kw">end</span>
162
+
163
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">start_tag</span>(<span class="ruby-value str">&quot;body&quot;</span>)
164
+
165
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>
166
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">text</span>(<span class="ruby-identifier">text</span>)
167
+ <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>)
168
+ <span class="ruby-keyword kw">else</span>
169
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
170
+ <span class="ruby-keyword kw">end</span>
171
+
172
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-value str">&quot;body&quot;</span>)
173
+ <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-value str">&quot;html&quot;</span>)
174
+ <span class="ruby-keyword kw">nil</span>
175
+ <span class="ruby-keyword kw">end</span>
176
+ </pre>
177
+ </div>
178
+ </div>
179
+ </div>
180
+
181
+
182
+ </div>
183
+
184
+
185
+ </div>
186
+
187
+
188
+ <div id="validator-badges">
189
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
190
+ </div>
191
+
192
+ </body>
193
+ </html>
@@ -0,0 +1,267 @@
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::Brush::SelectListTag</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::Brush::SelectListTag</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/wee/renderer/html/brushes_rb.html">
59
+ lib/wee/renderer/html/brushes.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
+ Brush::GenericTagBrush
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="method-list">
86
+ <h3 class="section-bar">Methods</h3>
87
+
88
+ <div class="name-list">
89
+ <a href="#M000100">callback</a>&nbsp;&nbsp;
90
+ <a href="#M000099">multiple</a>&nbsp;&nbsp;
91
+ <a href="#M000098">new</a>&nbsp;&nbsp;
92
+ <a href="#M000101">with</a>&nbsp;&nbsp;
93
+ </div>
94
+ </div>
95
+
96
+ </div>
97
+
98
+
99
+ <!-- if includes -->
100
+ <div id="includes">
101
+ <h3 class="section-bar">Included Modules</h3>
102
+
103
+ <div id="includes-list">
104
+ <span class="include-name"><a href="InputCallbackMixin.html">Brush::InputCallbackMixin</a></span>
105
+ </div>
106
+ </div>
107
+
108
+ <div id="section">
109
+
110
+
111
+
112
+ <div id="aliases-list">
113
+ <h3 class="section-bar">External Aliases</h3>
114
+
115
+ <div class="name-list">
116
+ <table summary="aliases">
117
+ <tr class="top-aligned-row context-row">
118
+ <td class="context-item-name">callback</td>
119
+ <td>-></td>
120
+ <td class="context-item-value">__old_callback</td>
121
+ </tr>
122
+ </table>
123
+ </div>
124
+ </div>
125
+
126
+
127
+
128
+
129
+
130
+ <!-- if method_list -->
131
+ <div id="methods">
132
+ <h3 class="section-bar">Public Class methods</h3>
133
+
134
+ <div id="method-M000098" class="method-detail">
135
+ <a name="M000098"></a>
136
+
137
+ <div class="method-heading">
138
+ <a href="#M000098" class="method-signature">
139
+ <span class="method-name">new</span><span class="method-args">(items)</span>
140
+ </a>
141
+ </div>
142
+
143
+ <div class="method-description">
144
+ <p><a class="source-toggle" href="#"
145
+ onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
146
+ <div class="method-source-code" id="M000098-source">
147
+ <pre>
148
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 249</span>
149
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">items</span>)
150
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">'select'</span>)
151
+ <span class="ruby-ivar">@items</span> = <span class="ruby-identifier">items</span>
152
+ <span class="ruby-keyword kw">end</span>
153
+ </pre>
154
+ </div>
155
+ </div>
156
+ </div>
157
+
158
+ <h3 class="section-bar">Public Instance methods</h3>
159
+
160
+ <div id="method-M000100" class="method-detail">
161
+ <a name="M000100"></a>
162
+
163
+ <div class="method-heading">
164
+ <a href="#M000100" class="method-signature">
165
+ <span class="method-name">callback</span><span class="method-args">(symbol=nil, &amp;block)</span>
166
+ </a>
167
+ </div>
168
+
169
+ <div class="method-description">
170
+ <p><a class="source-toggle" href="#"
171
+ onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
172
+ <div class="method-source-code" id="M000100-source">
173
+ <pre>
174
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 271</span>
175
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">callback</span>(<span class="ruby-identifier">symbol</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
176
+ <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>
177
+ <span class="ruby-identifier">block</span> = <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">current_component</span>.<span class="ruby-identifier">method</span>(<span class="ruby-identifier">symbol</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
178
+
179
+ <span class="ruby-ivar">@callback</span> = <span class="ruby-identifier">block</span>
180
+ <span class="ruby-keyword kw">self</span>
181
+ <span class="ruby-keyword kw">end</span>
182
+ </pre>
183
+ </div>
184
+ </div>
185
+ </div>
186
+
187
+ <div id="method-M000099" class="method-detail">
188
+ <a name="M000099"></a>
189
+
190
+ <div class="method-heading">
191
+ <a href="#M000099" class="method-signature">
192
+ <span class="method-name">multiple</span><span class="method-args">()</span>
193
+ </a>
194
+ </div>
195
+
196
+ <div class="method-description">
197
+ <p><a class="source-toggle" href="#"
198
+ onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
199
+ <div class="method-source-code" id="M000099-source">
200
+ <pre>
201
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 263</span>
202
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">multiple</span>
203
+ <span class="ruby-ivar">@multiple</span> = <span class="ruby-keyword kw">true</span>
204
+ <span class="ruby-ivar">@attributes</span>[<span class="ruby-value str">'multiple'</span>] = <span class="ruby-keyword kw">nil</span>
205
+ <span class="ruby-keyword kw">self</span>
206
+ <span class="ruby-keyword kw">end</span>
207
+ </pre>
208
+ </div>
209
+ </div>
210
+ </div>
211
+
212
+ <div id="method-M000101" class="method-detail">
213
+ <a name="M000101"></a>
214
+
215
+ <div class="method-heading">
216
+ <a href="#M000101" class="method-signature">
217
+ <span class="method-name">with</span><span class="method-args">()</span>
218
+ </a>
219
+ </div>
220
+
221
+ <div class="method-description">
222
+ <p><a class="source-toggle" href="#"
223
+ onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
224
+ <div class="method-source-code" id="M000101-source">
225
+ <pre>
226
+ <span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 279</span>
227
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>
228
+ <span class="ruby-ivar">@labels</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_s</span> }
229
+ <span class="ruby-ivar">@selected</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
230
+
231
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@callback</span>
232
+ <span class="ruby-identifier">__old_callback</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">input</span><span class="ruby-operator">|</span>
233
+ <span class="ruby-identifier">choosen</span> = <span class="ruby-identifier">input</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">idx</span><span class="ruby-operator">|</span>
234
+ <span class="ruby-identifier">idx</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">idx</span>)
235
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;invalid index in select list&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">idx</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">idx</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">size</span>
236
+ <span class="ruby-ivar">@items</span>[<span class="ruby-identifier">idx</span>]
237
+ }
238
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;choosen more than one element from a non-multiple select list&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@multiple</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">choosen</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
239
+ <span class="ruby-ivar">@callback</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">choosen</span>)
240
+ }
241
+ <span class="ruby-keyword kw">end</span>
242
+
243
+ <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">do</span>
244
+ <span class="ruby-ivar">@items</span>.<span class="ruby-identifier">each_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
245
+ <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">option</span>.<span class="ruby-identifier">value</span>(<span class="ruby-identifier">i</span>).<span class="ruby-identifier">selected</span>(<span class="ruby-ivar">@selected</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@items</span>[<span class="ruby-identifier">i</span>])).<span class="ruby-identifier">with</span>(<span class="ruby-ivar">@labels</span>[<span class="ruby-identifier">i</span>])
246
+ <span class="ruby-keyword kw">end</span>
247
+ <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">text</span>(<span class="ruby-value str">&quot;&quot;</span>)
248
+ <span class="ruby-keyword kw">end</span>
249
+ <span class="ruby-keyword kw">end</span>
250
+ </pre>
251
+ </div>
252
+ </div>
253
+ </div>
254
+
255
+
256
+ </div>
257
+
258
+
259
+ </div>
260
+
261
+
262
+ <div id="validator-badges">
263
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
264
+ </div>
265
+
266
+ </body>
267
+ </html>