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
@@ -0,0 +1,114 @@
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>Module: Wee::Rails</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>Module</strong></td>
53
+ <td class="class-name-in-header">Wee::Rails</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/wee/adaptors/rails_rb.html">
59
+ lib/wee/adaptors/rails.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+
80
+ </div>
81
+
82
+
83
+ <!-- if includes -->
84
+
85
+ <div id="section">
86
+
87
+ <div id="class-list">
88
+ <h3 class="section-bar">Classes and Modules</h3>
89
+
90
+ Module <a href="Rails/ControllerClassMixin.html" class="link">Wee::Rails::ControllerClassMixin</a><br />
91
+ Module <a href="Rails/ControllerMixin.html" class="link">Wee::Rails::ControllerMixin</a><br />
92
+ Class <a href="Rails/FormTag.html" class="link">Wee::Rails::FormTag</a><br />
93
+ Class <a href="Rails/HtmlCanvasRenderer.html" class="link">Wee::Rails::HtmlCanvasRenderer</a><br />
94
+
95
+ </div>
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ <!-- if method_list -->
104
+
105
+
106
+ </div>
107
+
108
+
109
+ <div id="validator-badges">
110
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
111
+ </div>
112
+
113
+ </body>
114
+ </html>
@@ -0,0 +1,192 @@
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>Module: Wee::Rails::ControllerClassMixin</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>Module</strong></td>
53
+ <td class="class-name-in-header">Wee::Rails::ControllerClassMixin</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/wee/adaptors/rails_rb.html">
59
+ lib/wee/adaptors/rails.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000105">register_component</a>&nbsp;&nbsp;
84
+ <a href="#M000106">registered_components</a>&nbsp;&nbsp;
85
+ <a href="#M000107">scaffold_with_component</a>&nbsp;&nbsp;
86
+ </div>
87
+ </div>
88
+
89
+ </div>
90
+
91
+
92
+ <!-- if includes -->
93
+
94
+ <div id="section">
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ <!-- if method_list -->
104
+ <div id="methods">
105
+ <h3 class="section-bar">Public Instance methods</h3>
106
+
107
+ <div id="method-M000105" class="method-detail">
108
+ <a name="M000105"></a>
109
+
110
+ <div class="method-heading">
111
+ <a href="#M000105" class="method-signature">
112
+ <span class="method-name">register_component</span><span class="method-args">(name, &amp;block)</span>
113
+ </a>
114
+ </div>
115
+
116
+ <div class="method-description">
117
+ <p><a class="source-toggle" href="#"
118
+ onclick="toggleCode('M000105-source');return false;">[Source]</a></p>
119
+ <div class="method-source-code" id="M000105-source">
120
+ <pre>
121
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 62</span>
122
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register_component</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
123
+ <span class="ruby-identifier">registered_components</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">block</span>
124
+ <span class="ruby-keyword kw">end</span>
125
+ </pre>
126
+ </div>
127
+ </div>
128
+ </div>
129
+
130
+ <div id="method-M000106" class="method-detail">
131
+ <a name="M000106"></a>
132
+
133
+ <div class="method-heading">
134
+ <a href="#M000106" class="method-signature">
135
+ <span class="method-name">registered_components</span><span class="method-args">()</span>
136
+ </a>
137
+ </div>
138
+
139
+ <div class="method-description">
140
+ <p><a class="source-toggle" href="#"
141
+ onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
142
+ <div class="method-source-code" id="M000106-source">
143
+ <pre>
144
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 66</span>
145
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">registered_components</span>
146
+ <span class="ruby-ivar">@@registered_components</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
147
+ <span class="ruby-keyword kw">end</span>
148
+ </pre>
149
+ </div>
150
+ </div>
151
+ </div>
152
+
153
+ <div id="method-M000107" class="method-detail">
154
+ <a name="M000107"></a>
155
+
156
+ <div class="method-heading">
157
+ <a href="#M000107" class="method-signature">
158
+ <span class="method-name">scaffold_with_component</span><span class="method-args">(name=nil, &amp;block)</span>
159
+ </a>
160
+ </div>
161
+
162
+ <div class="method-description">
163
+ <p><a class="source-toggle" href="#"
164
+ onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
165
+ <div class="method-source-code" id="M000107-source">
166
+ <pre>
167
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 70</span>
168
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scaffold_with_component</span>(<span class="ruby-identifier">name</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
169
+ <span class="ruby-identifier">name</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span>
170
+ <span class="ruby-identifier">register_component</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
171
+ <span class="ruby-identifier">send</span>(<span class="ruby-identifier">:define_method</span>, <span class="ruby-identifier">:index</span>) <span class="ruby-keyword kw">do</span>
172
+ <span class="ruby-identifier">show_component</span> <span class="ruby-identifier">name</span>
173
+ <span class="ruby-keyword kw">end</span>
174
+ <span class="ruby-keyword kw">end</span>
175
+ </pre>
176
+ </div>
177
+ </div>
178
+ </div>
179
+
180
+
181
+ </div>
182
+
183
+
184
+ </div>
185
+
186
+
187
+ <div id="validator-badges">
188
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
189
+ </div>
190
+
191
+ </body>
192
+ </html>
@@ -0,0 +1,342 @@
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>Module: Wee::Rails::ControllerMixin</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>Module</strong></td>
53
+ <td class="class-name-in-header">Wee::Rails::ControllerMixin</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/wee/adaptors/rails_rb.html">
59
+ lib/wee/adaptors/rails.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000102">_show_component</a>&nbsp;&nbsp;
84
+ <a href="#M000098">callback</a>&nbsp;&nbsp;
85
+ <a href="#M000104">components</a>&nbsp;&nbsp;
86
+ <a href="#M000100">drop_component</a>&nbsp;&nbsp;
87
+ <a href="#M000101">has_component?</a>&nbsp;&nbsp;
88
+ <a href="#M000097">included</a>&nbsp;&nbsp;
89
+ <a href="#M000099">make_component</a>&nbsp;&nbsp;
90
+ <a href="#M000103">show_component</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-M000097" class="method-detail">
113
+ <a name="M000097"></a>
114
+
115
+ <div class="method-heading">
116
+ <a href="#M000097" class="method-signature">
117
+ <span class="method-name">included</span><span class="method-args">(klass)</span>
118
+ </a>
119
+ </div>
120
+
121
+ <div class="method-description">
122
+ <p><a class="source-toggle" href="#"
123
+ onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
124
+ <div class="method-source-code" id="M000097-source">
125
+ <pre>
126
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 81</span>
127
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">klass</span>)
128
+ <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-constant">ControllerClassMixin</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-M000098" class="method-detail">
138
+ <a name="M000098"></a>
139
+
140
+ <div class="method-heading">
141
+ <a href="#M000098" class="method-signature">
142
+ <span class="method-name">callback</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('M000098-source');return false;">[Source]</a></p>
149
+ <div class="method-source-code" id="M000098-source">
150
+ <pre>
151
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 87</span>
152
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">callback</span>
153
+ <span class="ruby-identifier">c</span> = <span class="ruby-identifier">components</span>[<span class="ruby-ivar">@params</span>[<span class="ruby-value str">'__c'</span>]]
154
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;no component found&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
155
+ <span class="ruby-identifier">callback_stream</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">CallbackStream</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">c</span>.<span class="ruby-identifier">callbacks</span>, <span class="ruby-ivar">@params</span>)
156
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">process_callbacks</span>(<span class="ruby-identifier">callback_stream</span>)
157
+ <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> (<span class="ruby-ivar">@params</span>[<span class="ruby-value str">'__a'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;index&quot;</span>)
158
+ <span class="ruby-keyword kw">end</span>
159
+ </pre>
160
+ </div>
161
+ </div>
162
+ </div>
163
+
164
+ <h3 class="section-bar">Protected Instance methods</h3>
165
+
166
+ <div id="method-M000102" class="method-detail">
167
+ <a name="M000102"></a>
168
+
169
+ <div class="method-heading">
170
+ <a href="#M000102" class="method-signature">
171
+ <span class="method-name">_show_component</span><span class="method-args">(name, hash={}, out='')</span>
172
+ </a>
173
+ </div>
174
+
175
+ <div class="method-description">
176
+ <p><a class="source-toggle" href="#"
177
+ onclick="toggleCode('M000102-source');return false;">[Source]</a></p>
178
+ <div class="method-source-code" id="M000102-source">
179
+ <pre>
180
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 117</span>
181
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_show_component</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">hash</span>={}, <span class="ruby-identifier">out</span>=<span class="ruby-value str">''</span>)
182
+ <span class="ruby-identifier">cb</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">CallbackRegistry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">SimpleIdGenerator</span>.<span class="ruby-identifier">new</span>)
183
+ <span class="ruby-identifier">ctx</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-ivar">@response</span>, <span class="ruby-ivar">@session</span>)
184
+ <span class="ruby-identifier">rctx</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">RenderingContext</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ctx</span>, <span class="ruby-identifier">cb</span>, <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">HtmlWriter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">out</span>))
185
+ <span class="ruby-identifier">rctx</span>.<span class="ruby-identifier">component_name</span> = <span class="ruby-identifier">name</span>
186
+ <span class="ruby-identifier">rctx</span>.<span class="ruby-identifier">controller</span> = <span class="ruby-keyword kw">self</span>
187
+ <span class="ruby-identifier">rctx</span>.<span class="ruby-identifier">redirect_action</span> = <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:redirect_action</span>]
188
+
189
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">c</span> = <span class="ruby-identifier">components</span>[<span class="ruby-identifier">name</span>]
190
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">registered_components</span>[<span class="ruby-identifier">name</span>]
191
+ <span class="ruby-identifier">make_component</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>
192
+ <span class="ruby-identifier">c</span> = <span class="ruby-identifier">components</span>[<span class="ruby-identifier">name</span>]
193
+ <span class="ruby-keyword kw">end</span>
194
+ <span class="ruby-keyword kw">end</span>
195
+
196
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;component #{ name } not found&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
197
+
198
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">render</span>(<span class="ruby-identifier">rctx</span>)
199
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">callbacks</span> = <span class="ruby-identifier">cb</span>
200
+ <span class="ruby-identifier">out</span>
201
+ <span class="ruby-keyword kw">end</span>
202
+ </pre>
203
+ </div>
204
+ </div>
205
+ </div>
206
+
207
+ <div id="method-M000104" class="method-detail">
208
+ <a name="M000104"></a>
209
+
210
+ <div class="method-heading">
211
+ <a href="#M000104" class="method-signature">
212
+ <span class="method-name">components</span><span class="method-args">()</span>
213
+ </a>
214
+ </div>
215
+
216
+ <div class="method-description">
217
+ <p><a class="source-toggle" href="#"
218
+ onclick="toggleCode('M000104-source');return false;">[Source]</a></p>
219
+ <div class="method-source-code" id="M000104-source">
220
+ <pre>
221
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 143</span>
222
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">components</span>
223
+ <span class="ruby-ivar">@session</span>[<span class="ruby-identifier">:COMPONENTS</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
224
+ <span class="ruby-keyword kw">end</span>
225
+ </pre>
226
+ </div>
227
+ </div>
228
+ </div>
229
+
230
+ <div id="method-M000100" class="method-detail">
231
+ <a name="M000100"></a>
232
+
233
+ <div class="method-heading">
234
+ <a href="#M000100" class="method-signature">
235
+ <span class="method-name">drop_component</span><span class="method-args">(name)</span>
236
+ </a>
237
+ </div>
238
+
239
+ <div class="method-description">
240
+ <p><a class="source-toggle" href="#"
241
+ onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
242
+ <div class="method-source-code" id="M000100-source">
243
+ <pre>
244
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 105</span>
245
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop_component</span>(<span class="ruby-identifier">name</span>)
246
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">components</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">name</span>)
247
+ <span class="ruby-identifier">components</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">name</span>)
248
+ <span class="ruby-keyword kw">else</span>
249
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;component #{ name } not found&quot;</span>
250
+ <span class="ruby-keyword kw">end</span>
251
+ <span class="ruby-keyword kw">end</span>
252
+ </pre>
253
+ </div>
254
+ </div>
255
+ </div>
256
+
257
+ <div id="method-M000101" class="method-detail">
258
+ <a name="M000101"></a>
259
+
260
+ <div class="method-heading">
261
+ <a href="#M000101" class="method-signature">
262
+ <span class="method-name">has_component?</span><span class="method-args">(name)</span>
263
+ </a>
264
+ </div>
265
+
266
+ <div class="method-description">
267
+ <p><a class="source-toggle" href="#"
268
+ onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
269
+ <div class="method-source-code" id="M000101-source">
270
+ <pre>
271
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 113</span>
272
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_component?</span>(<span class="ruby-identifier">name</span>)
273
+ <span class="ruby-identifier">components</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">name</span>)
274
+ <span class="ruby-keyword kw">end</span>
275
+ </pre>
276
+ </div>
277
+ </div>
278
+ </div>
279
+
280
+ <div id="method-M000099" class="method-detail">
281
+ <a name="M000099"></a>
282
+
283
+ <div class="method-heading">
284
+ <a href="#M000099" class="method-signature">
285
+ <span class="method-name">make_component</span><span class="method-args">(name, obj)</span>
286
+ </a>
287
+ </div>
288
+
289
+ <div class="method-description">
290
+ <p><a class="source-toggle" href="#"
291
+ onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
292
+ <div class="method-source-code" id="M000099-source">
293
+ <pre>
294
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 97</span>
295
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_component</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>)
296
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">components</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">name</span>)
297
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;disallowed to overwrite component #{ name }&quot;</span>
298
+ <span class="ruby-keyword kw">else</span>
299
+ <span class="ruby-identifier">components</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">PagelessComponentDriver</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">CallbackRegistry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">SimpleIdGenerator</span>.<span class="ruby-identifier">new</span>))
300
+ <span class="ruby-keyword kw">end</span>
301
+ <span class="ruby-keyword kw">end</span>
302
+ </pre>
303
+ </div>
304
+ </div>
305
+ </div>
306
+
307
+ <div id="method-M000103" class="method-detail">
308
+ <a name="M000103"></a>
309
+
310
+ <div class="method-heading">
311
+ <a href="#M000103" class="method-signature">
312
+ <span class="method-name">show_component</span><span class="method-args">(name, hash={})</span>
313
+ </a>
314
+ </div>
315
+
316
+ <div class="method-description">
317
+ <p><a class="source-toggle" href="#"
318
+ onclick="toggleCode('M000103-source');return false;">[Source]</a></p>
319
+ <div class="method-source-code" id="M000103-source">
320
+ <pre>
321
+ <span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 139</span>
322
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_component</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">hash</span>={})
323
+ <span class="ruby-identifier">render_text</span>(<span class="ruby-identifier">_show_component</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">hash</span>))
324
+ <span class="ruby-keyword kw">end</span>
325
+ </pre>
326
+ </div>
327
+ </div>
328
+ </div>
329
+
330
+
331
+ </div>
332
+
333
+
334
+ </div>
335
+
336
+
337
+ <div id="validator-badges">
338
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
339
+ </div>
340
+
341
+ </body>
342
+ </html>