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
data/ChangeLog CHANGED
@@ -1,3 +1,289 @@
1
+ --------------------------------------------------------------------
2
+ TAGGED 0.9.0
3
+ --------------------------------------------------------------------
4
+
5
+ Mon Jul 11 23:31:31 CEST 2005 Michael Neumann <mneumann@ntecs.de>
6
+
7
+ * examples/*: Lots of cleanup. New examples added.
8
+
9
+ Mon Jul 11 23:18:17 CEST 2005 Michael Neumann <mneumann@ntecs.de>
10
+
11
+ * lib/wee/components/pager.rb, lib/wee/examples/pager.rb: Moved from examples
12
+ into components directory. Slightly modified. Now class Wee::Pager.
13
+
14
+ * lib/wee/components/login_decoration.rb (Wee::LoginDecoration): Initial
15
+ import.
16
+
17
+ * lib/wee/components/component_dispatcher.rb (Wee::ComponentDispatcher):
18
+ Initial creation.
19
+
20
+ * lib/wee/components.rb: Load new components.
21
+
22
+ * lib/wee/renderer/html/{brushes,canvas}.rb: Introduced
23
+ r.anchor.info(info_url) which can be used to specify the info part of a
24
+ URL.
25
+
26
+ Mon Jul 11 19:29:44 CEST 2005 Michael Neumann <mneumann@ntecs.de>
27
+
28
+ * lib/wee/renderer/html/{brushes,canvas}.rb: Added #hidden_input.
29
+
30
+ * lib/wee/adaptors/rails.rb: fixed some bugs. minor refactoring.
31
+
32
+ * lib/wee/adaptors/nitro.rb, examples/nitro/*: initial creation.
33
+
34
+ Mon Jul 11 17:02:40 CEST 2005 Michael Neumann <mneumann@ntecs.de>
35
+
36
+ * lib/wee.rb (Wee.run): Added method for easy startup of components.
37
+
38
+ * lib/wee/application.rb: Method Application#insert_new_request_handler
39
+ added. Refactored #handle_request a bit.
40
+
41
+ Mon Jul 11 16:06:49 CEST 2005 Michael Neumann <mneumann@ntecs.de>
42
+
43
+ * lib/wee/snapshot_ext.rb: refactored. enhanced Hash to be snapshotable.
44
+
45
+ * lib/wee/session.rb: fixed two bugs I lately introduced during refactoring
46
+
47
+ * lib/wee/renderer/html/canvas.rb: added r.label
48
+
49
+ * lib/wee/examples/{pager,counter,editable_counter,calculator}.rb:
50
+ moved components from examples directory into Wee base.
51
+
52
+ * lib/wee.rb: increased version to 0.9.0. Introduced module Wee::Examples.
53
+
54
+ * lib/wee/skeleton/og/components/main.rb: Minor cleanup.
55
+
56
+ * lib/wee/databases/og/scaffolder.rb: removed whitespace.
57
+
58
+ Sat Jul 2 17:48:00 CEST 2005 Michael Neumann <mneumann@ntecs.de>
59
+
60
+ * lib/wee/adaptors/rails.rb: Integrate Wee components into RubyOnRails.
61
+ Very simple example:
62
+
63
+ ##
64
+ # In config/environment.rb add:
65
+
66
+ require 'wee'
67
+ require 'wee/adaptors/rails'
68
+ require 'components/mycomponent'
69
+
70
+ ##
71
+ # In components/mycomponent.rb:
72
+
73
+ class MyComponent < Wee::Component
74
+ # ... your Wee component ...
75
+ end
76
+
77
+ ##
78
+ # In app/controllers/wee_controller.rb:
79
+
80
+ class WeeController < ApplicationController
81
+ include Wee::Rails::ControllerMixin
82
+
83
+ register_component "my" do
84
+ MyComponent.new
85
+ end
86
+ end
87
+
88
+ ##
89
+ # In app/views/index.rhtml:
90
+
91
+ <html><body>
92
+ <%= show_component 'my' %>
93
+ </body></html>
94
+
95
+ Of course you can render as many components as you like on one page.
96
+ You can create components dynamically at runtime with:
97
+
98
+ make_component component_name, component_object
99
+
100
+ For example instead of using 'register_component' in the WeeController
101
+ shown above, you could write:
102
+
103
+ def index
104
+ make_component('my', MyComponent.new) unless has_component?('my')
105
+ # render the view
106
+ end
107
+
108
+ If you don't need the component anymore, drop it:
109
+
110
+ drop_component 'my'
111
+
112
+ If you want to map 1:1 a Wee::Component to an ActionController, you can
113
+ use:
114
+
115
+ class WeeController < ApplicationController
116
+ include Wee::Rails::ControllerMixin
117
+
118
+ scaffold_with_component do
119
+ MyComponent.new
120
+ end
121
+ end
122
+
123
+ At the moment, only pageless mode is possible, so no backtracking is
124
+ performed.
125
+
126
+ NOTE: Your Wee components must be fully marshallable to work with Rails
127
+ CGI mode. That means, you are not allowed to use continuations, and no
128
+ code blocks (callbacks). For example instead of:
129
+
130
+ r.anchor.callback { answer true }
131
+
132
+ You have to write:
133
+
134
+ r.anchor.callback(:answer, true)
135
+
136
+ Or more general:
137
+
138
+ r.anchor.callback(Wee::LiteralMethodCallback.new(self, :answer, true))
139
+
140
+ * lib/wee/renderer/html/brushes.rb, lib/wee/renderer/html/canvas.rb: Use
141
+ method Canvas#build_url instead of Request#build_url. This makes it
142
+ independent of the Request class. To use a different URL builder, simply
143
+ overwrite Canvas#build_url.
144
+
145
+ * lib/wee/session.rb, lib/wee/core/context.rb, lib/wee/core_ext.rb:
146
+ Wee::RenderingContext now uses #context instead of #request, #response and
147
+ #session. This makes it easy to reuse the Context class of other
148
+ frameworks like Nitro or Rails.
149
+
150
+ * lib/wee/components/messagebox.rb: do not use blocks -> fully marshallable
151
+
152
+ Thu Jun 30 13:23:47 CEST 2005 Michael Neumann <mneumann@ntecs.de>
153
+
154
+ * lib/wee/session.rb, lib/wee/core/componentrunner.rb, lib/wee/core.rb,
155
+ lib/wee/utils/helper.rb, lib/wee/pageless/session.rb: Refactored component
156
+ specific stuff (rendering, snapshots, callback processing) out of session
157
+ into core class ComponentRunner.
158
+
159
+ * lib/wee/renderer/html/canvas.rb: fixed bug
160
+
161
+ Thu Jun 30 12:55:54 CEST 2005 Michael Neumann <mneumann@ntecs.de>
162
+
163
+ * lib/wee/core/context.rb: forgot to add this file
164
+
165
+ Thu Jun 30 12:53:59 CEST 2005 Michael Neumann <mneumann@ntecs.de>
166
+
167
+ * lib/wee/session.rb, lib/wee/context.rb, lib/wee/core/renderingcontext.rb,
168
+ lib/wee/core.rb, lib/wee/core_ext.rb, lib/wee.rb: Moved Wee::Context into
169
+ core. Wee::Context gets an additional field 'session', and
170
+ Wee::RenderingContext inherits from Wee::Context.
171
+
172
+ Thu Jun 30 12:38:25 CEST 2005 Michael Neumann <mneumann@ntecs.de>
173
+
174
+ * lib/wee/response.rb: require 'cgi'
175
+
176
+ Thu Jun 30 12:36:18 CEST 2005 Michael Neumann <mneumann@ntecs.de>
177
+
178
+ * lib/wee/response.rb (Wee::ErrorResponse#render): correctly format error
179
+ responses (patch by Aleksi Niemela)
180
+
181
+ Thu Jun 30 12:10:36 CEST 2005 Michael Neumann <mneumann@ntecs.de>
182
+
183
+ * lib/wee/core.rb, lib/wee/core/idgen.rb, lib/wee/idgen/md5.rb,
184
+ lib/wee/idgen/simple.rb: Introduced abstract class Wee::IdGenerator
185
+ and subclass Wee::Md5IdGenerator and Wee::SimpleIdGenerator from it.
186
+
187
+ * lib/wee/core/renderer.rb, lib/wee/core/presenter.rb,
188
+ lib/wee/renderer/html/canvas.rb, lib/wee.rb:
189
+ Introduce base class of all renderer classes: Wee::Renderer.
190
+
191
+ Rename Wee::HtmlCanvas to Wee::HtmlCanvasRenderer and inherit from
192
+ Wee::Renderer instead of Wee::Canvas. Wee::Canvas is now a mixin
193
+ module as has been renamed to Wee::CanvasMixin.
194
+
195
+ Rename @renderer in Wee::Presenter into @__renderer to avoid
196
+ possible problems if this variable is accidently used by a
197
+ user-defined component.
198
+
199
+ * lib/wee/template.rb: Added :local option, with which one can
200
+ specify a template file relative to the component file, e.g:
201
+
202
+ class MyComponent < Wee::Component
203
+ template :render_this, :local => 'this.tmpl'
204
+ end
205
+
206
+ Futhermore, added an :r_as_param option, which generates a render
207
+ method that takes a renderer object as parameter 'r'.
208
+
209
+ * lib/wee/renderer/html/brushes.rb, lib/wee/renderer/html/canvas.rb:
210
+ Method Brush::SelectListTag#selected takes optionally a block. In
211
+ this case, only those elements will be selected, for which the block
212
+ evaluates to true. This allows us to use some custom compare
213
+ functions instead of the default ones '==' or 'include?'.
214
+
215
+ Method Brush::SelectListTag#labels also might be passed a block, in
216
+ which case the label is the return value of the block called with
217
+ the corresponding item as parameter.
218
+
219
+ Added class Brush::CheckboxTag and corresponding methods
220
+ HtmlCanvas#check_box and alias #checkbox.
221
+
222
+ Method HtmlCanvas#paragraph is no longer a single tag. It can now
223
+ contain other tags, e.g. like <p><a .../></p>.
224
+
225
+ Added method HtmlCanvas#multiline_text, which replaces newline
226
+ characters (\n) in the text with <br/> tags.
227
+
228
+ * lib/wee/page.rb, lib/wee/core/page.rb: Page classes moved into core.
229
+
230
+ * lib/wee/session.rb: remove require 'wee/page' as this now has been
231
+ moved into the core and is automatically required from there.
232
+
233
+ * lib/wee/context.rb, lib/wee/core/renderingcontext.rb: Moved
234
+ RenderingContext class into core.
235
+
236
+ * lib/wee/core/presenter.rb, lib/wee/core_ext.rb: Moved some stuff
237
+ from the Presenter class out of the core.
238
+
239
+ * lib/wee.rb, lib/wee/core.rb: adapt "require"s to the changed
240
+ situation.
241
+
242
+ * lib/wee/session.rb lib/wee/pageless/session.rb: renamed method
243
+ #invoke_callbacks into #process_callbacks and refactored that method a
244
+ lot.
245
+
246
+ * lib/wee/core/presenter.rb, lib/wee/session.rb: removed
247
+ throwing of :wee_send_response, instead use
248
+ :wee_abort_callback_processing
249
+
250
+ * lib/wee/core/component.rb, lib/wee/continuation/core/component.rb,
251
+ lib/wee/session.rb: renamed :wee_back_to_session into
252
+ :wee_abort_callback_processing.
253
+
254
+ * lib/wee/core/component.rb: Reverted commit from
255
+ Thu Mar 3 12:11:05 CET 2005. Removed method Component#parent,
256
+ modified method #add_child.
257
+
258
+ * lib/wee/skeleton/og/conf/db.rb: Upgrade to run under newer Og version.
259
+
260
+ Sun May 22 18:10:27 CET 2005 Michael Neumann <mneumann@ntecs.de>
261
+
262
+ * lib/wee/continuation/session.rb: Fixed a bug. Callbacks were invoked
263
+ twice, due to a super() call was calling the "wrong" super-method,
264
+ which did the same as the calling method (the right super-method would
265
+ have been super.super(), but this is actually not possible in Ruby
266
+ without renaming).
267
+
268
+ Wed Apr 6 19:17:47 CET 2005 Michael Neumann <mneumann@ntecs.de>
269
+
270
+ * lib/wee/session.rb: introduced live_update callbacks, which are special
271
+ action callbacks that are processed after any action callback.
272
+
273
+ * lib/wee/renderer/html/canvas.rb, lib/wee/renderer/html/brushes.rb:
274
+ - You can now use #value of textarea fields instead of #with.
275
+ - Implemented form.onsubmit_update method
276
+
277
+ Tue Apr 5 21:53:55 CET 2005 Michael Neumann <mneumann@ntecs.de>
278
+
279
+ * lib/wee/renderer/html/canvas.rb, lib/wee/renderer/html/brushes.rb,
280
+ examples/radio.rb: Added support for radio buttons.
281
+ (methods r.new_radio_group and r.radio_button)
282
+
283
+ --------------------------------------------------------------------
284
+ TAGGED 0.8.0
285
+ --------------------------------------------------------------------
286
+
1
287
  Mon Apr 4 18:45:28 CET 2005 Michael Neumann <mneumann@ntecs.de>
2
288
 
3
289
  * examples/ajax/ajax.rb, examples/ajax/ajax.js,
@@ -0,0 +1,185 @@
1
+ = New in 0.9.0
2
+
3
+ == Nitro/Rails integration
4
+
5
+ Wee can now be used from within Nitro or Rails, but with limited functionality.
6
+
7
+ A brief example using Nitro+Wee:
8
+
9
+ require 'wee'
10
+ require 'wee/adaptors/nitro'
11
+ require 'wee/examples/calculator'
12
+ require 'nitro'
13
+ require 'nitro/contoller'
14
+
15
+ class AppController < Nitro::Controller
16
+ include Wee::Nitro::ControllerMixin
17
+
18
+ scaffold_with_component do
19
+ Wee::Examples::Calculator.new.
20
+ add_decoration(Wee::FormDecoration.new).
21
+ add_decoration(Wee::PageDecoration.new('Hello from Wee/Nitro!'))
22
+ end
23
+ end
24
+
25
+ Nitro.run(:host => '127.0.0.1', :port => 9999, :dispatcher => Nitro::Dispatcher.new('/app' => AppController))
26
+
27
+ How to use Rails+Wee (most stuff applies to Nitro as well):
28
+
29
+ ##
30
+ # In config/environment.rb add:
31
+
32
+ require 'wee'
33
+ require 'wee/adaptors/rails'
34
+ require 'components/mycomponent'
35
+
36
+ ##
37
+ # In components/mycomponent.rb:
38
+
39
+ class MyComponent < Wee::Component
40
+ # ... your Wee component ...
41
+ end
42
+
43
+ ##
44
+ # In app/controllers/wee_controller.rb:
45
+
46
+ class WeeController < ApplicationController
47
+ include Wee::Rails::ControllerMixin
48
+
49
+ register_component "my" do
50
+ MyComponent.new
51
+ end
52
+ end
53
+
54
+ ##
55
+ # In app/views/index.rhtml:
56
+
57
+ <html><body>
58
+ <%= show_component 'my' %>
59
+ </body></html>
60
+
61
+ Of course you can render as many components as you like on one page.
62
+ You can create components dynamically at runtime with:
63
+
64
+ make_component component_name, component_object
65
+
66
+ For example instead of using 'register_component' in the WeeController
67
+ shown above, you could write:
68
+
69
+ def index
70
+ make_component('my', MyComponent.new) unless has_component?('my')
71
+ # render the view
72
+ end
73
+
74
+ If you don't need the component anymore, drop it:
75
+
76
+ drop_component 'my'
77
+
78
+ If you want to map 1:1 a Wee::Component to an ActionController, you can
79
+ use:
80
+
81
+ class WeeController < ApplicationController
82
+ include Wee::Rails::ControllerMixin
83
+
84
+ scaffold_with_component do
85
+ MyComponent.new
86
+ end
87
+ end
88
+
89
+ At the moment, only pageless mode is possible, so no backtracking is
90
+ performed.
91
+
92
+ NOTE: Your Wee components must be fully marshallable to work with Rails
93
+ CGI mode. That means, you are not allowed to use continuations, and no
94
+ code blocks (callbacks). For example instead of:
95
+
96
+ r.anchor.callback { answer true }
97
+
98
+ You have to write:
99
+
100
+ r.anchor.callback(:answer, true)
101
+
102
+ Or more general:
103
+
104
+ r.anchor.callback(Wee::LiteralMethodCallback.new(self, :answer, true))
105
+
106
+ == Changes in Html renderer
107
+
108
+ * r.label # => <label>...</label>
109
+
110
+ * r.hidden_input # => <input type="hidden" ...>
111
+
112
+ * r.anchor.info(info_url) # => <a href="/app/info_url/session_id/page_id">
113
+
114
+ * Added support for radio buttons (methods r.new_radio_group and r.radio_button)
115
+
116
+ * You can now use #value of textarea fields instead of #with.
117
+
118
+ * Implemented r.form.onsubmit_update method
119
+
120
+ * Method Brush::SelectListTag#selected takes optionally a block. In
121
+ this case, only those elements will be selected, for which the block
122
+ evaluates to true. This allows us to use some custom compare
123
+ functions instead of the default ones '==' or 'include?'.
124
+
125
+ * Method Brush::SelectListTag#labels also might be passed a block, in
126
+ which case the label is the return value of the block called with
127
+ the corresponding item as parameter.
128
+
129
+ * Added class Brush::CheckboxTag and corresponding methods
130
+ HtmlCanvas#check_box and alias #checkbox.
131
+
132
+ * Method HtmlCanvas#paragraph is no longer a single tag. It can now
133
+ contain other tags, e.g. like <p><a .../></p>.
134
+
135
+ * Added method HtmlCanvas#multiline_text, which replaces newline
136
+ characters (\n) in the text with <br/> tags.
137
+
138
+ == Changes in Templating
139
+
140
+ * Added :local option, with which one can
141
+ specify a template file relative to the component file, e.g:
142
+
143
+ class MyComponent < Wee::Component
144
+ template :render_this, :local => 'this.tmpl'
145
+ end
146
+
147
+ Futhermore, added an :r_as_param option, which generates a render
148
+ method that takes a renderer object as parameter 'r'.
149
+
150
+ == New components
151
+
152
+ * Wee::LoginDecoration
153
+
154
+ * Wee::ComponentDispatcher
155
+ For an example see examples/dispatcher.rb
156
+
157
+ * Wee::Pager
158
+
159
+ * Wee::Examples::Counter
160
+ You need to require 'wee/examples/counter'
161
+
162
+ * Wee::Examples::EditableCounter
163
+ You need to require 'wee/examples/editable_counter'
164
+
165
+ * Wee::Examples::Calculator
166
+ You need to require 'wee/examples/calculator'
167
+
168
+ == New Examples
169
+
170
+ * examples/dispatcher.rb
171
+ * examples/nitro/*
172
+ * examples/demo.rb
173
+ * examples/radio.rb
174
+
175
+ = Hello World
176
+
177
+ require 'wee'
178
+
179
+ class HelloWorld < Wee::Component
180
+ def render
181
+ r.h1 "Hello world!"
182
+ end
183
+ end
184
+
185
+ Wee.run(HelloWorld)