wee 0.10.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,265 +0,0 @@
|
|
1
|
-
module Wee
|
2
|
-
|
3
|
-
module CanvasMixin
|
4
|
-
def initialize_canvas
|
5
|
-
@parent_brush = nil
|
6
|
-
@current_brush = nil
|
7
|
-
end
|
8
|
-
|
9
|
-
def close
|
10
|
-
@current_brush.close if @current_brush
|
11
|
-
@current_brush = nil
|
12
|
-
end
|
13
|
-
|
14
|
-
def set_brush(brush)
|
15
|
-
# tell previous brush to finish
|
16
|
-
@current_brush.close if @current_brush
|
17
|
-
|
18
|
-
brush.parent = @parent_brush
|
19
|
-
brush.canvas = self
|
20
|
-
@current_brush = brush
|
21
|
-
|
22
|
-
return brush
|
23
|
-
end
|
24
|
-
|
25
|
-
def nest(&block)
|
26
|
-
@parent_brush = @current_brush
|
27
|
-
@current_brush = nil
|
28
|
-
block.call
|
29
|
-
@current_brush.close if @current_brush
|
30
|
-
@parent_brush = @parent_brush.parent
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
class HtmlCanvasRenderer < Renderer
|
35
|
-
include CanvasMixin
|
36
|
-
|
37
|
-
attr_reader :document
|
38
|
-
|
39
|
-
def self.generic_tag(*attrs)
|
40
|
-
attrs.each { |a|
|
41
|
-
class_eval "
|
42
|
-
def #{ a }(*args, &block)
|
43
|
-
handle(Brush::GenericTagBrush.new('#{ a }'), *args, &block)
|
44
|
-
end
|
45
|
-
"
|
46
|
-
}
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.generic_single_tag(*attrs)
|
50
|
-
attrs.each { |a|
|
51
|
-
class_eval "
|
52
|
-
def #{ a }(*args, &block)
|
53
|
-
handle(Brush::GenericSingleTagBrush.new('#{ a }'), *args, &block)
|
54
|
-
end
|
55
|
-
"
|
56
|
-
}
|
57
|
-
end
|
58
|
-
|
59
|
-
def initialize(rendering_context, current_component=nil, &block)
|
60
|
-
# cache the document, to reduce method calls
|
61
|
-
@document = rendering_context.document
|
62
|
-
|
63
|
-
initialize_canvas
|
64
|
-
super
|
65
|
-
end
|
66
|
-
|
67
|
-
generic_tag :html, :head, :body, :title, :style, :h1, :h2, :h3, :h4, :h5, :div
|
68
|
-
generic_tag :div, :span, :ul, :ol, :li
|
69
|
-
generic_single_tag :link, :hr
|
70
|
-
|
71
|
-
def url_for_callback(callback, type=:action, hash=nil)
|
72
|
-
url_for_callback_id(register_callback(type, callback), hash)
|
73
|
-
end
|
74
|
-
|
75
|
-
def url_for_named_callback(name, callback, hash=nil)
|
76
|
-
url_for_callback_id(register_named_callback(name, :action, callback), hash)
|
77
|
-
end
|
78
|
-
|
79
|
-
def url_for_callback_id(callback_id, hash=nil)
|
80
|
-
if hash
|
81
|
-
build_url(hash.update(:callback_id => callback_id))
|
82
|
-
else
|
83
|
-
build_url(:callback_id => callback_id)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def build_url(*args)
|
88
|
-
rendering_context.request.build_url(*args)
|
89
|
-
end
|
90
|
-
|
91
|
-
def register_callback(type, callback)
|
92
|
-
self.rendering_context.callbacks.register_for(self.current_component, type, callback)
|
93
|
-
end
|
94
|
-
|
95
|
-
def register_named_callback(name, type, callback)
|
96
|
-
self.rendering_context.callbacks.register_named_for(self.current_component, type, callback, name)
|
97
|
-
end
|
98
|
-
|
99
|
-
def table(*args, &block)
|
100
|
-
handle(Brush::TableTag.new, *args, &block)
|
101
|
-
end
|
102
|
-
|
103
|
-
def table_row(*args, &block)
|
104
|
-
handle(Brush::TableRowTag.new, *args, &block)
|
105
|
-
end
|
106
|
-
|
107
|
-
def table_data(*args, &block)
|
108
|
-
handle(Brush::TableDataTag.new, *args, &block)
|
109
|
-
end
|
110
|
-
|
111
|
-
def table_header(*args, &block)
|
112
|
-
handle(Brush::TableHeaderTag.new, *args, &block)
|
113
|
-
end
|
114
|
-
|
115
|
-
def form(*args, &block)
|
116
|
-
handle(Brush::FormTag.new, *args, &block)
|
117
|
-
end
|
118
|
-
|
119
|
-
def input(*args, &block)
|
120
|
-
handle(Brush::InputTag.new, *args, &block)
|
121
|
-
end
|
122
|
-
|
123
|
-
def hidden_input(*args, &block)
|
124
|
-
handle(Brush::HiddenInputTag.new, *args, &block)
|
125
|
-
end
|
126
|
-
|
127
|
-
def password_input(*args, &block)
|
128
|
-
handle(Brush::PasswordInputTag.new, *args, &block)
|
129
|
-
end
|
130
|
-
|
131
|
-
def text_input(*args, &block)
|
132
|
-
handle(Brush::TextInputTag.new, *args, &block)
|
133
|
-
end
|
134
|
-
|
135
|
-
def new_radio_group
|
136
|
-
Wee::Brush::RadioButtonTag::RadioGroup.new(self)
|
137
|
-
end
|
138
|
-
|
139
|
-
def radio_button(*args, &block)
|
140
|
-
handle(Brush::RadioButtonTag.new, *args, &block)
|
141
|
-
end
|
142
|
-
|
143
|
-
def check_box(*args, &block)
|
144
|
-
handle(Wee::Brush::CheckboxTag.new, *args, &block)
|
145
|
-
end
|
146
|
-
|
147
|
-
alias checkbox check_box
|
148
|
-
|
149
|
-
def text_area(*args, &block)
|
150
|
-
handle(Brush::TextAreaTag.new, *args, &block)
|
151
|
-
end
|
152
|
-
|
153
|
-
def option(*args, &block)
|
154
|
-
handle(Brush::SelectOptionTag.new, *args, &block)
|
155
|
-
end
|
156
|
-
|
157
|
-
def select_list(items)
|
158
|
-
handle(Brush::SelectListTag.new(items))
|
159
|
-
end
|
160
|
-
|
161
|
-
def submit_button(*args, &block)
|
162
|
-
handle(Brush::SubmitButtonTag.new, *args, &block)
|
163
|
-
end
|
164
|
-
|
165
|
-
def image_button(*args, &block)
|
166
|
-
handle(Wee::Brush::ImageButtonTag.new, *args, &block)
|
167
|
-
end
|
168
|
-
|
169
|
-
def file_upload(*args, &block)
|
170
|
-
handle(Wee::Brush::FileUploadTag.new, *args, &block)
|
171
|
-
end
|
172
|
-
|
173
|
-
def page(*args, &block)
|
174
|
-
handle(Brush::Page.new, *args, &block)
|
175
|
-
end
|
176
|
-
|
177
|
-
def anchor(*args, &block)
|
178
|
-
handle(Brush::AnchorTag.new, *args, &block)
|
179
|
-
end
|
180
|
-
|
181
|
-
def space(n=1)
|
182
|
-
set_brush(Brush::GenericTextBrush.new(" "*n))
|
183
|
-
end
|
184
|
-
|
185
|
-
def bold(*args, &block)
|
186
|
-
handle(Brush::GenericTagBrush.new("b"), *args, &block)
|
187
|
-
end
|
188
|
-
|
189
|
-
def javascript(*args, &block)
|
190
|
-
handle(Brush::JavascriptTag.new, *args, &block)
|
191
|
-
end
|
192
|
-
|
193
|
-
def paragraph(*args, &block)
|
194
|
-
handle(Brush::GenericTagBrush.new("p"), *args, &block)
|
195
|
-
end
|
196
|
-
|
197
|
-
def label(*args, &block)
|
198
|
-
handle(Brush::GenericTagBrush.new("label"), *args, &block)
|
199
|
-
end
|
200
|
-
|
201
|
-
def break
|
202
|
-
set_brush(Brush::GenericSingleTagBrush.new("br"))
|
203
|
-
end
|
204
|
-
|
205
|
-
def image
|
206
|
-
handle(Brush::ImageTag.new)
|
207
|
-
end
|
208
|
-
|
209
|
-
def link_css(url)
|
210
|
-
link.type('text/css').rel('stylesheet').href(url)
|
211
|
-
end
|
212
|
-
|
213
|
-
def text(str)
|
214
|
-
set_brush(Brush::GenericTextBrush.new(str))
|
215
|
-
end
|
216
|
-
alias << text
|
217
|
-
|
218
|
-
def encode_text(str)
|
219
|
-
set_brush(Brush::GenericEncodedTextBrush.new(str))
|
220
|
-
end
|
221
|
-
|
222
|
-
# converts \n into <br/>
|
223
|
-
def multiline_text(text, encode=true)
|
224
|
-
meth = encode ? :encode_text : :text
|
225
|
-
lines = text.split("\n")
|
226
|
-
send(meth, lines.first)
|
227
|
-
lines[1..-1].each { |l| self.break; send(meth, l) }
|
228
|
-
end
|
229
|
-
|
230
|
-
def render(obj)
|
231
|
-
self.close
|
232
|
-
obj.do_render_chain(@rendering_context)
|
233
|
-
nil
|
234
|
-
end
|
235
|
-
|
236
|
-
require 'erb'
|
237
|
-
|
238
|
-
def template(filename)
|
239
|
-
raise "Template file #{ filename } not found!" unless File.exists?(filename)
|
240
|
-
self.close
|
241
|
-
compiler = ERB::Compiler.new(nil)
|
242
|
-
compiler.put_cmd = 'r << '
|
243
|
-
src = compiler.compile(File.read(filename))
|
244
|
-
if $DEBUG
|
245
|
-
puts "-------------------------"
|
246
|
-
puts src
|
247
|
-
puts "-------------------------"
|
248
|
-
end
|
249
|
-
@current_component.instance_eval(src, '(erb)', 1)
|
250
|
-
return nil
|
251
|
-
end
|
252
|
-
|
253
|
-
private
|
254
|
-
|
255
|
-
def handle(brush, *args, &block)
|
256
|
-
set_brush(brush)
|
257
|
-
if not args.empty? or block
|
258
|
-
brush.with(*args, &block)
|
259
|
-
else
|
260
|
-
brush
|
261
|
-
end
|
262
|
-
end
|
263
|
-
end
|
264
|
-
|
265
|
-
end # module Wee
|
@@ -1,80 +0,0 @@
|
|
1
|
-
require 'cgi'
|
2
|
-
|
3
|
-
# A class used to write out HTML documents easily.
|
4
|
-
#
|
5
|
-
# Usage:
|
6
|
-
#
|
7
|
-
# w = Wee::HtmlWriter.new(doc='')
|
8
|
-
# w.start_tag('html')
|
9
|
-
# w.start_tag('body')
|
10
|
-
# w.start_tag('a', 'href' => 'http://...')
|
11
|
-
# w.text('link')
|
12
|
-
# w.end_tag('a')
|
13
|
-
# w.end_tag('body')
|
14
|
-
# w.end_tag('html')
|
15
|
-
#
|
16
|
-
# p doc # => '<html><body><a href="http://...">link</a></body></html>'
|
17
|
-
#
|
18
|
-
|
19
|
-
class Wee::HtmlWriter
|
20
|
-
attr_accessor :port
|
21
|
-
|
22
|
-
def initialize(port)
|
23
|
-
@port = port
|
24
|
-
end
|
25
|
-
|
26
|
-
def start_tag(tag, attributes=nil)
|
27
|
-
if attributes
|
28
|
-
@port << "<#{ tag }"
|
29
|
-
attributes.each {|k, v|
|
30
|
-
if v
|
31
|
-
@port << %[ #{ k }="#{ v }"]
|
32
|
-
else
|
33
|
-
@port << %[ #{ k }]
|
34
|
-
end
|
35
|
-
}
|
36
|
-
@port << ">"
|
37
|
-
else
|
38
|
-
@port << "<#{ tag }>"
|
39
|
-
end
|
40
|
-
|
41
|
-
self
|
42
|
-
end
|
43
|
-
|
44
|
-
def single_tag(tag, attributes=nil)
|
45
|
-
if attributes
|
46
|
-
@port << "<#{ tag }"
|
47
|
-
attributes.each {|k, v|
|
48
|
-
if v
|
49
|
-
@port << %[ #{ k }="#{ v }"]
|
50
|
-
else
|
51
|
-
@port << %[ #{ k }]
|
52
|
-
end
|
53
|
-
}
|
54
|
-
@port << " />"
|
55
|
-
else
|
56
|
-
@port << "<#{ tag } />"
|
57
|
-
end
|
58
|
-
|
59
|
-
self
|
60
|
-
end
|
61
|
-
|
62
|
-
def end_tag(tag)
|
63
|
-
@port << "</#{ tag }>"
|
64
|
-
|
65
|
-
self
|
66
|
-
end
|
67
|
-
|
68
|
-
def text(str)
|
69
|
-
@port << str.to_s
|
70
|
-
|
71
|
-
self
|
72
|
-
end
|
73
|
-
alias << text
|
74
|
-
|
75
|
-
def encode_text(str)
|
76
|
-
@port << CGI.escapeHTML(str.to_s)
|
77
|
-
|
78
|
-
self
|
79
|
-
end
|
80
|
-
end
|
data/lib/wee/requesthandler.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
class Wee::RequestHandler
|
2
|
-
|
3
|
-
# Points to the Wee::Application object for which this handler is registered.
|
4
|
-
|
5
|
-
attr_accessor :application
|
6
|
-
|
7
|
-
# Each request handler of an application has a unique id, which should be
|
8
|
-
# non-guessable, that means it has to be cryptographically secure.
|
9
|
-
#
|
10
|
-
# This id is used to uniquely identify a RequestHandler from each other. This
|
11
|
-
# is the same id used as a session id in class Wee::Session.
|
12
|
-
|
13
|
-
attr_accessor :id
|
14
|
-
|
15
|
-
# Expire after this number of seconds of inactivity. If this value is +nil+,
|
16
|
-
# the RequestHandler will never expire due to inactivity (but may still due
|
17
|
-
# to <i>max_lifetime</i>).
|
18
|
-
|
19
|
-
attr_accessor :expire_after
|
20
|
-
|
21
|
-
# The lifetime of this handler is limited to this number of seconds. A value
|
22
|
-
# of +nil+ means infinite lifetime.
|
23
|
-
|
24
|
-
attr_accessor :max_lifetime
|
25
|
-
|
26
|
-
# The maximum number of requests this handler should serve. A value of +nil+
|
27
|
-
# means infinity.
|
28
|
-
|
29
|
-
attr_accessor :max_requests
|
30
|
-
|
31
|
-
|
32
|
-
# Terminates the handler.
|
33
|
-
#
|
34
|
-
# This will usually not immediatly terminate the handler from running, but
|
35
|
-
# further requests will not be answered.
|
36
|
-
|
37
|
-
def teminate
|
38
|
-
@running = false
|
39
|
-
end
|
40
|
-
|
41
|
-
# Query whether this handler is still alive.
|
42
|
-
|
43
|
-
def alive?
|
44
|
-
return false if not @running
|
45
|
-
return @running = false if @max_requests and @request_count >= @max_requests
|
46
|
-
|
47
|
-
now = Time.now
|
48
|
-
inactivity = now - @last_access
|
49
|
-
lifetime = now - @creation_time
|
50
|
-
|
51
|
-
return @running = false if @expire_after and inactivity > @expire_after
|
52
|
-
return @running = false if @max_lifetime and lifetime > @max_lifetime
|
53
|
-
return true
|
54
|
-
end
|
55
|
-
|
56
|
-
# Extend #handle_request in your own subclass.
|
57
|
-
|
58
|
-
def handle_request(context)
|
59
|
-
@request_count += 1
|
60
|
-
@last_access = Time.now
|
61
|
-
end
|
62
|
-
|
63
|
-
def statistics
|
64
|
-
now = Time.now
|
65
|
-
{
|
66
|
-
:last_access => @last_access, # The time when this handler was last accessed
|
67
|
-
:inactivity => now - @last_access, # The number of seconds of inactivity
|
68
|
-
:creation_time => @creation_time, # The time when this handler was created
|
69
|
-
:lifetime => now - @creation_time, # The uptime or lifetime of this handler in seconds
|
70
|
-
:request_count => @request_count # The number of requests served by this handler
|
71
|
-
}
|
72
|
-
end
|
73
|
-
|
74
|
-
def initialize
|
75
|
-
@last_access = @creation_time = Time.now
|
76
|
-
@expire_after = 30*60 # The default is 30 minutes of inactivity
|
77
|
-
@request_count = 0
|
78
|
-
@running = true
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
data/lib/wee/skeleton/og/README
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
NOTE THAT THIS WILL MODIFY THE SELECTED DATABASE!
|
2
|
-
|
3
|
-
= Configuration
|
4
|
-
|
5
|
-
You probably want to edit your database settings (conf/db.rb).
|
6
|
-
|
7
|
-
= How to start this application
|
8
|
-
|
9
|
-
If you have installed Wee and Og via Rubygems, then:
|
10
|
-
|
11
|
-
ruby -rubygems run.rb
|
12
|
-
|
13
|
-
Otherwise you can omit the -rubygems option:
|
14
|
-
|
15
|
-
ruby run.rb
|
16
|
-
|
17
|
-
Now point your browser to http://127.0.0.1:2000/app
|
18
|
-
|
19
|
-
= Where do I get more information?
|
20
|
-
|
21
|
-
* Read the documentation here:
|
22
|
-
|
23
|
-
http://ntecs.de/viewcvs/viewcvs/*checkout*/Wee/trunk/doc/rdoc/index.html
|
24
|
-
|
25
|
-
* Have a look at the examples in the examples/ directory. If you've installed
|
26
|
-
Wee via Rubygems, then you'll find the examples this way:
|
27
|
-
|
28
|
-
cd `gem environment gemdir`
|
29
|
-
cd gems/wee-VERSION
|
30
|
-
cd examples
|
31
|
-
|
32
|
-
* Post your questions on ruby-talk
|
33
|
-
|
34
|
-
* Post your questions to wee-talk:
|
35
|
-
|
36
|
-
http://rubyforge.org/mailman/listinfo/wee-talk
|
37
|
-
|
38
|
-
* Ask me personally (mneumann@ntecs.de).
|