wee 0.10.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +127 -0
- data/Rakefile +11 -32
- data/doc/rdoc/classes/Array.html +28 -24
- data/doc/rdoc/classes/Hash.html +28 -24
- data/doc/rdoc/classes/Object.html +37 -84
- data/doc/rdoc/classes/String.html +89 -21
- data/doc/rdoc/classes/Struct.html +32 -82
- data/doc/rdoc/classes/Wee.html +285 -86
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +111 -48
- data/doc/rdoc/classes/Wee/{Context.html → AnswerDecoration/Answer.html} +61 -51
- data/doc/rdoc/classes/Wee/Application.html +161 -322
- data/doc/rdoc/classes/Wee/Application/SessionCache.html +162 -0
- data/doc/rdoc/classes/Wee/Brush.html +147 -62
- data/doc/rdoc/classes/{Enumerable.html → Wee/Brush/ActionInputTag.html} +68 -41
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +150 -100
- data/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +132 -46
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +63 -41
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +184 -78
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +48 -65
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +83 -37
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +334 -310
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +74 -54
- data/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +58 -43
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +64 -74
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +109 -86
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +205 -45
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +96 -34
- data/doc/rdoc/classes/Wee/Brush/Page.html +129 -67
- data/doc/rdoc/classes/Wee/{Utils/LRUCache.html → Brush/PasswordInputTag.html} +65 -38
- data/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html +132 -78
- data/doc/rdoc/classes/Wee/Brush/{RadioButtonTag/RadioGroup.html → RadioGroup.html} +91 -53
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +301 -127
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +96 -33
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +59 -44
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +94 -57
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +96 -33
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +181 -121
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +94 -32
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +257 -71
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +58 -43
- data/doc/rdoc/classes/Wee/CallAnswerMixin.html +289 -0
- data/doc/rdoc/classes/Wee/CallbackMixin.html +233 -0
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +179 -155
- data/doc/rdoc/classes/Wee/Callbacks.html +262 -0
- data/doc/rdoc/classes/Wee/Component.html +228 -779
- data/doc/rdoc/classes/Wee/Decoration.html +144 -159
- data/doc/rdoc/classes/Wee/DecorationMixin.html +340 -0
- data/doc/rdoc/classes/Wee/Delegate.html +119 -76
- data/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +64 -47
- data/doc/rdoc/classes/Wee/ErrorResponse.html +59 -62
- data/doc/rdoc/classes/Wee/FormDecoration.html +51 -37
- data/doc/rdoc/classes/Wee/GenericResponse.html +60 -35
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +1000 -602
- data/doc/rdoc/classes/Wee/HtmlDocument.html +288 -0
- data/doc/rdoc/classes/Wee/HtmlWriter.html +227 -126
- data/doc/rdoc/classes/Wee/IdGenerator.html +60 -31
- data/doc/rdoc/classes/Wee/IdGenerator/Secure.html +282 -0
- data/doc/rdoc/classes/Wee/{SimpleIdGenerator.html → IdGenerator/Sequential.html} +76 -49
- data/doc/rdoc/classes/Wee/JQuery.html +221 -0
- data/doc/rdoc/classes/Wee/LRUCache.html +514 -0
- data/doc/rdoc/classes/Wee/LRUCache/Item.html +158 -0
- data/doc/rdoc/classes/Wee/ObjectSnapshotMixin.html +187 -0
- data/doc/rdoc/classes/Wee/PageDecoration.html +88 -59
- data/doc/rdoc/classes/Wee/Presenter.html +124 -704
- data/doc/rdoc/classes/Wee/RedirectResponse.html +64 -33
- data/doc/rdoc/classes/Wee/RefreshResponse.html +59 -44
- data/doc/rdoc/classes/Wee/Renderer.html +234 -54
- data/doc/rdoc/classes/Wee/Request.html +151 -286
- data/doc/rdoc/classes/Wee/Response.html +29 -212
- data/doc/rdoc/classes/Wee/Session.html +585 -360
- data/doc/rdoc/classes/Wee/{StateHolder.html → Session/AbortCallbackProcessing.html} +67 -40
- data/doc/rdoc/classes/Wee/Session/MutexSerializer.html +166 -0
- data/doc/rdoc/classes/{Cache/Strategy/LFU/Item.html → Wee/Session/Page.html} +26 -27
- data/doc/rdoc/classes/Wee/Session/ThreadSerializer.html +219 -0
- data/doc/rdoc/classes/Wee/State.html +307 -0
- data/doc/rdoc/classes/{Cache/Strategy/LRU/Item.html → Wee/State/Snapshot.html} +26 -27
- data/doc/rdoc/classes/{Cache/Strategy/Unbounded/Item.html → Wee/State/SnapshotIVars.html} +26 -27
- data/doc/rdoc/classes/Wee/StructSnapshotMixin.html +183 -0
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +101 -35
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README_rdoc.html +243 -0
- data/doc/rdoc/files/lib/wee/application_rb.html +22 -30
- data/doc/rdoc/files/lib/wee/{page_rb.html → call_answer_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/callback_rb.html +12 -29
- data/doc/rdoc/files/lib/wee/component_rb.html +22 -27
- data/doc/rdoc/files/lib/wee/decoration_rb.html +19 -20
- data/doc/rdoc/files/lib/wee/{idgen_rb.html → html_brushes_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/html_canvas_rb.html +15 -23
- data/doc/rdoc/files/lib/wee/{abstractsession_rb.html → html_document_rb.html} +17 -25
- data/doc/rdoc/files/lib/wee/html_writer_rb.html +15 -23
- data/doc/rdoc/files/lib/wee/{webrick_rb.html → id_generator_rb.html} +19 -25
- data/doc/rdoc/files/lib/wee/{core/page_rb.html → jquery/jquery_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/{state_registry_rb.html → jquery_rb.html} +17 -27
- data/doc/rdoc/files/lib/{cache/cache_rb.html → wee/lru_cache_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/presenter_rb.html +12 -34
- data/doc/rdoc/files/lib/wee/{holder_rb.html → renderer_rb.html} +14 -25
- data/doc/rdoc/files/lib/wee/request_rb.html +18 -32
- data/doc/rdoc/files/lib/wee/response_rb.html +17 -24
- data/doc/rdoc/files/lib/wee/session_rb.html +21 -23
- data/doc/rdoc/files/lib/wee/state_rb.html +90 -0
- data/doc/rdoc/files/lib/wee_rb.html +48 -40
- data/doc/rdoc/fr_class_index.html +111 -75
- data/doc/rdoc/fr_file_index.html +46 -76
- data/doc/rdoc/fr_method_index.html +473 -480
- data/doc/rdoc/index.html +6 -9
- data/doc/rdoc/rdoc-style.css +210 -119
- data/examples/ObjectSpaceBrowser.rb +33 -23
- data/examples/ajax.rb +71 -0
- data/examples/continuations.rb +28 -0
- data/examples/demo.rb +92 -36
- data/examples/demo/calculator.rb +63 -0
- data/examples/demo/calendar.rb +42 -55
- data/examples/demo/counter.rb +38 -0
- data/{lib/wee/examples → examples/demo}/editable_counter.rb +11 -6
- data/examples/demo/example.rb +28 -24
- data/examples/demo/file_upload.rb +19 -0
- data/{lib/wee/components → examples/demo}/messagebox.rb +3 -3
- data/examples/demo/radio.rb +33 -0
- data/{lib/wee/examples → examples/demo}/window.rb +15 -10
- data/examples/hw.rb +3 -4
- data/{lib/wee/components → examples}/pager.rb +14 -14
- data/lib/wee.rb +48 -25
- data/lib/wee/application.rb +69 -131
- data/lib/wee/call_answer.rb +118 -0
- data/lib/wee/callback.rb +88 -0
- data/lib/wee/component.rb +141 -0
- data/lib/wee/decoration.rb +242 -0
- data/lib/wee/html_brushes.rb +725 -0
- data/lib/wee/html_canvas.rb +241 -0
- data/lib/wee/html_document.rb +45 -0
- data/lib/wee/html_writer.rb +71 -0
- data/lib/wee/id_generator.rb +70 -0
- data/lib/wee/jquery.rb +1 -0
- data/lib/wee/jquery/jquery.rb +17 -0
- data/lib/wee/jquery/public/jquery-1.3.2.min.js +19 -0
- data/lib/wee/jquery/public/wee-jquery.js +19 -0
- data/lib/wee/lru_cache.rb +89 -0
- data/lib/wee/presenter.rb +43 -0
- data/lib/wee/renderer.rb +65 -0
- data/lib/wee/request.rb +37 -113
- data/lib/wee/response.rb +43 -70
- data/lib/wee/session.rb +304 -113
- data/lib/wee/state.rb +85 -0
- data/test/component_spec.rb +17 -0
- data/wee.gemspec +4 -3
- metadata +249 -452
- data/ChangeLog +0 -657
- data/INSTALL +0 -17
- data/README +0 -272
- data/TODO +0 -142
- data/benchmark/Centrino1300/result.2000.counter.action +0 -45
- data/benchmark/Centrino1300/result.2000.counter.render +0 -43
- data/benchmark/Centrino1300/result.2000.filehandler +0 -43
- data/benchmark/Centrino600/result.2000.counter.action +0 -47
- data/benchmark/Centrino600/result.2000.counter.render +0 -45
- data/benchmark/Centrino600/result.2000.filehandler +0 -43
- data/benchmark/Makefile +0 -53
- data/benchmark/counter.rb +0 -77
- data/benchmark/filehandler.rb +0 -6
- data/benchmark/report_req.rb +0 -12
- data/bin/wee +0 -100
- data/doc/rdoc/classes/ActionView.html +0 -107
- data/doc/rdoc/classes/ActionView/Base.html +0 -133
- data/doc/rdoc/classes/Cache.html +0 -126
- data/doc/rdoc/classes/Cache/StorageCache.html +0 -320
- data/doc/rdoc/classes/Cache/Strategy.html +0 -128
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +0 -269
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +0 -238
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +0 -238
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +0 -225
- data/doc/rdoc/classes/LiteralMethod.html +0 -196
- data/doc/rdoc/classes/Main.html +0 -289
- data/doc/rdoc/classes/OgApplication.html +0 -126
- data/doc/rdoc/classes/OgScaffolder.html +0 -827
- data/doc/rdoc/classes/OgScaffolder/Editor.html +0 -565
- data/doc/rdoc/classes/OgSession.html +0 -172
- data/doc/rdoc/classes/Recipe.html +0 -113
- data/doc/rdoc/classes/Wee/AbstractSession.html +0 -502
- data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +0 -148
- data/doc/rdoc/classes/Wee/Brush/ActionMixin.html +0 -146
- data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +0 -154
- data/doc/rdoc/classes/Wee/Brush/AssignMixin.html +0 -141
- data/doc/rdoc/classes/Wee/Brush/CallbackMixin.html +0 -141
- data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +0 -148
- data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +0 -158
- data/doc/rdoc/classes/Wee/Brush/ToCallback.html +0 -146
- data/doc/rdoc/classes/Wee/Callback.html +0 -231
- data/doc/rdoc/classes/Wee/CallbackStream.html +0 -227
- data/doc/rdoc/classes/Wee/Canvas.html +0 -235
- data/doc/rdoc/classes/Wee/CanvasMixin.html +0 -225
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +0 -153
- data/doc/rdoc/classes/Wee/ComponentDispatcher.html +0 -289
- data/doc/rdoc/classes/Wee/ComponentRunner.html +0 -321
- data/doc/rdoc/classes/Wee/ErrorPage.html +0 -175
- data/doc/rdoc/classes/Wee/Examples.html +0 -114
- data/doc/rdoc/classes/Wee/Examples/Calculator.html +0 -319
- data/doc/rdoc/classes/Wee/Examples/Counter.html +0 -289
- data/doc/rdoc/classes/Wee/Examples/EditableCounter.html +0 -210
- data/doc/rdoc/classes/Wee/Examples/Window.html +0 -346
- data/doc/rdoc/classes/Wee/FastCGIAdaptor.html +0 -227
- data/doc/rdoc/classes/Wee/Helper.html +0 -148
- data/doc/rdoc/classes/Wee/HtmlCanvasRenderer.html +0 -1230
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +0 -198
- data/doc/rdoc/classes/Wee/LoginDecoration.html +0 -261
- data/doc/rdoc/classes/Wee/Md5IdGenerator.html +0 -181
- data/doc/rdoc/classes/Wee/MessageBox.html +0 -180
- data/doc/rdoc/classes/Wee/MethodCallback.html +0 -193
- data/doc/rdoc/classes/Wee/Nitro.html +0 -114
- data/doc/rdoc/classes/Wee/Nitro/ControllerClassMixin.html +0 -192
- data/doc/rdoc/classes/Wee/Nitro/ControllerMixin.html +0 -345
- data/doc/rdoc/classes/Wee/Nitro/FormTag.html +0 -155
- data/doc/rdoc/classes/Wee/Nitro/HtmlCanvasRenderer.html +0 -178
- data/doc/rdoc/classes/Wee/Page.html +0 -115
- data/doc/rdoc/classes/Wee/PagelessApplication.html +0 -154
- data/doc/rdoc/classes/Wee/PagelessComponentDriver.html +0 -296
- data/doc/rdoc/classes/Wee/PagelessRequest.html +0 -208
- data/doc/rdoc/classes/Wee/PagelessSession.html +0 -359
- data/doc/rdoc/classes/Wee/Pager.html +0 -534
- data/doc/rdoc/classes/Wee/Rails.html +0 -114
- data/doc/rdoc/classes/Wee/Rails/ControllerClassMixin.html +0 -192
- data/doc/rdoc/classes/Wee/Rails/ControllerMixin.html +0 -342
- data/doc/rdoc/classes/Wee/Rails/FormTag.html +0 -155
- data/doc/rdoc/classes/Wee/Rails/HtmlCanvasRenderer.html +0 -177
- data/doc/rdoc/classes/Wee/RenderingContext.html +0 -283
- data/doc/rdoc/classes/Wee/RequestHandler.html +0 -341
- data/doc/rdoc/classes/Wee/Snapshot.html +0 -211
- data/doc/rdoc/classes/Wee/StateRegistry.html +0 -434
- data/doc/rdoc/classes/Wee/StateRegistry/Snapshot.html +0 -320
- data/doc/rdoc/classes/Wee/StateRegistry/WithObject.html +0 -153
- data/doc/rdoc/classes/Wee/Utils.html +0 -300
- data/doc/rdoc/classes/Wee/ValueHolder.html +0 -220
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +0 -368
- data/doc/rdoc/files/INSTALL.html +0 -130
- data/doc/rdoc/files/README.html +0 -471
- data/doc/rdoc/files/lib/wee/adaptors/fastcgi_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/adaptors/nitro_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/adaptors/rails_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/component_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/component_dispatcher_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/login_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/pager_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/components_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/context_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/continuation_rb.html +0 -116
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/core/component_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/core/componentrunner_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/core/context_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core/decoration_rb.html +0 -133
- data/doc/rdoc/files/lib/wee/core/idgen_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +0 -112
- data/doc/rdoc/files/lib/wee/core/renderer_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/core/snapshot_rb.html +0 -113
- data/doc/rdoc/files/lib/wee/core/valueholder_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/core_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/core_rb.html +0 -124
- data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +0 -111
- data/doc/rdoc/files/lib/wee/examples/calculator_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/examples/counter_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/examples/editable_counter_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/examples/window_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/pageless/application_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/pageless/request_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/pageless/session_rb.html +0 -109
- data/doc/rdoc/files/lib/wee/pageless_rb.html +0 -110
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/rendering/html/brushes_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/rendering/html/canvas_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/rendering/html/writer_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +0 -114
- data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +0 -115
- data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +0 -111
- data/doc/rdoc/files/lib/wee/snapshot_ext_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/snapshot_rb.html +0 -107
- data/doc/rdoc/files/lib/wee/stuff_rb.html +0 -144
- data/doc/rdoc/files/lib/wee/template_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +0 -108
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +0 -101
- data/doc/rdoc/files/lib/wee/utils_rb.html +0 -110
- data/examples/ajax/ajax.js +0 -444
- data/examples/ajax/ajax.rb +0 -31
- data/examples/cc.rb +0 -74
- data/examples/dispatcher.rb +0 -37
- data/examples/draw.rb +0 -94
- data/examples/live-update.rb +0 -45
- data/examples/nitro/run.rb +0 -42
- data/examples/og-test.rb +0 -60
- data/examples/radio.rb +0 -44
- data/examples/test.rb +0 -39
- data/install.rb +0 -14
- data/lib/cache/cache.rb +0 -167
- data/lib/wee/abstractsession.rb +0 -96
- data/lib/wee/adaptors/fastcgi.rb +0 -76
- data/lib/wee/adaptors/nitro.rb +0 -155
- data/lib/wee/adaptors/rails.rb +0 -154
- data/lib/wee/adaptors/webrick.rb +0 -89
- data/lib/wee/components.rb +0 -7
- data/lib/wee/components/component_dispatcher.rb +0 -46
- data/lib/wee/components/form_decoration.rb +0 -7
- data/lib/wee/components/login_decoration.rb +0 -35
- data/lib/wee/components/page_decoration.rb +0 -14
- data/lib/wee/components/wrapper_decoration.rb +0 -7
- data/lib/wee/continuation.rb +0 -5
- data/lib/wee/continuation/core/component.rb +0 -56
- data/lib/wee/continuation/session.rb +0 -64
- data/lib/wee/core.rb +0 -16
- data/lib/wee/core/callback.rb +0 -121
- data/lib/wee/core/component.rb +0 -356
- data/lib/wee/core/componentrunner.rb +0 -73
- data/lib/wee/core/context.rb +0 -27
- data/lib/wee/core/decoration.rb +0 -138
- data/lib/wee/core/idgen.rb +0 -5
- data/lib/wee/core/page.rb +0 -1
- data/lib/wee/core/presenter.rb +0 -100
- data/lib/wee/core/renderer.rb +0 -23
- data/lib/wee/core/snapshot.rb +0 -21
- data/lib/wee/core/valueholder.rb +0 -19
- data/lib/wee/core_ext.rb +0 -122
- data/lib/wee/databases/og.rb +0 -4
- data/lib/wee/databases/og/application.rb +0 -3
- data/lib/wee/databases/og/old_scaffolder.rb +0 -98
- data/lib/wee/databases/og/scaffolder.rb +0 -255
- data/lib/wee/databases/og/session.rb +0 -9
- data/lib/wee/examples/calculator.rb +0 -70
- data/lib/wee/examples/counter.rb +0 -33
- data/lib/wee/idgen/md5.rb +0 -21
- data/lib/wee/idgen/sequential.rb +0 -11
- data/lib/wee/pageless.rb +0 -3
- data/lib/wee/pageless/application.rb +0 -13
- data/lib/wee/pageless/request.rb +0 -27
- data/lib/wee/pageless/session.rb +0 -74
- data/lib/wee/renderer/html/brushes.rb +0 -667
- data/lib/wee/renderer/html/canvas.rb +0 -265
- data/lib/wee/renderer/html/writer.rb +0 -80
- data/lib/wee/requesthandler.rb +0 -81
- data/lib/wee/skeleton/og/README +0 -38
- data/lib/wee/skeleton/og/components/main.rb +0 -20
- data/lib/wee/skeleton/og/conf/db.rb +0 -8
- data/lib/wee/skeleton/og/models/recipe.rb +0 -5
- data/lib/wee/skeleton/og/run.rb +0 -23
- data/lib/wee/skeleton/simple/README +0 -32
- data/lib/wee/skeleton/simple/components/main.rb +0 -25
- data/lib/wee/skeleton/simple/run.rb +0 -12
- data/lib/wee/snapshot_ext.rb +0 -41
- data/lib/wee/template.rb +0 -42
- data/lib/wee/utils.rb +0 -5
- data/lib/wee/utils/autoreload.rb +0 -56
- data/lib/wee/utils/cache.rb +0 -7
- data/lib/wee/utils/helper.rb +0 -51
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Wee::ComponentRunner wraps a root component and provides methods that act on
|
|
2
|
-
# the components tree defined by the root component.
|
|
3
|
-
|
|
4
|
-
class Wee::ComponentRunner
|
|
5
|
-
|
|
6
|
-
# Values are parameters to method #process_callbacks_of
|
|
7
|
-
|
|
8
|
-
DEFAULT_CALLBACK_PROCESSING = [
|
|
9
|
-
# Invokes all specified input callbacks. NOTE: Input callbacks should never
|
|
10
|
-
# call other components!
|
|
11
|
-
[:input, true, false],
|
|
12
|
-
|
|
13
|
-
# Invokes the first found action callback. NOTE: Only the first action
|
|
14
|
-
# callback is invoked. Any other action callback is ignored.
|
|
15
|
-
[:action, false, true],
|
|
16
|
-
|
|
17
|
-
# Invoke live_update callback (NOTE: only the first is invoked).
|
|
18
|
-
[:live_update, false, true]
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
attr_accessor :root_component
|
|
22
|
-
|
|
23
|
-
def initialize(root_component)
|
|
24
|
-
@root_component = root_component
|
|
25
|
-
@callback_processing = DEFAULT_CALLBACK_PROCESSING
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# This method takes a snapshot from the current state of the root component
|
|
29
|
-
# and returns it.
|
|
30
|
-
|
|
31
|
-
def snapshot
|
|
32
|
-
@root_component.backtrack_state_chain(snap = Wee::Snapshot.new)
|
|
33
|
-
return snap.freeze
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Render the root component with the given rendering context.
|
|
37
|
-
|
|
38
|
-
def render(rendering_context)
|
|
39
|
-
@root_component.do_render_chain(rendering_context)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# This method triggers several tree traversals to process the callbacks of
|
|
43
|
-
# the root component.
|
|
44
|
-
#
|
|
45
|
-
# Returns nil or a Response object in case of a premature response.
|
|
46
|
-
|
|
47
|
-
def process_callbacks(callback_stream)
|
|
48
|
-
if callback_stream.all_of_type(:action).size > 1
|
|
49
|
-
raise "Not allowed to specify more than one action callback"
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
catch(:wee_abort_callback_processing) {
|
|
53
|
-
@callback_processing.each {|args| process_callbacks_of(callback_stream, *args) }
|
|
54
|
-
nil
|
|
55
|
-
}
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
protected
|
|
59
|
-
|
|
60
|
-
def process_callbacks_of(callback_stream, type, pass_value=true, once=false)
|
|
61
|
-
@root_component.process_callbacks_chain {|this|
|
|
62
|
-
callback_stream.with_callbacks_for(this, type) { |callback, value|
|
|
63
|
-
if pass_value
|
|
64
|
-
callback.call(value)
|
|
65
|
-
else
|
|
66
|
-
callback.call
|
|
67
|
-
end
|
|
68
|
-
return if once
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
end
|
data/lib/wee/core/context.rb
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
class Wee::Context
|
|
2
|
-
attr_accessor :request, :response, :session
|
|
3
|
-
|
|
4
|
-
def initialize(request=nil, response=nil, session=nil)
|
|
5
|
-
@request, @response, @session = request, response, session
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
class Wee::RenderingContext
|
|
10
|
-
attr_accessor :context, :callbacks, :document
|
|
11
|
-
|
|
12
|
-
def initialize(context=nil, callbacks=nil, document=nil)
|
|
13
|
-
@context, @callbacks, @document = context, callbacks, document
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def request
|
|
17
|
-
@context.request
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def response
|
|
21
|
-
@context.response
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def session
|
|
25
|
-
@context.session
|
|
26
|
-
end
|
|
27
|
-
end
|
data/lib/wee/core/decoration.rb
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
# Abstract base class of all decorations. Forwards the methods
|
|
2
|
-
# #process_callbacks, #do_render and #backtrack_state to the next decoration in
|
|
3
|
-
# the chain. Subclasses should provide special behaviour in these methods,
|
|
4
|
-
# otherwise the decoration does not make sense.
|
|
5
|
-
#
|
|
6
|
-
# For example, a HeaderFooterDecoration class could draw a header and footer
|
|
7
|
-
# around the decorations or components below itself:
|
|
8
|
-
#
|
|
9
|
-
# class HeaderFooterDecoration < Wee::Decoration
|
|
10
|
-
# def do_render(rendering_context)
|
|
11
|
-
# with_renderer_for(rendering_context) do
|
|
12
|
-
# render_header
|
|
13
|
-
# super(rendering_context)
|
|
14
|
-
# render_footer
|
|
15
|
-
# end
|
|
16
|
-
# end
|
|
17
|
-
#
|
|
18
|
-
# def render_header
|
|
19
|
-
# r.text "header
|
|
20
|
-
# end
|
|
21
|
-
#
|
|
22
|
-
# def render_footer
|
|
23
|
-
# ...
|
|
24
|
-
# end
|
|
25
|
-
# end
|
|
26
|
-
|
|
27
|
-
class Wee::Decoration < Wee::Presenter
|
|
28
|
-
|
|
29
|
-
# Points to the next decoration in the chain. A decoration is responsible for
|
|
30
|
-
# all decorations or components "below" it (everything that follows this
|
|
31
|
-
# decoration in the chain). In other words, it's the owner of everything
|
|
32
|
-
# "below" itself.
|
|
33
|
-
|
|
34
|
-
attr_accessor :owner
|
|
35
|
-
|
|
36
|
-
# Is this decoration a global or a local one? By default all decorations are
|
|
37
|
-
# local unless this method is overwritten.
|
|
38
|
-
#
|
|
39
|
-
# A global decoration is added in front of the decoration chain, a local
|
|
40
|
-
# decoration is added in front of all other local decorations but after all
|
|
41
|
-
# global decorations.
|
|
42
|
-
|
|
43
|
-
def global?() false end
|
|
44
|
-
|
|
45
|
-
# Forwards method call to the next decoration in the chain.
|
|
46
|
-
|
|
47
|
-
def process_callbacks(&block)
|
|
48
|
-
@owner.process_callbacks(&block)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# Forwards method call to the next decoration in the chain.
|
|
52
|
-
|
|
53
|
-
def do_render(rendering_context)
|
|
54
|
-
@owner.do_render(rendering_context)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
# Forwards method call to the next decoration in the chain.
|
|
58
|
-
|
|
59
|
-
def backtrack_state(snapshot)
|
|
60
|
-
@owner.backtrack_state(snapshot)
|
|
61
|
-
snapshot.add(self)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
65
|
-
# :section: Snapshot
|
|
66
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
67
|
-
|
|
68
|
-
# We have to save the @owner attribute to be able to correctly backtrack
|
|
69
|
-
# calls, as method Wee::Component#call modifies it in the call to
|
|
70
|
-
# <tt>component.remove_decoration(answer)</tt>. Removing the
|
|
71
|
-
# answer-decoration has the advantage to be able to call a component more
|
|
72
|
-
# than once!
|
|
73
|
-
|
|
74
|
-
def take_snapshot
|
|
75
|
-
@owner
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def restore_snapshot(snap)
|
|
79
|
-
@owner = snap
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
# A Wee::Delegate breaks the decoration chain and forwards the methods
|
|
85
|
-
# #process_callbacks, #do_render and #backtrack_state to the corresponding
|
|
86
|
-
# *chain* method of it's _delegate_ component (a Wee::Component).
|
|
87
|
-
|
|
88
|
-
class Wee::Delegate < Wee::Decoration
|
|
89
|
-
def initialize(delegate)
|
|
90
|
-
@delegate = delegate
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# Forwards method to the corresponding top-level *chain* method of the
|
|
94
|
-
# _delegate_ component.
|
|
95
|
-
|
|
96
|
-
def process_callbacks(&block)
|
|
97
|
-
@delegate.process_callbacks_chain(&block)
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
# Forwards method to the corresponding top-level *chain* method of the
|
|
101
|
-
# _delegate_ component.
|
|
102
|
-
|
|
103
|
-
def do_render(rendering_context)
|
|
104
|
-
@delegate.do_render_chain(rendering_context)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# Forwards method to the corresponding top-level *chain* method of the
|
|
108
|
-
# _delegate_ component. We also take snapshots of all non-visible components,
|
|
109
|
-
# thus we follow the @owner (via super).
|
|
110
|
-
|
|
111
|
-
def backtrack_state(snapshot)
|
|
112
|
-
super
|
|
113
|
-
@delegate.backtrack_state_chain(snapshot)
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
# A Wee::AnswerDecoration is wrapped around a component that will call
|
|
118
|
-
# Component#answer. This makes it possible to use such components without the
|
|
119
|
-
# need to call them (Component#call), e.g. as child components of other
|
|
120
|
-
# components.
|
|
121
|
-
|
|
122
|
-
class Wee::AnswerDecoration < Wee::Decoration
|
|
123
|
-
|
|
124
|
-
# When a component answers, <tt>on_answer.call(args)</tt> will be executed
|
|
125
|
-
# (unless nil), where +args+ are the arguments passed to Component#answer.
|
|
126
|
-
# Note that no snapshot of on_answer is taken, so you should avoid modifying
|
|
127
|
-
# it!
|
|
128
|
-
|
|
129
|
-
attr_accessor :on_answer
|
|
130
|
-
|
|
131
|
-
def process_callbacks(&block)
|
|
132
|
-
args = catch(:wee_answer) { super; nil }
|
|
133
|
-
if args != nil
|
|
134
|
-
# return to the calling component
|
|
135
|
-
@on_answer.call(*args) if @on_answer
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
end
|
data/lib/wee/core/idgen.rb
DELETED
data/lib/wee/core/page.rb
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class Wee::Page < Struct.new(:snapshot, :callbacks); end
|
data/lib/wee/core/presenter.rb
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
# Wee::Presenter is the superclass of all classes that want to participate in
|
|
2
|
-
# rendering and callback-processing. Wee::Component and Wee::Decoration are
|
|
3
|
-
# it's two most important subclasses.
|
|
4
|
-
|
|
5
|
-
class Wee::Presenter
|
|
6
|
-
|
|
7
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
8
|
-
# :section: Render
|
|
9
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
10
|
-
|
|
11
|
-
public
|
|
12
|
-
|
|
13
|
-
# This method renders the content of the presenter.
|
|
14
|
-
#
|
|
15
|
-
# *OVERWRITE* this method in your own presenter classes to implement the
|
|
16
|
-
# view. By default this method does nothing!
|
|
17
|
-
#
|
|
18
|
-
# Use the current renderer as returned by #renderer or it's short-cut #r.
|
|
19
|
-
|
|
20
|
-
def render
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# Render the presenter in the given rendering context. <b>DO NOT</b>
|
|
24
|
-
# overwrite this method, unless you know exactly what you're doing!
|
|
25
|
-
#
|
|
26
|
-
# Creates a new renderer object of the class returned by method
|
|
27
|
-
# #renderer_class, makes this the current renderer, then invokes method
|
|
28
|
-
# #render.
|
|
29
|
-
#
|
|
30
|
-
# [+rendering_context+]
|
|
31
|
-
# An object of class RenderingContext
|
|
32
|
-
|
|
33
|
-
def do_render(rendering_context)
|
|
34
|
-
with_renderer_for(rendering_context) do render() end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
protected
|
|
38
|
-
|
|
39
|
-
# Returns the current renderer object for use by the render methods.
|
|
40
|
-
def renderer() @__renderer end
|
|
41
|
-
|
|
42
|
-
# Short cut for #renderer.
|
|
43
|
-
def r() @__renderer end
|
|
44
|
-
|
|
45
|
-
# Creates a new renderer object of the class returned by method
|
|
46
|
-
# #renderer_class, then makes this the current renderer for the time the
|
|
47
|
-
# block it yields to executes. Finally, it restores the current renderer to
|
|
48
|
-
# the former one and closes the newly created renderer.
|
|
49
|
-
|
|
50
|
-
def with_renderer_for(rendering_context)
|
|
51
|
-
old_renderer = @__renderer
|
|
52
|
-
begin
|
|
53
|
-
renderer_class.new(rendering_context, self) {|@__renderer| yield }
|
|
54
|
-
ensure
|
|
55
|
-
@__renderer = old_renderer
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# Returns the class used as renderer for this presenter. Overwrite this
|
|
60
|
-
# method if you want to use a different renderer.
|
|
61
|
-
#
|
|
62
|
-
# Returned class must be a subclass of Wee::Renderer.
|
|
63
|
-
#
|
|
64
|
-
# NEEDS TO BE OVERWRITTEN by some non-core files.
|
|
65
|
-
|
|
66
|
-
def renderer_class
|
|
67
|
-
raise "Method renderer_class needs to be implemented!"
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
71
|
-
# :section: Callback
|
|
72
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
73
|
-
|
|
74
|
-
public
|
|
75
|
-
|
|
76
|
-
# Process all callbacks specified for this presenter.
|
|
77
|
-
#
|
|
78
|
-
# [+block+]
|
|
79
|
-
# Specifies the action to be taken (e.g. whether to invoke input or action
|
|
80
|
-
# callbacks).
|
|
81
|
-
|
|
82
|
-
def process_callbacks(&block)
|
|
83
|
-
block.call(self)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
87
|
-
# :section: Backtrack
|
|
88
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
89
|
-
|
|
90
|
-
public
|
|
91
|
-
|
|
92
|
-
# Dummy implementation. See Component#backtrack_state for more information.
|
|
93
|
-
#
|
|
94
|
-
# [+snapshot+]
|
|
95
|
-
# An object of class Snapshot
|
|
96
|
-
|
|
97
|
-
def backtrack_state(snapshot)
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
end
|
data/lib/wee/core/renderer.rb
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Base class of all Renderer classes.
|
|
2
|
-
|
|
3
|
-
class Wee::Renderer
|
|
4
|
-
attr_reader :rendering_context # holds the current Wee::RenderingContext
|
|
5
|
-
attr_accessor :current_component
|
|
6
|
-
|
|
7
|
-
def initialize(rendering_context, current_component=nil, &block)
|
|
8
|
-
@rendering_context = rendering_context
|
|
9
|
-
@current_component = current_component
|
|
10
|
-
if block
|
|
11
|
-
begin
|
|
12
|
-
block.call(self)
|
|
13
|
-
ensure
|
|
14
|
-
close
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# Subclass responsibility.
|
|
20
|
-
|
|
21
|
-
def close
|
|
22
|
-
end
|
|
23
|
-
end
|
data/lib/wee/core/snapshot.rb
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# This class is for backtracking the state of components (or
|
|
2
|
-
# decorations/presenters). Components that want an undo-facility to be
|
|
3
|
-
# implemented (triggered for example by a browsers back-button), have to
|
|
4
|
-
# overwrite the Component#backtrack_state method. Class Wee::Snapshot simply
|
|
5
|
-
# represents a collection of objects from which snapshots were taken via
|
|
6
|
-
# methods take_snapshot.
|
|
7
|
-
|
|
8
|
-
class Wee::Snapshot
|
|
9
|
-
def initialize
|
|
10
|
-
@objects = Hash.new
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def add(object)
|
|
14
|
-
oid = object.object_id
|
|
15
|
-
@objects[oid] = [object, object.take_snapshot] unless @objects.include?(oid)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def restore
|
|
19
|
-
@objects.each_value { |object, value| object.restore_snapshot(value) }
|
|
20
|
-
end
|
|
21
|
-
end
|
data/lib/wee/core/valueholder.rb
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Implements a value holder. Useful for backtracking the reference assigned to
|
|
2
|
-
# an instance variable (not the object itself!). An example where this is used
|
|
3
|
-
# is the <tt>@__decoration</tt> attribute of class Wee::Component.
|
|
4
|
-
|
|
5
|
-
class Wee::ValueHolder
|
|
6
|
-
attr_accessor :value
|
|
7
|
-
|
|
8
|
-
def initialize(value=nil)
|
|
9
|
-
@value = value
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def take_snapshot
|
|
13
|
-
@value
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def restore_snapshot(value)
|
|
17
|
-
@value = value
|
|
18
|
-
end
|
|
19
|
-
end
|
data/lib/wee/core_ext.rb
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
class Wee::Presenter
|
|
2
|
-
|
|
3
|
-
def renderer_class
|
|
4
|
-
Wee::DefaultRenderer
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
8
|
-
# :section: Session
|
|
9
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
10
|
-
|
|
11
|
-
public
|
|
12
|
-
|
|
13
|
-
# Returns the current session. A presenter (or component) has always an
|
|
14
|
-
# associated session. The returned object is of class Wee::Session or a
|
|
15
|
-
# subclass thereof.
|
|
16
|
-
|
|
17
|
-
def session
|
|
18
|
-
Wee::Session.current
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# Send a premature response.
|
|
22
|
-
|
|
23
|
-
protected
|
|
24
|
-
|
|
25
|
-
def send_response(response)
|
|
26
|
-
throw :wee_abort_callback_processing, response
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# Call the block inside a rendering environment, then send the response prematurely.
|
|
30
|
-
|
|
31
|
-
def send_render_response(&block)
|
|
32
|
-
# Generate a response
|
|
33
|
-
response = Wee::GenericResponse.new('text/html', '')
|
|
34
|
-
|
|
35
|
-
# Get the current context we are in
|
|
36
|
-
context = session.current_context
|
|
37
|
-
|
|
38
|
-
# A rendering context is needed to use 'r' (if you want, you can simply
|
|
39
|
-
# omit this and just return the response with some html/xml filled in.
|
|
40
|
-
rendering_context = Wee::RenderingContext.new(
|
|
41
|
-
context,
|
|
42
|
-
session.current_callbacks,
|
|
43
|
-
Wee::HtmlWriter.new(response.content))
|
|
44
|
-
|
|
45
|
-
with_renderer_for(rendering_context, &block)
|
|
46
|
-
|
|
47
|
-
send_response(response)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
52
|
-
# :section: Properties
|
|
53
|
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
54
|
-
|
|
55
|
-
public
|
|
56
|
-
|
|
57
|
-
def properties() @__properties end
|
|
58
|
-
def properties=(props) @__properties = props end
|
|
59
|
-
|
|
60
|
-
# Returns an "owned" property.
|
|
61
|
-
|
|
62
|
-
def get_property(prop)
|
|
63
|
-
if self.properties
|
|
64
|
-
self.properties[prop]
|
|
65
|
-
else
|
|
66
|
-
nil
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# Tries to lookup a property from different places. +nil+ as property value
|
|
71
|
-
# is not allowed!
|
|
72
|
-
#
|
|
73
|
-
# Search order:
|
|
74
|
-
#
|
|
75
|
-
# 1. self.get_property(prop)
|
|
76
|
-
#
|
|
77
|
-
# 2. session.get_property(prop, self.class)
|
|
78
|
-
#
|
|
79
|
-
# 3. application.get_property(prop, self.class)
|
|
80
|
-
#
|
|
81
|
-
# 4. session.get_property(prop, nil)
|
|
82
|
-
#
|
|
83
|
-
# 5. application.get_property(prop, nil)
|
|
84
|
-
#
|
|
85
|
-
# 6. @@properties[prop]
|
|
86
|
-
#
|
|
87
|
-
|
|
88
|
-
def lookup_property(prop)
|
|
89
|
-
val = get_property(prop)
|
|
90
|
-
return val if val != nil
|
|
91
|
-
|
|
92
|
-
sess = session()
|
|
93
|
-
app = sess.application
|
|
94
|
-
klass = self.class
|
|
95
|
-
|
|
96
|
-
val = sess.get_property(prop, klass)
|
|
97
|
-
return val if val != nil
|
|
98
|
-
|
|
99
|
-
val = app.get_property(prop, klass)
|
|
100
|
-
return val if val != nil
|
|
101
|
-
|
|
102
|
-
val = sess.get_property(prop, nil)
|
|
103
|
-
return val if val != nil
|
|
104
|
-
|
|
105
|
-
val = app.get_property(prop, nil)
|
|
106
|
-
return val if val != nil
|
|
107
|
-
|
|
108
|
-
if defined?(@@properties)
|
|
109
|
-
val = @@properties[prop]
|
|
110
|
-
return val if val != nil
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
return nil
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
# This is currently only used for describing which properties are required by
|
|
117
|
-
# the underlying component.
|
|
118
|
-
|
|
119
|
-
def self.uses_property(*args)
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
end
|