wee 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. data/ChangeLog +286 -0
  2. data/Features +185 -0
  3. data/doc/rdoc/classes/ActionView.html +107 -0
  4. data/doc/rdoc/classes/ActionView/Base.html +133 -0
  5. data/doc/rdoc/classes/Array.html +7 -59
  6. data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
  7. data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
  8. data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
  9. data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
  10. data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
  11. data/doc/rdoc/classes/Enumerable.html +6 -6
  12. data/doc/rdoc/classes/Hash.html +120 -0
  13. data/doc/rdoc/classes/Main.html +58 -34
  14. data/doc/rdoc/classes/Object.html +12 -12
  15. data/doc/rdoc/classes/OgScaffolder.html +165 -166
  16. data/doc/rdoc/classes/OgScaffolder/Editor.html +112 -112
  17. data/doc/rdoc/classes/String.html +7 -59
  18. data/doc/rdoc/classes/Struct.html +14 -14
  19. data/doc/rdoc/classes/Wee.html +70 -6
  20. data/doc/rdoc/classes/Wee/AbstractSession.html +502 -0
  21. data/doc/rdoc/classes/Wee/AnswerDecoration.html +11 -11
  22. data/doc/rdoc/classes/Wee/Application.html +139 -84
  23. data/doc/rdoc/classes/Wee/Brush.html +21 -18
  24. data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +90 -17
  25. data/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +162 -0
  26. data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +7 -7
  27. data/doc/rdoc/classes/Wee/Brush/FormTag.html +41 -17
  28. data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
  29. data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +7 -7
  30. data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +112 -86
  31. data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
  32. data/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +160 -0
  33. data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +15 -15
  34. data/doc/rdoc/classes/Wee/Brush/ImageTag.html +21 -21
  35. data/doc/rdoc/classes/Wee/Brush/InputTag.html +14 -14
  36. data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +7 -7
  37. data/doc/rdoc/classes/Wee/Brush/Page.html +14 -14
  38. data/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html +234 -0
  39. data/doc/rdoc/classes/Wee/Brush/RadioButtonTag/RadioGroup.html +207 -0
  40. data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +124 -28
  41. data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +7 -7
  42. data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -7
  43. data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +7 -7
  44. data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +14 -14
  45. data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
  46. data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +42 -42
  47. data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
  48. data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +48 -15
  49. data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
  50. data/doc/rdoc/classes/Wee/CallbackRegistry.html +38 -38
  51. data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
  52. data/doc/rdoc/classes/Wee/CanvasMixin.html +225 -0
  53. data/doc/rdoc/classes/Wee/Component.html +202 -201
  54. data/doc/rdoc/classes/Wee/Component/OnAnswer.html +7 -7
  55. data/doc/rdoc/classes/Wee/ComponentDispatcher.html +289 -0
  56. data/doc/rdoc/classes/Wee/ComponentRunner.html +321 -0
  57. data/doc/rdoc/classes/Wee/Context.html +63 -3
  58. data/doc/rdoc/classes/Wee/Decoration.html +45 -45
  59. data/doc/rdoc/classes/Wee/Delegate.html +30 -30
  60. data/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +164 -0
  61. data/doc/rdoc/classes/Wee/ErrorResponse.html +16 -16
  62. data/doc/rdoc/classes/Wee/Examples.html +114 -0
  63. data/doc/rdoc/classes/Wee/Examples/Calculator.html +319 -0
  64. data/doc/rdoc/classes/Wee/Examples/Counter.html +289 -0
  65. data/doc/rdoc/classes/Wee/Examples/EditableCounter.html +210 -0
  66. data/doc/rdoc/classes/Wee/Examples/Window.html +346 -0
  67. data/doc/rdoc/classes/Wee/FastCGIAdaptor.html +227 -0
  68. data/doc/rdoc/classes/Wee/FormDecoration.html +6 -6
  69. data/doc/rdoc/classes/Wee/GenericResponse.html +7 -7
  70. data/doc/rdoc/classes/Wee/HtmlCanvasRenderer.html +1230 -0
  71. data/doc/rdoc/classes/Wee/HtmlWriter.html +40 -40
  72. data/doc/rdoc/classes/Wee/IdGenerator.html +148 -0
  73. data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +27 -14
  74. data/doc/rdoc/classes/Wee/LoginDecoration.html +261 -0
  75. data/doc/rdoc/classes/Wee/Md5IdGenerator.html +14 -14
  76. data/doc/rdoc/classes/Wee/MessageBox.html +14 -14
  77. data/doc/rdoc/classes/Wee/Nitro.html +114 -0
  78. data/doc/rdoc/classes/Wee/Nitro/ControllerClassMixin.html +192 -0
  79. data/doc/rdoc/classes/Wee/Nitro/ControllerMixin.html +345 -0
  80. data/doc/rdoc/classes/Wee/Nitro/FormTag.html +155 -0
  81. data/doc/rdoc/classes/Wee/Nitro/HtmlCanvasRenderer.html +178 -0
  82. data/doc/rdoc/classes/Wee/Page.html +4 -0
  83. data/doc/rdoc/classes/Wee/PageDecoration.html +18 -18
  84. data/doc/rdoc/classes/Wee/PagelessApplication.html +13 -11
  85. data/doc/rdoc/classes/Wee/PagelessComponentDriver.html +296 -0
  86. data/doc/rdoc/classes/Wee/PagelessRequest.html +52 -21
  87. data/doc/rdoc/classes/Wee/PagelessSession.html +130 -91
  88. data/doc/rdoc/classes/Wee/Pager.html +534 -0
  89. data/doc/rdoc/classes/Wee/Presenter.html +482 -298
  90. data/doc/rdoc/classes/Wee/Rails.html +114 -0
  91. data/doc/rdoc/classes/Wee/Rails/ControllerClassMixin.html +192 -0
  92. data/doc/rdoc/classes/Wee/Rails/ControllerMixin.html +342 -0
  93. data/doc/rdoc/classes/Wee/Rails/FormTag.html +155 -0
  94. data/doc/rdoc/classes/Wee/Rails/HtmlCanvasRenderer.html +177 -0
  95. data/doc/rdoc/classes/Wee/RedirectResponse.html +7 -7
  96. data/doc/rdoc/classes/Wee/RefreshResponse.html +7 -7
  97. data/doc/rdoc/classes/Wee/Renderer.html +208 -0
  98. data/doc/rdoc/classes/Wee/RenderingContext.html +175 -3
  99. data/doc/rdoc/classes/Wee/Request.html +197 -46
  100. data/doc/rdoc/classes/Wee/RequestHandler.html +31 -31
  101. data/doc/rdoc/classes/Wee/Response.html +44 -43
  102. data/doc/rdoc/classes/Wee/Session.html +296 -402
  103. data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +14 -14
  104. data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
  105. data/doc/rdoc/classes/Wee/Utils.html +22 -22
  106. data/doc/rdoc/classes/Wee/Utils/LRUCache.html +6 -6
  107. data/doc/rdoc/classes/Wee/ValueHolder.html +19 -19
  108. data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +72 -46
  109. data/doc/rdoc/classes/Wee/WrapperDecoration.html +6 -6
  110. data/doc/rdoc/created.rid +1 -1
  111. data/doc/rdoc/files/INSTALL.html +1 -1
  112. data/doc/rdoc/files/README.html +8 -12
  113. data/doc/rdoc/files/lib/cache/cache_rb.html +1 -1
  114. data/doc/rdoc/files/lib/wee/abstractsession_rb.html +108 -0
  115. data/doc/rdoc/files/lib/wee/adaptors/fastcgi_rb.html +108 -0
  116. data/doc/rdoc/files/lib/wee/adaptors/nitro_rb.html +101 -0
  117. data/doc/rdoc/files/lib/wee/adaptors/rails_rb.html +101 -0
  118. data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
  119. data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
  120. data/doc/rdoc/files/lib/wee/components/component_dispatcher_rb.html +108 -0
  121. data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +1 -1
  122. data/doc/rdoc/files/lib/wee/components/login_decoration_rb.html +101 -0
  123. data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +1 -1
  124. data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
  125. data/doc/rdoc/files/lib/wee/components/pager_rb.html +101 -0
  126. data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +1 -1
  127. data/doc/rdoc/files/lib/wee/components_rb.html +4 -1
  128. data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +1 -1
  129. data/doc/rdoc/files/lib/wee/continuation/session_rb.html +1 -1
  130. data/doc/rdoc/files/lib/wee/continuation_rb.html +1 -1
  131. data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
  132. data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
  133. data/doc/rdoc/files/lib/wee/core/componentrunner_rb.html +110 -0
  134. data/doc/rdoc/files/lib/wee/core/context_rb.html +101 -0
  135. data/doc/rdoc/files/lib/wee/core/decoration_rb.html +1 -1
  136. data/doc/rdoc/files/lib/wee/core/idgen_rb.html +101 -0
  137. data/doc/rdoc/files/lib/wee/core/page_rb.html +101 -0
  138. data/doc/rdoc/files/lib/wee/core/presenter_rb.html +1 -1
  139. data/doc/rdoc/files/lib/wee/core/renderer_rb.html +107 -0
  140. data/doc/rdoc/files/lib/wee/core/snapshot_rb.html +1 -1
  141. data/doc/rdoc/files/lib/wee/core/valueholder_rb.html +2 -2
  142. data/doc/rdoc/files/lib/wee/core_ext_rb.html +101 -0
  143. data/doc/rdoc/files/lib/wee/core_rb.html +7 -14
  144. data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +1 -1
  145. data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +1 -1
  146. data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +1 -1
  147. data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +1 -1
  148. data/doc/rdoc/files/lib/wee/databases/og_rb.html +1 -1
  149. data/doc/rdoc/files/lib/wee/examples/calculator_rb.html +107 -0
  150. data/doc/rdoc/files/lib/wee/examples/counter_rb.html +101 -0
  151. data/doc/rdoc/files/lib/wee/examples/editable_counter_rb.html +114 -0
  152. data/doc/rdoc/files/lib/wee/examples/window_rb.html +101 -0
  153. data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +1 -1
  154. data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +1 -1
  155. data/doc/rdoc/files/lib/wee/page_rb.html +1 -1
  156. data/doc/rdoc/files/lib/wee/pageless/application_rb.html +8 -1
  157. data/doc/rdoc/files/lib/wee/pageless/request_rb.html +1 -1
  158. data/doc/rdoc/files/lib/wee/pageless/session_rb.html +2 -1
  159. data/doc/rdoc/files/lib/wee/pageless_rb.html +1 -1
  160. data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
  161. data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +1 -1
  162. data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +1 -1
  163. data/doc/rdoc/files/lib/wee/request_rb.html +5 -4
  164. data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
  165. data/doc/rdoc/files/lib/wee/response_rb.html +2 -1
  166. data/doc/rdoc/files/lib/wee/session_rb.html +2 -3
  167. data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +1 -1
  168. data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +2 -2
  169. data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +1 -1
  170. data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +1 -1
  171. data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +1 -1
  172. data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +1 -1
  173. data/doc/rdoc/files/lib/wee/snapshot_ext_rb.html +1 -1
  174. data/doc/rdoc/files/lib/wee/template_rb.html +1 -1
  175. data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
  176. data/doc/rdoc/files/lib/wee/utils/cache_rb.html +1 -1
  177. data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -1
  178. data/doc/rdoc/files/lib/wee/utils_rb.html +1 -1
  179. data/doc/rdoc/files/lib/wee_rb.html +5 -3
  180. data/doc/rdoc/fr_class_index.html +34 -2
  181. data/doc/rdoc/fr_file_index.html +17 -1
  182. data/doc/rdoc/fr_method_index.html +464 -314
  183. data/examples/ajax/ajax.rb +1 -1
  184. data/examples/demo.rb +47 -0
  185. data/examples/{calendar.rb → demo/calendar.rb} +89 -97
  186. data/examples/{example.rb → demo/example.rb} +17 -97
  187. data/examples/dispatcher.rb +37 -0
  188. data/examples/draw.rb +14 -11
  189. data/examples/nitro/run.rb +42 -0
  190. data/examples/radio.rb +44 -0
  191. data/examples/test.rb +3 -27
  192. data/lib/wee.rb +15 -3
  193. data/lib/wee/adaptors/nitro.rb +154 -0
  194. data/lib/wee/adaptors/rails.rb +154 -0
  195. data/lib/wee/application.rb +22 -20
  196. data/lib/wee/components.rb +3 -0
  197. data/lib/wee/components/component_dispatcher.rb +46 -0
  198. data/lib/wee/components/login_decoration.rb +35 -0
  199. data/lib/wee/components/messagebox.rb +2 -2
  200. data/lib/wee/components/pager.rb +102 -0
  201. data/lib/wee/continuation/core/component.rb +13 -12
  202. data/lib/wee/continuation/session.rb +11 -19
  203. data/lib/wee/core.rb +8 -7
  204. data/lib/wee/core/component.rb +8 -28
  205. data/lib/wee/core/componentrunner.rb +73 -0
  206. data/lib/wee/core/context.rb +27 -0
  207. data/lib/wee/core/idgen.rb +5 -0
  208. data/lib/wee/core/page.rb +1 -0
  209. data/lib/wee/core/presenter.rb +10 -126
  210. data/lib/wee/core/renderer.rb +23 -0
  211. data/lib/wee/core_ext.rb +122 -0
  212. data/lib/wee/databases/og/scaffolder.rb +0 -1
  213. data/lib/wee/examples/calculator.rb +70 -0
  214. data/lib/wee/examples/counter.rb +33 -0
  215. data/lib/wee/examples/editable_counter.rb +31 -0
  216. data/{examples → lib/wee/examples}/window.rb +29 -23
  217. data/lib/wee/idgen/md5.rb +1 -1
  218. data/lib/wee/idgen/simple.rb +1 -1
  219. data/lib/wee/pageless/session.rb +2 -3
  220. data/lib/wee/renderer/html/brushes.rb +142 -22
  221. data/lib/wee/renderer/html/canvas.rb +57 -19
  222. data/lib/wee/response.rb +3 -2
  223. data/lib/wee/session.rb +10 -54
  224. data/lib/wee/skeleton/og/components/main.rb +5 -1
  225. data/lib/wee/skeleton/og/conf/db.rb +1 -1
  226. data/lib/wee/snapshot_ext.rb +4 -10
  227. data/lib/wee/template.rb +19 -5
  228. data/lib/wee/utils/helper.rb +2 -2
  229. metadata +90 -13
  230. data/examples/calculator.rb +0 -67
  231. data/lib/wee/context.rb +0 -2
@@ -86,7 +86,7 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000271">call</a>&nbsp;&nbsp;
89
+ <a href="#M000343">call</a>&nbsp;&nbsp;
90
90
  </div>
91
91
  </div>
92
92
 
@@ -108,21 +108,21 @@
108
108
  <div id="methods">
109
109
  <h3 class="section-bar">Public Instance methods</h3>
110
110
 
111
- <div id="method-M000271" class="method-detail">
112
- <a name="M000271"></a>
111
+ <div id="method-M000343" class="method-detail">
112
+ <a name="M000343"></a>
113
113
 
114
114
  <div class="method-heading">
115
- <a href="#M000271" class="method-signature">
115
+ <a href="#M000343" class="method-signature">
116
116
  <span class="method-name">call</span><span class="method-args">(*answer_args)</span>
117
117
  </a>
118
118
  </div>
119
119
 
120
120
  <div class="method-description">
121
121
  <p><a class="source-toggle" href="#"
122
- onclick="toggleCode('M000271-source');return false;">[Source]</a></p>
123
- <div class="method-source-code" id="M000271-source">
122
+ onclick="toggleCode('M000343-source');return false;">[Source]</a></p>
123
+ <div class="method-source-code" id="M000343-source">
124
124
  <pre>
125
- <span class="ruby-comment cmt"># File lib/wee/core/component.rb, line 332</span>
125
+ <span class="ruby-comment cmt"># File lib/wee/core/component.rb, line 334</span>
126
126
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">answer_args</span>)
127
127
  <span class="ruby-identifier">calling_component</span>.<span class="ruby-identifier">remove_decoration</span>(<span class="ruby-identifier">delegate</span>)
128
128
  <span class="ruby-identifier">called_component</span>.<span class="ruby-identifier">remove_decoration</span>(<span class="ruby-identifier">answer</span>)
@@ -0,0 +1,289 @@
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::ComponentDispatcher</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::ComponentDispatcher</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/wee/components/component_dispatcher_rb.html">
59
+ lib/wee/components/component_dispatcher.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Component.html">
69
+ Wee::Component
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+
84
+
85
+ </div>
86
+
87
+ <div id="method-list">
88
+ <h3 class="section-bar">Methods</h3>
89
+
90
+ <div class="name-list">
91
+ <a href="#M000359">add_rule</a>&nbsp;&nbsp;
92
+ <a href="#M000362">backtrack_state</a>&nbsp;&nbsp;
93
+ <a href="#M000360">do_render</a>&nbsp;&nbsp;
94
+ <a href="#M000363">match</a>&nbsp;&nbsp;
95
+ <a href="#M000358">new</a>&nbsp;&nbsp;
96
+ <a href="#M000361">process_callbacks</a>&nbsp;&nbsp;
97
+ </div>
98
+ </div>
99
+
100
+ </div>
101
+
102
+
103
+ <!-- if includes -->
104
+
105
+ <div id="section">
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <!-- if method_list -->
115
+ <div id="methods">
116
+ <h3 class="section-bar">Public Class methods</h3>
117
+
118
+ <div id="method-M000358" class="method-detail">
119
+ <a name="M000358"></a>
120
+
121
+ <div class="method-heading">
122
+ <a href="#M000358" class="method-signature">
123
+ <span class="method-name">new</span><span class="method-args">()</span>
124
+ </a>
125
+ </div>
126
+
127
+ <div class="method-description">
128
+ <p><a class="source-toggle" href="#"
129
+ onclick="toggleCode('M000358-source');return false;">[Source]</a></p>
130
+ <div class="method-source-code" id="M000358-source">
131
+ <pre>
132
+ <span class="ruby-comment cmt"># File lib/wee/components/component_dispatcher.rb, line 4</span>
133
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
134
+ <span class="ruby-keyword kw">super</span>()
135
+ <span class="ruby-ivar">@rules</span> = []
136
+ <span class="ruby-ivar">@components</span> = <span class="ruby-constant">Set</span>.<span class="ruby-identifier">new</span>
137
+ <span class="ruby-keyword kw">end</span>
138
+ </pre>
139
+ </div>
140
+ </div>
141
+ </div>
142
+
143
+ <h3 class="section-bar">Public Instance methods</h3>
144
+
145
+ <div id="method-M000359" class="method-detail">
146
+ <a name="M000359"></a>
147
+
148
+ <div class="method-heading">
149
+ <a href="#M000359" class="method-signature">
150
+ <span class="method-name">add_rule</span><span class="method-args">(pattern, component, &amp;block)</span>
151
+ </a>
152
+ </div>
153
+
154
+ <div class="method-description">
155
+ <p><a class="source-toggle" href="#"
156
+ onclick="toggleCode('M000359-source');return false;">[Source]</a></p>
157
+ <div class="method-source-code" id="M000359-source">
158
+ <pre>
159
+ <span class="ruby-comment cmt"># File lib/wee/components/component_dispatcher.rb, line 10</span>
160
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_rule</span>(<span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">component</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
161
+ <span class="ruby-ivar">@components</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">component</span>)
162
+ <span class="ruby-ivar">@rules</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">component</span>, <span class="ruby-identifier">block</span>]
163
+ <span class="ruby-keyword kw">end</span>
164
+ </pre>
165
+ </div>
166
+ </div>
167
+ </div>
168
+
169
+ <div id="method-M000362" class="method-detail">
170
+ <a name="M000362"></a>
171
+
172
+ <div class="method-heading">
173
+ <a href="#M000362" class="method-signature">
174
+ <span class="method-name">backtrack_state</span><span class="method-args">(snapshot)</span>
175
+ </a>
176
+ </div>
177
+
178
+ <div class="method-description">
179
+ <p><a class="source-toggle" href="#"
180
+ onclick="toggleCode('M000362-source');return false;">[Source]</a></p>
181
+ <div class="method-source-code" id="M000362-source">
182
+ <pre>
183
+ <span class="ruby-comment cmt"># File lib/wee/components/component_dispatcher.rb, line 27</span>
184
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backtrack_state</span>(<span class="ruby-identifier">snapshot</span>)
185
+ <span class="ruby-identifier">snapshot</span>.<span class="ruby-identifier">add</span>(<span class="ruby-ivar">@__decoration</span>)
186
+ <span class="ruby-ivar">@components</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">component</span><span class="ruby-operator">|</span>
187
+ <span class="ruby-identifier">component</span>.<span class="ruby-identifier">backtrack_state_chain</span>(<span class="ruby-identifier">snapshot</span>)
188
+ <span class="ruby-keyword kw">end</span>
189
+ <span class="ruby-keyword kw">end</span>
190
+ </pre>
191
+ </div>
192
+ </div>
193
+ </div>
194
+
195
+ <div id="method-M000360" class="method-detail">
196
+ <a name="M000360"></a>
197
+
198
+ <div class="method-heading">
199
+ <a href="#M000360" class="method-signature">
200
+ <span class="method-name">do_render</span><span class="method-args">(rendering_context)</span>
201
+ </a>
202
+ </div>
203
+
204
+ <div class="method-description">
205
+ <p><a class="source-toggle" href="#"
206
+ onclick="toggleCode('M000360-source');return false;">[Source]</a></p>
207
+ <div class="method-source-code" id="M000360-source">
208
+ <pre>
209
+ <span class="ruby-comment cmt"># File lib/wee/components/component_dispatcher.rb, line 15</span>
210
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_render</span>(<span class="ruby-identifier">rendering_context</span>)
211
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">component</span> = <span class="ruby-identifier">match</span>(<span class="ruby-identifier">session</span>.<span class="ruby-identifier">current_context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">info</span>)
212
+ <span class="ruby-identifier">component</span>.<span class="ruby-identifier">do_render_chain</span>(<span class="ruby-identifier">rendering_context</span>)
213
+ <span class="ruby-keyword kw">end</span>
214
+ <span class="ruby-keyword kw">end</span>
215
+ </pre>
216
+ </div>
217
+ </div>
218
+ </div>
219
+
220
+ <div id="method-M000361" class="method-detail">
221
+ <a name="M000361"></a>
222
+
223
+ <div class="method-heading">
224
+ <a href="#M000361" class="method-signature">
225
+ <span class="method-name">process_callbacks</span><span class="method-args">(&amp;block)</span>
226
+ </a>
227
+ </div>
228
+
229
+ <div class="method-description">
230
+ <p><a class="source-toggle" href="#"
231
+ onclick="toggleCode('M000361-source');return false;">[Source]</a></p>
232
+ <div class="method-source-code" id="M000361-source">
233
+ <pre>
234
+ <span class="ruby-comment cmt"># File lib/wee/components/component_dispatcher.rb, line 21</span>
235
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_callbacks</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
236
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">component</span> = <span class="ruby-identifier">match</span>(<span class="ruby-identifier">session</span>.<span class="ruby-identifier">current_context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">info</span>)
237
+ <span class="ruby-identifier">component</span>.<span class="ruby-identifier">process_callbacks_chain</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
238
+ <span class="ruby-keyword kw">end</span>
239
+ <span class="ruby-keyword kw">end</span>
240
+ </pre>
241
+ </div>
242
+ </div>
243
+ </div>
244
+
245
+ <h3 class="section-bar">Protected Instance methods</h3>
246
+
247
+ <div id="method-M000363" class="method-detail">
248
+ <a name="M000363"></a>
249
+
250
+ <div class="method-heading">
251
+ <a href="#M000363" class="method-signature">
252
+ <span class="method-name">match</span><span class="method-args">(info)</span>
253
+ </a>
254
+ </div>
255
+
256
+ <div class="method-description">
257
+ <p><a class="source-toggle" href="#"
258
+ onclick="toggleCode('M000363-source');return false;">[Source]</a></p>
259
+ <div class="method-source-code" id="M000363-source">
260
+ <pre>
261
+ <span class="ruby-comment cmt"># File lib/wee/components/component_dispatcher.rb, line 36</span>
262
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">match</span>(<span class="ruby-identifier">info</span>)
263
+ <span class="ruby-identifier">info</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;&quot;</span>
264
+ <span class="ruby-ivar">@rules</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">component</span>, <span class="ruby-identifier">block</span><span class="ruby-operator">|</span>
265
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">info</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">pattern</span>
266
+ <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">component</span>, <span class="ruby-identifier">$~</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
267
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">component</span>
268
+ <span class="ruby-keyword kw">end</span>
269
+ <span class="ruby-keyword kw">end</span>
270
+ <span class="ruby-keyword kw">nil</span>
271
+ <span class="ruby-keyword kw">end</span>
272
+ </pre>
273
+ </div>
274
+ </div>
275
+ </div>
276
+
277
+
278
+ </div>
279
+
280
+
281
+ </div>
282
+
283
+
284
+ <div id="validator-badges">
285
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
286
+ </div>
287
+
288
+ </body>
289
+ </html>
@@ -0,0 +1,321 @@
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::ComponentRunner</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::ComponentRunner</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/wee/core/componentrunner_rb.html">
59
+ lib/wee/core/componentrunner.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="../Object.html">
69
+ Object
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ <a href="ComponentRunner.html">Wee::ComponentRunner</a> wraps a root
86
+ component and provides methods that act on the components tree defined by
87
+ the root component.
88
+ </p>
89
+
90
+ </div>
91
+
92
+
93
+ </div>
94
+
95
+ <div id="method-list">
96
+ <h3 class="section-bar">Methods</h3>
97
+
98
+ <div class="name-list">
99
+ <a href="#M000147">new</a>&nbsp;&nbsp;
100
+ <a href="#M000150">process_callbacks</a>&nbsp;&nbsp;
101
+ <a href="#M000151">process_callbacks_of</a>&nbsp;&nbsp;
102
+ <a href="#M000149">render</a>&nbsp;&nbsp;
103
+ <a href="#M000148">snapshot</a>&nbsp;&nbsp;
104
+ </div>
105
+ </div>
106
+
107
+ </div>
108
+
109
+
110
+ <!-- if includes -->
111
+
112
+ <div id="section">
113
+
114
+
115
+ <div id="constants-list">
116
+ <h3 class="section-bar">Constants</h3>
117
+
118
+ <div class="name-list">
119
+ <table summary="Constants">
120
+ <tr class="top-aligned-row context-row">
121
+ <td class="context-item-name">DEFAULT_CALLBACK_PROCESSING</td>
122
+ <td>=</td>
123
+ <td class="context-item-value">[ # Invokes all specified input callbacks. NOTE: Input callbacks should never # call other components! [:input, true, false], # Invokes the first found action callback. NOTE: Only the first action # callback is invoked. Any other action callback is ignored. [:action, false, true], # Invoke live_update callback (NOTE: only the first is invoked). [:live_update, false, true]</td>
124
+ <td width="3em">&nbsp;</td>
125
+ <td class="context-item-desc">
126
+ Values are parameters to method <a
127
+ href="ComponentRunner.html#M000151">process_callbacks_of</a>
128
+
129
+ </td>
130
+ </tr>
131
+ </table>
132
+ </div>
133
+ </div>
134
+
135
+
136
+
137
+ <div id="attribute-list">
138
+ <h3 class="section-bar">Attributes</h3>
139
+
140
+ <div class="name-list">
141
+ <table>
142
+ <tr class="top-aligned-row context-row">
143
+ <td class="context-item-name">root_component</td>
144
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
145
+ <td class="context-item-desc"></td>
146
+ </tr>
147
+ </table>
148
+ </div>
149
+ </div>
150
+
151
+
152
+
153
+ <!-- if method_list -->
154
+ <div id="methods">
155
+ <h3 class="section-bar">Public Class methods</h3>
156
+
157
+ <div id="method-M000147" class="method-detail">
158
+ <a name="M000147"></a>
159
+
160
+ <div class="method-heading">
161
+ <a href="#M000147" class="method-signature">
162
+ <span class="method-name">new</span><span class="method-args">(root_component)</span>
163
+ </a>
164
+ </div>
165
+
166
+ <div class="method-description">
167
+ <p><a class="source-toggle" href="#"
168
+ onclick="toggleCode('M000147-source');return false;">[Source]</a></p>
169
+ <div class="method-source-code" id="M000147-source">
170
+ <pre>
171
+ <span class="ruby-comment cmt"># File lib/wee/core/componentrunner.rb, line 23</span>
172
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">root_component</span>)
173
+ <span class="ruby-ivar">@root_component</span> = <span class="ruby-identifier">root_component</span>
174
+ <span class="ruby-ivar">@callback_processing</span> = <span class="ruby-constant">DEFAULT_CALLBACK_PROCESSING</span>
175
+ <span class="ruby-keyword kw">end</span>
176
+ </pre>
177
+ </div>
178
+ </div>
179
+ </div>
180
+
181
+ <h3 class="section-bar">Public Instance methods</h3>
182
+
183
+ <div id="method-M000150" class="method-detail">
184
+ <a name="M000150"></a>
185
+
186
+ <div class="method-heading">
187
+ <a href="#M000150" class="method-signature">
188
+ <span class="method-name">process_callbacks</span><span class="method-args">(callback_stream)</span>
189
+ </a>
190
+ </div>
191
+
192
+ <div class="method-description">
193
+ <p>
194
+ This method triggers several tree traversals to process the callbacks of
195
+ the root component.
196
+ </p>
197
+ <p>
198
+ Returns nil or a <a href="Response.html">Response</a> object in case of a
199
+ premature response.
200
+ </p>
201
+ <p><a class="source-toggle" href="#"
202
+ onclick="toggleCode('M000150-source');return false;">[Source]</a></p>
203
+ <div class="method-source-code" id="M000150-source">
204
+ <pre>
205
+ <span class="ruby-comment cmt"># File lib/wee/core/componentrunner.rb, line 47</span>
206
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_callbacks</span>(<span class="ruby-identifier">callback_stream</span>)
207
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback_stream</span>.<span class="ruby-identifier">all_of_type</span>(<span class="ruby-identifier">:action</span>).<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
208
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Not allowed to specify more than one action callback&quot;</span>
209
+ <span class="ruby-keyword kw">end</span>
210
+
211
+ <span class="ruby-identifier">catch</span>(<span class="ruby-identifier">:wee_abort_callback_processing</span>) {
212
+ <span class="ruby-ivar">@callback_processing</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span> <span class="ruby-identifier">process_callbacks_of</span>(<span class="ruby-identifier">callback_stream</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) }
213
+ <span class="ruby-keyword kw">nil</span>
214
+ }
215
+ <span class="ruby-keyword kw">end</span>
216
+ </pre>
217
+ </div>
218
+ </div>
219
+ </div>
220
+
221
+ <div id="method-M000149" class="method-detail">
222
+ <a name="M000149"></a>
223
+
224
+ <div class="method-heading">
225
+ <a href="#M000149" class="method-signature">
226
+ <span class="method-name">render</span><span class="method-args">(rendering_context)</span>
227
+ </a>
228
+ </div>
229
+
230
+ <div class="method-description">
231
+ <p>
232
+ Render the root component with the given rendering context.
233
+ </p>
234
+ <p><a class="source-toggle" href="#"
235
+ onclick="toggleCode('M000149-source');return false;">[Source]</a></p>
236
+ <div class="method-source-code" id="M000149-source">
237
+ <pre>
238
+ <span class="ruby-comment cmt"># File lib/wee/core/componentrunner.rb, line 38</span>
239
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>(<span class="ruby-identifier">rendering_context</span>)
240
+ <span class="ruby-ivar">@root_component</span>.<span class="ruby-identifier">do_render_chain</span>(<span class="ruby-identifier">rendering_context</span>)
241
+ <span class="ruby-keyword kw">end</span>
242
+ </pre>
243
+ </div>
244
+ </div>
245
+ </div>
246
+
247
+ <div id="method-M000148" class="method-detail">
248
+ <a name="M000148"></a>
249
+
250
+ <div class="method-heading">
251
+ <a href="#M000148" class="method-signature">
252
+ <span class="method-name">snapshot</span><span class="method-args">()</span>
253
+ </a>
254
+ </div>
255
+
256
+ <div class="method-description">
257
+ <p>
258
+ This method takes a snapshot from the current state of the root component
259
+ and returns it.
260
+ </p>
261
+ <p><a class="source-toggle" href="#"
262
+ onclick="toggleCode('M000148-source');return false;">[Source]</a></p>
263
+ <div class="method-source-code" id="M000148-source">
264
+ <pre>
265
+ <span class="ruby-comment cmt"># File lib/wee/core/componentrunner.rb, line 31</span>
266
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">snapshot</span>
267
+ <span class="ruby-ivar">@root_component</span>.<span class="ruby-identifier">backtrack_state_chain</span>(<span class="ruby-identifier">snap</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Snapshot</span>.<span class="ruby-identifier">new</span>)
268
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">snap</span>.<span class="ruby-identifier">freeze</span>
269
+ <span class="ruby-keyword kw">end</span>
270
+ </pre>
271
+ </div>
272
+ </div>
273
+ </div>
274
+
275
+ <h3 class="section-bar">Protected Instance methods</h3>
276
+
277
+ <div id="method-M000151" class="method-detail">
278
+ <a name="M000151"></a>
279
+
280
+ <div class="method-heading">
281
+ <a href="#M000151" class="method-signature">
282
+ <span class="method-name">process_callbacks_of</span><span class="method-args">(callback_stream, type, pass_value=true, once=false)</span>
283
+ </a>
284
+ </div>
285
+
286
+ <div class="method-description">
287
+ <p><a class="source-toggle" href="#"
288
+ onclick="toggleCode('M000151-source');return false;">[Source]</a></p>
289
+ <div class="method-source-code" id="M000151-source">
290
+ <pre>
291
+ <span class="ruby-comment cmt"># File lib/wee/core/componentrunner.rb, line 60</span>
292
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_callbacks_of</span>(<span class="ruby-identifier">callback_stream</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">pass_value</span>=<span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">once</span>=<span class="ruby-keyword kw">false</span>)
293
+ <span class="ruby-ivar">@root_component</span>.<span class="ruby-identifier">process_callbacks_chain</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">this</span><span class="ruby-operator">|</span>
294
+ <span class="ruby-identifier">callback_stream</span>.<span class="ruby-identifier">with_callbacks_for</span>(<span class="ruby-identifier">this</span>, <span class="ruby-identifier">type</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">callback</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
295
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pass_value</span>
296
+ <span class="ruby-identifier">callback</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">value</span>)
297
+ <span class="ruby-keyword kw">else</span>
298
+ <span class="ruby-identifier">callback</span>.<span class="ruby-identifier">call</span>
299
+ <span class="ruby-keyword kw">end</span>
300
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">once</span>
301
+ }
302
+ }
303
+ <span class="ruby-keyword kw">end</span>
304
+ </pre>
305
+ </div>
306
+ </div>
307
+ </div>
308
+
309
+
310
+ </div>
311
+
312
+
313
+ </div>
314
+
315
+
316
+ <div id="validator-badges">
317
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
318
+ </div>
319
+
320
+ </body>
321
+ </html>