wee 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. data/TODO +31 -0
  2. data/benchmark.rb +37 -0
  3. data/demo.ru +11 -0
  4. data/doc/rdoc/classes/Array.html +22 -26
  5. data/doc/rdoc/classes/Hash.html +22 -26
  6. data/doc/rdoc/classes/Object.html +21 -26
  7. data/doc/rdoc/classes/String.html +19 -87
  8. data/doc/rdoc/classes/Struct.html +22 -26
  9. data/doc/rdoc/classes/Wee.html +75 -206
  10. data/doc/rdoc/classes/Wee/AnswerDecoration.html +35 -66
  11. data/doc/rdoc/classes/Wee/AnswerDecoration/Answer.html +28 -46
  12. data/doc/rdoc/classes/Wee/Application.html +63 -114
  13. data/doc/rdoc/classes/Wee/Application/SessionCache.html +30 -44
  14. data/doc/rdoc/classes/Wee/Brush.html +52 -101
  15. data/doc/rdoc/classes/Wee/Brush/ActionInputTag.html +29 -51
  16. data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +44 -101
  17. data/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +43 -76
  18. data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +29 -46
  19. data/doc/rdoc/classes/Wee/Brush/FormTag.html +48 -110
  20. data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +30 -42
  21. data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +37 -58
  22. data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +93 -210
  23. data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +38 -63
  24. data/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +29 -45
  25. data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +35 -52
  26. data/doc/rdoc/classes/Wee/Brush/ImageTag.html +28 -61
  27. data/doc/rdoc/classes/Wee/Brush/InputTag.html +34 -107
  28. data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +28 -54
  29. data/doc/rdoc/classes/Wee/Brush/Page.html +39 -73
  30. data/doc/rdoc/classes/Wee/Brush/PasswordInputTag.html +29 -45
  31. data/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html +54 -98
  32. data/doc/rdoc/classes/Wee/Brush/RadioGroup.html +46 -84
  33. data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +87 -187
  34. data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +29 -56
  35. data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +29 -45
  36. data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +28 -55
  37. data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +28 -55
  38. data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +56 -113
  39. data/doc/rdoc/classes/Wee/Brush/TableTag.html +27 -58
  40. data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +48 -140
  41. data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +29 -45
  42. data/doc/rdoc/classes/Wee/CallAnswerMixin.html +51 -79
  43. data/doc/rdoc/classes/Wee/CallbackMixin.html +44 -77
  44. data/doc/rdoc/classes/Wee/CallbackRegistry.html +69 -125
  45. data/doc/rdoc/classes/Wee/Callbacks.html +43 -82
  46. data/doc/rdoc/classes/Wee/Component.html +142 -292
  47. data/doc/rdoc/classes/Wee/Decoration.html +85 -141
  48. data/doc/rdoc/classes/Wee/DecorationMixin.html +111 -118
  49. data/doc/rdoc/classes/Wee/Delegate.html +72 -115
  50. data/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +37 -54
  51. data/doc/rdoc/classes/Wee/ErrorResponse.html +31 -48
  52. data/doc/rdoc/classes/Wee/FormDecoration.html +32 -46
  53. data/doc/rdoc/classes/Wee/GenericResponse.html +30 -50
  54. data/doc/rdoc/classes/Wee/HtmlCanvas.html +209 -562
  55. data/doc/rdoc/classes/Wee/HtmlDocument.html +51 -91
  56. data/doc/rdoc/classes/Wee/HtmlWriter.html +76 -156
  57. data/doc/rdoc/classes/Wee/IdGenerator.html +28 -44
  58. data/doc/rdoc/classes/Wee/IdGenerator/Secure.html +53 -95
  59. data/doc/rdoc/classes/Wee/IdGenerator/Sequential.html +37 -63
  60. data/doc/rdoc/classes/Wee/JQuery.html +36 -64
  61. data/doc/rdoc/classes/Wee/LRUCache.html +94 -189
  62. data/doc/rdoc/classes/Wee/LRUCache/Item.html +30 -42
  63. data/doc/rdoc/classes/Wee/ObjectSnapshotMixin.html +37 -54
  64. data/doc/rdoc/classes/Wee/PageDecoration.html +48 -79
  65. data/doc/rdoc/classes/Wee/Presenter.html +86 -143
  66. data/doc/rdoc/classes/Wee/RedirectResponse.html +31 -49
  67. data/doc/rdoc/classes/Wee/RefreshResponse.html +34 -48
  68. data/doc/rdoc/classes/Wee/Renderer.html +56 -125
  69. data/doc/rdoc/classes/Wee/Request.html +57 -115
  70. data/doc/rdoc/classes/Wee/Response.html +24 -26
  71. data/doc/rdoc/classes/Wee/Session.html +137 -292
  72. data/doc/rdoc/classes/Wee/Session/AbortCallbackProcessing.html +29 -46
  73. data/doc/rdoc/classes/Wee/Session/MutexSerializer.html +29 -42
  74. data/doc/rdoc/classes/Wee/Session/Page.html +22 -21
  75. data/doc/rdoc/classes/Wee/Session/ThreadSerializer.html +36 -60
  76. data/doc/rdoc/classes/Wee/State.html +57 -105
  77. data/doc/rdoc/classes/Wee/State/Snapshot.html +22 -21
  78. data/doc/rdoc/classes/Wee/State/SnapshotIVars.html +22 -21
  79. data/doc/rdoc/classes/Wee/StructSnapshotMixin.html +37 -54
  80. data/doc/rdoc/classes/Wee/WrapperDecoration.html +42 -68
  81. data/doc/rdoc/created.rid +1 -1
  82. data/doc/rdoc/files/README_rdoc.html +26 -17
  83. data/doc/rdoc/files/lib/wee/application_rb.html +25 -19
  84. data/doc/rdoc/files/lib/wee/call_answer_rb.html +23 -12
  85. data/doc/rdoc/files/lib/wee/callback_rb.html +23 -12
  86. data/doc/rdoc/files/lib/wee/component_rb.html +25 -19
  87. data/doc/rdoc/files/lib/wee/decoration_rb.html +23 -15
  88. data/doc/rdoc/files/lib/wee/html_brushes_rb.html +23 -12
  89. data/doc/rdoc/files/lib/wee/html_canvas_rb.html +23 -15
  90. data/doc/rdoc/files/lib/wee/html_document_rb.html +23 -15
  91. data/doc/rdoc/files/lib/wee/html_writer_rb.html +23 -15
  92. data/doc/rdoc/files/lib/wee/id_generator_rb.html +24 -17
  93. data/doc/rdoc/files/lib/wee/jquery/jquery_rb.html +23 -12
  94. data/doc/rdoc/files/lib/wee/jquery_rb.html +23 -15
  95. data/doc/rdoc/files/lib/wee/lru_cache_rb.html +23 -12
  96. data/doc/rdoc/files/lib/wee/presenter_rb.html +23 -12
  97. data/doc/rdoc/files/lib/wee/renderer_rb.html +23 -12
  98. data/doc/rdoc/files/lib/wee/request_rb.html +23 -15
  99. data/doc/rdoc/files/lib/wee/response_rb.html +24 -17
  100. data/doc/rdoc/files/lib/wee/session_rb.html +26 -21
  101. data/doc/rdoc/files/lib/wee/state_rb.html +23 -12
  102. data/doc/rdoc/files/lib/wee_rb.html +37 -47
  103. data/doc/rdoc/fr_class_index.html +12 -86
  104. data/doc/rdoc/fr_file_index.html +12 -30
  105. data/doc/rdoc/fr_method_index.html +242 -473
  106. data/doc/rdoc/index.html +8 -5
  107. data/doc/rdoc/rdoc-style.css +119 -210
  108. data/examples/ObjectSpaceBrowser.rb +4 -4
  109. data/examples/TODO +21 -0
  110. data/examples/ajax.rb +6 -4
  111. data/examples/blog.rb +42 -0
  112. data/examples/demo.rb +5 -3
  113. data/examples/demo/calculator.rb +3 -3
  114. data/examples/demo/calendar.rb +4 -4
  115. data/examples/demo/counter.rb +2 -2
  116. data/examples/demo/editable_counter.rb +2 -2
  117. data/examples/demo/example.rb +25 -16
  118. data/examples/demo/window.rb +10 -3
  119. data/examples/hw2.rb +17 -0
  120. data/examples/recipe/description.rb +170 -0
  121. data/examples/recipe/migrations/001_create_recipes.rb +13 -0
  122. data/examples/recipe/model.rb +27 -0
  123. data/examples/recipe/models/recipe.rb +18 -0
  124. data/examples/recipe/recipe_editor.rb +28 -0
  125. data/lib/wee.rb +1 -7
  126. data/lib/wee/component.rb +37 -74
  127. data/lib/wee/decoration.rb +16 -15
  128. data/lib/wee/html_brushes.rb +16 -17
  129. data/lib/wee/presenter.rb +2 -1
  130. data/lib/wee/response.rb +4 -4
  131. data/lib/wee/session.rb +2 -2
  132. data/lib/wee/state.rb +2 -2
  133. data/test/t.rb +67 -0
  134. data/wee.gemspec +1 -1
  135. metadata +157 -167
@@ -1,14 +1,17 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
5
+
4
6
  <!--
5
7
 
6
8
  RDoc Documentation
7
9
 
8
10
  -->
11
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
9
12
  <head>
10
13
  <title>RDoc Documentation</title>
11
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
14
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
12
15
  </head>
13
16
  <frameset rows="20%, 80%">
14
17
  <frameset cols="25%,35%,45%">
@@ -18,4 +21,4 @@
18
21
  </frameset>
19
22
  <frame src="files/README_rdoc.html" name="docwin" />
20
23
  </frameset>
21
- </html>
24
+ </html>
@@ -1,46 +1,29 @@
1
- body {
2
- font-family: Verdana,Arial,Helvetica,sans-serif;
3
- font-size: 90%;
4
- margin: 0;
5
- margin-left: 40px;
6
- padding: 0;
7
- background: white;
8
- color: black;
9
- }
10
-
11
- h1, h2, h3, h4 {
12
- margin: 0;
13
- background: transparent;
14
- }
15
-
16
- h1 {
17
- font-size: 150%;
18
- }
19
1
 
20
- h2,h3,h4 {
21
- margin-top: 1em;
2
+ body {
3
+ font-family: Verdana,Arial,Helvetica,sans-serif;
4
+ font-size: 90%;
5
+ margin: 0;
6
+ margin-left: 40px;
7
+ padding: 0;
8
+ background: white;
22
9
  }
23
10
 
24
- :link, :visited {
25
- background: #eef;
26
- color: #039;
27
- text-decoration: none;
28
- }
11
+ h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
12
+ h1 { font-size: 150%; }
13
+ h2,h3,h4 { margin-top: 1em; }
29
14
 
30
- :link:hover, :visited:hover {
31
- background: #039;
32
- color: #eef;
33
- }
15
+ a { background: #eef; color: #039; text-decoration: none; }
16
+ a:hover { background: #039; color: #eef; }
34
17
 
35
18
  /* Override the base stylesheet's Anchor inside a table cell */
36
- td > :link, td > :visited {
19
+ td > a {
37
20
  background: transparent;
38
21
  color: #039;
39
22
  text-decoration: none;
40
23
  }
41
24
 
42
25
  /* and inside a section title */
43
- .section-title > :link, .section-title > :visited {
26
+ .section-title > a {
44
27
  background: transparent;
45
28
  color: #eee;
46
29
  text-decoration: none;
@@ -48,252 +31,178 @@ td > :link, td > :visited {
48
31
 
49
32
  /* === Structural elements =================================== */
50
33
 
51
- .index {
52
- margin: 0;
53
- margin-left: -40px;
54
- padding: 0;
55
- font-size: 90%;
34
+ div#index {
35
+ margin: 0;
36
+ margin-left: -40px;
37
+ padding: 0;
38
+ font-size: 90%;
56
39
  }
57
40
 
58
- .index :link, .index :visited {
59
- margin-left: 0.7em;
41
+
42
+ div#index a {
43
+ margin-left: 0.7em;
60
44
  }
61
45
 
62
- .index .section-bar {
63
- margin-left: 0px;
64
- padding-left: 0.7em;
65
- background: #ccc;
66
- font-size: small;
46
+ div#index .section-bar {
47
+ margin-left: 0px;
48
+ padding-left: 0.7em;
49
+ background: #ccc;
50
+ font-size: small;
67
51
  }
68
52
 
69
- #classHeader, #fileHeader {
70
- width: auto;
71
- color: white;
72
- padding: 0.5em 1.5em 0.5em 1.5em;
73
- margin: 0;
74
- margin-left: -40px;
75
- border-bottom: 3px solid #006;
53
+
54
+ div#classHeader, div#fileHeader {
55
+ width: auto;
56
+ color: white;
57
+ padding: 0.5em 1.5em 0.5em 1.5em;
58
+ margin: 0;
59
+ margin-left: -40px;
60
+ border-bottom: 3px solid #006;
76
61
  }
77
62
 
78
- #classHeader :link, #fileHeader :link,
79
- #classHeader :visited, #fileHeader :visited {
80
- background: inherit;
81
- color: white;
63
+ div#classHeader a, div#fileHeader a {
64
+ background: inherit;
65
+ color: white;
82
66
  }
83
67
 
84
- #classHeader td, #fileHeader td {
85
- background: inherit;
86
- color: white;
68
+ div#classHeader td, div#fileHeader td {
69
+ background: inherit;
70
+ color: white;
87
71
  }
88
72
 
89
- #fileHeader {
90
- background: #057;
73
+
74
+ div#fileHeader {
75
+ background: #057;
91
76
  }
92
77
 
93
- #classHeader {
94
- background: #048;
78
+ div#classHeader {
79
+ background: #048;
95
80
  }
96
81
 
82
+
97
83
  .class-name-in-header {
98
84
  font-size: 180%;
99
85
  font-weight: bold;
100
86
  }
101
87
 
102
- #bodyContent {
103
- padding: 0 1.5em 0 1.5em;
104
- }
105
88
 
106
- #description {
107
- padding: 0.5em 1.5em;
108
- background: #efefef;
109
- border: 1px dotted #999;
89
+ div#bodyContent {
90
+ padding: 0 1.5em 0 1.5em;
110
91
  }
111
92
 
112
- #description h1, #description h2, #description h3,
113
- #description h4, #description h5, #description h6 {
114
- color: #125;
115
- background: transparent;
93
+ div#description {
94
+ padding: 0.5em 1.5em;
95
+ background: #efefef;
96
+ border: 1px dotted #999;
116
97
  }
117
98
 
118
- #validator-badges {
119
- text-align: center;
99
+ div#description h1,h2,h3,h4,h5,h6 {
100
+ color: #125;;
101
+ background: transparent;
120
102
  }
121
103
 
122
- #validator-badges img {
123
- border: 0;
104
+ div#validator-badges {
105
+ text-align: center;
124
106
  }
107
+ div#validator-badges img { border: 0; }
125
108
 
126
- #copyright {
127
- color: #333;
128
- background: #efefef;
129
- font: 0.75em sans-serif;
130
- margin-top: 5em;
131
- margin-bottom: 0;
132
- padding: 0.5em 2em;
109
+ div#copyright {
110
+ color: #333;
111
+ background: #efefef;
112
+ font: 0.75em sans-serif;
113
+ margin-top: 5em;
114
+ margin-bottom: 0;
115
+ padding: 0.5em 2em;
133
116
  }
134
117
 
118
+
135
119
  /* === Classes =================================== */
136
120
 
137
121
  table.header-table {
138
- color: white;
139
- font-size: small;
122
+ color: white;
123
+ font-size: small;
140
124
  }
141
125
 
142
126
  .type-note {
143
- font-size: small;
144
- color: #dedede;
127
+ font-size: small;
128
+ color: #DEDEDE;
145
129
  }
146
130
 
147
- .section-bar {
148
- color: #333;
149
- border-bottom: 1px solid #999;
150
- margin-left: -20px;
131
+ .xxsection-bar {
132
+ background: #eee;
133
+ color: #333;
134
+ padding: 3px;
151
135
  }
152
136
 
153
- .section-title {
154
- background: #79a;
155
- color: #eee;
156
- padding: 3px;
157
- margin-top: 2em;
158
- margin-left: -30px;
159
- border: 1px solid #999;
137
+ .section-bar {
138
+ color: #333;
139
+ border-bottom: 1px solid #999;
140
+ margin-left: -20px;
160
141
  }
161
142
 
162
- .top-aligned-row {
163
- vertical-align: top
164
- }
165
143
 
166
- .bottom-aligned-row {
167
- vertical-align: bottom
144
+ .section-title {
145
+ background: #79a;
146
+ color: #eee;
147
+ padding: 3px;
148
+ margin-top: 2em;
149
+ margin-left: -30px;
150
+ border: 1px solid #999;
168
151
  }
169
152
 
170
- #diagram img {
171
- border: 0;
172
- }
153
+ .top-aligned-row { vertical-align: top }
154
+ .bottom-aligned-row { vertical-align: bottom }
173
155
 
174
156
  /* --- Context section classes ----------------------- */
175
157
 
176
158
  .context-row { }
177
-
178
- .context-item-name {
179
- font-family: monospace;
180
- font-weight: bold;
181
- color: black;
182
- }
183
-
184
- .context-item-value {
185
- font-size: small;
186
- color: #448;
187
- }
188
-
189
- .context-item-desc {
190
- color: #333;
191
- padding-left: 2em;
192
- }
159
+ .context-item-name { font-family: monospace; font-weight: bold; color: black; }
160
+ .context-item-value { font-size: small; color: #448; }
161
+ .context-item-desc { color: #333; padding-left: 2em; }
193
162
 
194
163
  /* --- Method classes -------------------------- */
195
-
196
164
  .method-detail {
197
- background: #efefef;
198
- padding: 0;
199
- margin-top: 0.5em;
200
- margin-bottom: 1em;
201
- border: 1px dotted #ccc;
165
+ background: #efefef;
166
+ padding: 0;
167
+ margin-top: 0.5em;
168
+ margin-bottom: 1em;
169
+ border: 1px dotted #ccc;
202
170
  }
203
-
204
171
  .method-heading {
205
172
  color: black;
206
173
  background: #ccc;
207
174
  border-bottom: 1px solid #666;
208
175
  padding: 0.2em 0.5em 0 0.5em;
209
176
  }
210
-
211
- .method-signature {
212
- color: black;
213
- background: inherit;
214
- }
215
-
216
- .method-name {
217
- font-weight: bold;
218
- }
219
-
220
- .method-args {
221
- font-style: italic;
222
- }
223
-
224
- .method-description {
225
- padding: 0 0.5em 0 0.5em;
226
- }
177
+ .method-signature { color: black; background: inherit; }
178
+ .method-name { font-weight: bold; }
179
+ .method-args { font-style: italic; }
180
+ .method-description { padding: 0 0.5em 0 0.5em; }
227
181
 
228
182
  /* --- Source code sections -------------------- */
229
183
 
230
- :link.source-toggle, :visited.source-toggle {
231
- font-size: 90%;
232
- }
233
-
184
+ a.source-toggle { font-size: 90%; }
234
185
  div.method-source-code {
235
- background: #262626;
236
- color: #ffdead;
237
- margin: 1em;
238
- padding: 0.5em;
239
- border: 1px dashed #999;
240
- overflow: auto;
186
+ background: #262626;
187
+ color: #ffdead;
188
+ margin: 1em;
189
+ padding: 0.5em;
190
+ border: 1px dashed #999;
191
+ overflow: hidden;
241
192
  }
242
193
 
243
- div.method-source-code pre {
244
- color: #ffdead;
245
- }
194
+ div.method-source-code pre { color: #ffdead; overflow: hidden; }
246
195
 
247
196
  /* --- Ruby keyword styles --------------------- */
248
197
 
249
- .standalone-code {
250
- background: #221111;
251
- color: #ffdead;
252
- overflow: auto;
253
- }
254
-
255
- .ruby-constant {
256
- color: #7fffd4;
257
- background: transparent;
258
- }
259
-
260
- .ruby-keyword {
261
- color: #00ffff;
262
- background: transparent;
263
- }
264
-
265
- .ruby-ivar {
266
- color: #eedd82;
267
- background: transparent;
268
- }
269
-
270
- .ruby-operator {
271
- color: #00ffee;
272
- background: transparent;
273
- }
274
-
275
- .ruby-identifier {
276
- color: #ffdead;
277
- background: transparent;
278
- }
279
-
280
- .ruby-node {
281
- color: #ffa07a;
282
- background: transparent;
283
- }
284
-
285
- .ruby-comment {
286
- color: #b22222;
287
- font-weight: bold;
288
- background: transparent;
289
- }
290
-
291
- .ruby-regexp {
292
- color: #ffa07a;
293
- background: transparent;
294
- }
295
-
296
- .ruby-value {
297
- color: #7fffd4;
298
- background: transparent;
299
- }
198
+ .standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
199
+
200
+ .ruby-constant { color: #7fffd4; background: transparent; }
201
+ .ruby-keyword { color: #00ffff; background: transparent; }
202
+ .ruby-ivar { color: #eedd82; background: transparent; }
203
+ .ruby-operator { color: #00ffee; background: transparent; }
204
+ .ruby-identifier { color: #ffdead; background: transparent; }
205
+ .ruby-node { color: #ffa07a; background: transparent; }
206
+ .ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
207
+ .ruby-regexp { color: #ffa07a; background: transparent; }
208
+ .ruby-value { color: #7fffd4; background: transparent; }
@@ -177,13 +177,13 @@ if $0 == __FILE__ then
177
177
  def initialize
178
178
  super
179
179
  add_decoration(Wee::PageDecoration.new("Hello World"))
180
- add_child ObjectSpaceBrowser::Instance.new(OBJ)
180
+ @instance = ObjectSpaceBrowser::Instance.new(OBJ)
181
181
  end
182
182
 
183
+ def children() [@instance] end
184
+
183
185
  def render(r)
184
- each_child do |c|
185
- r.render(c)
186
- end
186
+ r.render(@instance)
187
187
  end
188
188
  end
189
189