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,12 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
6
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
4
|
<head>
|
8
|
-
<title>Class: Wee::Application</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
5
|
+
<title>Class: Wee::Application [RDoc Documentation]</title>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
7
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
8
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
9
|
<script type="text/javascript">
|
@@ -25,7 +22,7 @@
|
|
25
22
|
return false;
|
26
23
|
|
27
24
|
elemStyle = elem.style;
|
28
|
-
|
25
|
+
|
29
26
|
if ( elemStyle.display != "block" ) {
|
30
27
|
elemStyle.display = "block"
|
31
28
|
} else {
|
@@ -34,10 +31,10 @@
|
|
34
31
|
|
35
32
|
return true;
|
36
33
|
}
|
37
|
-
|
34
|
+
|
38
35
|
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }
|
40
|
-
|
36
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
|
37
|
+
|
41
38
|
// ]]>
|
42
39
|
</script>
|
43
40
|
|
@@ -45,7 +42,6 @@
|
|
45
42
|
<body>
|
46
43
|
|
47
44
|
|
48
|
-
|
49
45
|
<div id="classHeader">
|
50
46
|
<table class="header-table">
|
51
47
|
<tr class="top-aligned-row">
|
@@ -55,465 +51,308 @@
|
|
55
51
|
<tr class="top-aligned-row">
|
56
52
|
<td><strong>In:</strong></td>
|
57
53
|
<td>
|
54
|
+
|
55
|
+
|
58
56
|
<a href="../../files/lib/wee/application_rb.html">
|
57
|
+
|
59
58
|
lib/wee/application.rb
|
59
|
+
|
60
60
|
</a>
|
61
|
+
|
62
|
+
|
61
63
|
<br />
|
64
|
+
|
62
65
|
</td>
|
63
66
|
</tr>
|
64
67
|
|
68
|
+
|
65
69
|
<tr class="top-aligned-row">
|
66
70
|
<td><strong>Parent:</strong></td>
|
67
71
|
<td>
|
72
|
+
|
68
73
|
<a href="../Object.html">
|
74
|
+
|
69
75
|
Object
|
76
|
+
|
70
77
|
</a>
|
78
|
+
|
71
79
|
</td>
|
72
80
|
</tr>
|
81
|
+
|
73
82
|
</table>
|
74
83
|
</div>
|
75
84
|
<!-- banner header -->
|
76
85
|
|
77
86
|
<div id="bodyContent">
|
78
87
|
|
79
|
-
|
80
|
-
|
81
88
|
<div id="contextContent">
|
82
89
|
|
83
90
|
<div id="description">
|
84
91
|
<p>
|
85
|
-
A <a href="Application.html">Wee::Application</a> manages all
|
86
|
-
|
87
|
-
|
88
|
-
href="Session.html">Wee::Session</a> objects. It dispatches the request to
|
89
|
-
the correct handler by examining the request.
|
92
|
+
A <a href="Application.html">Wee::Application</a> manages all
|
93
|
+
Session’s of a single application. It dispatches the request to the
|
94
|
+
correct handler by examining the request.
|
90
95
|
</p>
|
91
96
|
|
92
97
|
</div>
|
93
98
|
|
94
|
-
|
95
|
-
<div id="contents-list">
|
96
|
-
<h3 class="section-bar">Contents</h3>
|
97
|
-
<ul>
|
98
|
-
<li><a href="#SEC00022">Properties</a></li>
|
99
|
-
</ul>
|
100
99
|
</div>
|
101
100
|
|
101
|
+
|
102
102
|
<div id="method-list">
|
103
103
|
<h3 class="section-bar">Methods</h3>
|
104
104
|
|
105
105
|
<div class="name-list">
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
106
|
+
|
107
|
+
<a href="#M000096">call</a>
|
108
|
+
|
109
|
+
<a href="#M000095">cleanup_sessions</a>
|
110
|
+
|
111
|
+
<a href="#M000098">insert_session</a>
|
112
|
+
|
113
|
+
<a href="#M000094">new</a>
|
114
|
+
|
115
|
+
<a href="#M000097">new_session</a>
|
116
|
+
|
116
117
|
</div>
|
117
118
|
</div>
|
118
119
|
|
119
120
|
</div>
|
120
121
|
|
121
|
-
|
122
122
|
<!-- if includes -->
|
123
123
|
|
124
124
|
<div id="section">
|
125
125
|
|
126
|
+
<div id="class-list">
|
127
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
126
128
|
|
129
|
+
Class <a href="Application/SessionCache.html" class="link">Wee::Application::SessionCache</a><br />
|
127
130
|
|
131
|
+
</div>
|
128
132
|
|
129
133
|
|
130
|
-
<div id="attribute-list">
|
131
|
-
<h3 class="section-bar">Attributes</h3>
|
132
|
-
|
133
|
-
<div class="name-list">
|
134
|
-
<table>
|
135
|
-
<tr class="top-aligned-row context-row">
|
136
|
-
<td class="context-item-name">id_generator</td>
|
137
|
-
<td class="context-item-value"> [RW] </td>
|
138
|
-
<td class="context-item-desc">
|
139
|
-
The generator used for creating unique request handler id’s.
|
140
|
-
|
141
|
-
</td>
|
142
|
-
</tr>
|
143
|
-
<tr class="top-aligned-row context-row">
|
144
|
-
<td class="context-item-name">max_request_handlers</td>
|
145
|
-
<td class="context-item-value"> [RW] </td>
|
146
|
-
<td class="context-item-desc">
|
147
|
-
The maximum number of request handlers
|
148
|
-
|
149
|
-
</td>
|
150
|
-
</tr>
|
151
|
-
</table>
|
152
|
-
</div>
|
153
|
-
</div>
|
154
|
-
|
155
134
|
|
156
135
|
|
157
136
|
<!-- if method_list -->
|
137
|
+
|
158
138
|
<div id="methods">
|
139
|
+
|
159
140
|
<h3 class="section-bar">Public Class methods</h3>
|
160
141
|
|
161
|
-
<div id="method-M000294" class="method-detail">
|
162
|
-
<a name="M000294"></a>
|
163
142
|
|
164
|
-
|
165
|
-
|
166
|
-
<span class="method-name">new</span><span class="method-args">(&block)</span>
|
167
|
-
</a>
|
168
|
-
</div>
|
169
|
-
|
170
|
-
<div class="method-description">
|
171
|
-
<p>
|
172
|
-
Creates a new application. The block is used to initialize the attributes:
|
173
|
-
</p>
|
174
|
-
<pre>
|
175
|
-
Wee::Application.new {|app|
|
176
|
-
app.default_request_handler { MySession.new }
|
177
|
-
app.id_generator = Wee::SimpleIdGenerator.new
|
178
|
-
app.max_request_handlers = 1000
|
179
|
-
}
|
180
|
-
</pre>
|
181
|
-
<p><a class="source-toggle" href="#"
|
182
|
-
onclick="toggleCode('M000294-source');return false;">[Source]</a></p>
|
183
|
-
<div class="method-source-code" id="M000294-source">
|
184
|
-
<pre>
|
185
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 34</span>
|
186
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
187
|
-
<span class="ruby-ivar">@request_handlers</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
188
|
-
<span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword kw">self</span>)
|
189
|
-
<span class="ruby-ivar">@id_generator</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">SimpleIdGenerator</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rand</span>(<span class="ruby-value">1_000_000</span>))
|
190
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@default_request_handler</span>.<span class="ruby-identifier">nil?</span>
|
191
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"No default request handler specified"</span>
|
192
|
-
<span class="ruby-keyword kw">end</span>
|
193
|
-
<span class="ruby-ivar">@mutex</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
143
|
+
<div id="method-M000094" class="method-detail">
|
144
|
+
<a name="M000094"></a>
|
194
145
|
|
195
|
-
|
196
|
-
<span class="ruby-comment cmt"># run once every minute</span>
|
197
|
-
<span class="ruby-ivar">@gc_thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> {
|
198
|
-
<span class="ruby-identifier">sleep</span> <span class="ruby-value">60</span>
|
199
|
-
<span class="ruby-ivar">@mutex</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-identifier">garbage_collect_handlers</span> }
|
200
|
-
}
|
201
|
-
<span class="ruby-keyword kw">end</span>
|
202
|
-
</pre>
|
203
|
-
</div>
|
204
|
-
</div>
|
205
|
-
</div>
|
146
|
+
<div class="method-heading">
|
206
147
|
|
207
|
-
|
148
|
+
<a href="#M000094" class="method-signature">
|
208
149
|
|
209
|
-
|
210
|
-
<a name="M000293"></a>
|
150
|
+
<span class="method-name">new</span><span class="method-args">(max_sessions=10_000, &block)</span>
|
211
151
|
|
212
|
-
<div class="method-heading">
|
213
|
-
<a href="#M000293" class="method-signature">
|
214
|
-
<span class="method-name">default_request_handler</span><span class="method-args">(&block)</span>
|
215
152
|
</a>
|
153
|
+
|
216
154
|
</div>
|
217
|
-
|
155
|
+
|
218
156
|
<div class="method-description">
|
157
|
+
|
219
158
|
<p>
|
220
|
-
|
221
|
-
|
159
|
+
Creates a new application. The block, when called, must return a new <a
|
160
|
+
href="Session.html">Session</a> instance.
|
222
161
|
</p>
|
162
|
+
<pre>
|
163
|
+
Wee::Application.new { Wee::Session.new(root_component) }
|
164
|
+
</pre>
|
165
|
+
|
223
166
|
<p><a class="source-toggle" href="#"
|
224
|
-
onclick="toggleCode('
|
225
|
-
<div class="method-source-code" id="
|
167
|
+
onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
|
168
|
+
<div class="method-source-code" id="M000094-source">
|
226
169
|
<pre>
|
227
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line
|
228
|
-
|
229
|
-
|
230
|
-
<span class="ruby-ivar">@
|
231
|
-
|
232
|
-
<span class="ruby-ivar">@
|
170
|
+
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 25</span>
|
171
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">max_sessions</span>=<span class="ruby-value">10_000</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
172
|
+
<span class="ruby-ivar">@session_factory</span> = <span class="ruby-identifier">block</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">raise</span>(<span class="ruby-constant">ArgumentError</span>)
|
173
|
+
<span class="ruby-ivar">@session_ids</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">IdGenerator</span><span class="ruby-operator">::</span><span class="ruby-constant">Secure</span>.<span class="ruby-identifier">new</span>
|
174
|
+
<span class="ruby-ivar">@sessions</span> = <span class="ruby-constant">SessionCache</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">max_sessions</span>)
|
175
|
+
<span class="ruby-ivar">@mutex</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
233
176
|
<span class="ruby-keyword kw">end</span>
|
234
|
-
<span class="ruby-keyword kw">end</span>
|
235
177
|
</pre>
|
236
178
|
</div>
|
237
|
-
</div>
|
238
|
-
</div>
|
239
179
|
|
240
|
-
<div id="method-M000295" class="method-detail">
|
241
|
-
<a name="M000295"></a>
|
242
|
-
|
243
|
-
<div class="method-heading">
|
244
|
-
<a href="#M000295" class="method-signature">
|
245
|
-
<span class="method-name">handle_request</span><span class="method-args">(context)</span>
|
246
|
-
</a>
|
247
180
|
</div>
|
248
|
-
|
249
|
-
<div class="method-description">
|
250
|
-
<p><a class="source-toggle" href="#"
|
251
|
-
onclick="toggleCode('M000295-source');return false;">[Source]</a></p>
|
252
|
-
<div class="method-source-code" id="M000295-source">
|
253
|
-
<pre>
|
254
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 51</span>
|
255
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_request</span>(<span class="ruby-identifier">context</span>)
|
256
|
-
<span class="ruby-identifier">request_handler_id</span> = <span class="ruby-identifier">context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">request_handler_id</span>
|
257
|
-
<span class="ruby-identifier">request_handler</span> = <span class="ruby-ivar">@mutex</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-ivar">@request_handlers</span>[<span class="ruby-identifier">request_handler_id</span>] }
|
258
|
-
|
259
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_handler_id</span>.<span class="ruby-identifier">nil?</span>
|
260
|
-
|
261
|
-
<span class="ruby-comment cmt"># No id was given -> check whether the maximum number of request-handlers</span>
|
262
|
-
<span class="ruby-comment cmt"># limit is reached. if not, create new id and handler</span>
|
263
|
-
|
264
|
-
<span class="ruby-identifier">request_handler</span> = <span class="ruby-ivar">@default_request_handler</span>.<span class="ruby-identifier">call</span>
|
265
|
-
<span class="ruby-identifier">insert_new_request_handler</span>(<span class="ruby-identifier">request_handler</span>)
|
266
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">request_handler_id</span> = <span class="ruby-identifier">request_handler</span>.<span class="ruby-identifier">id</span>
|
267
|
-
<span class="ruby-identifier">handle_request</span>(<span class="ruby-identifier">context</span>)
|
268
|
-
<span class="ruby-keyword kw">return</span>
|
181
|
+
</div>
|
269
182
|
|
270
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">request_handler</span>.<span class="ruby-identifier">nil?</span>
|
271
183
|
|
272
|
-
<
|
273
|
-
<span class="ruby-comment cmt"># request handler has expired. </span>
|
184
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
274
185
|
|
275
|
-
<span class="ruby-identifier">request_handler_expired</span>(<span class="ruby-identifier">context</span>)
|
276
|
-
<span class="ruby-keyword kw">return</span>
|
277
186
|
|
278
|
-
|
187
|
+
<div id="method-M000096" class="method-detail">
|
188
|
+
<a name="M000096"></a>
|
279
189
|
|
280
|
-
|
190
|
+
<div class="method-heading">
|
281
191
|
|
282
|
-
|
283
|
-
<span class="ruby-keyword kw">return</span>
|
192
|
+
<a href="#M000096" class="method-signature">
|
284
193
|
|
285
|
-
|
194
|
+
<span class="method-name">call</span><span class="method-args">(env)</span>
|
286
195
|
|
287
|
-
|
196
|
+
</a>
|
288
197
|
|
289
|
-
<span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">exn</span>
|
290
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">response</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">ErrorResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">exn</span>)
|
291
|
-
<span class="ruby-keyword kw">end</span>
|
292
|
-
</pre>
|
293
|
-
</div>
|
294
198
|
</div>
|
295
|
-
</div>
|
296
|
-
|
297
|
-
<div id="method-M000296" class="method-detail">
|
298
|
-
<a name="M000296"></a>
|
299
199
|
|
300
|
-
<div class="method-heading">
|
301
|
-
<a href="#M000296" class="method-signature">
|
302
|
-
<span class="method-name">insert_new_request_handler</span><span class="method-args">(request_handler)</span>
|
303
|
-
</a>
|
304
|
-
</div>
|
305
|
-
|
306
200
|
<div class="method-description">
|
201
|
+
|
202
|
+
<p>
|
203
|
+
Handles a web request
|
204
|
+
</p>
|
205
|
+
|
307
206
|
<p><a class="source-toggle" href="#"
|
308
|
-
onclick="toggleCode('
|
309
|
-
<div class="method-source-code" id="
|
207
|
+
onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
|
208
|
+
<div class="method-source-code" id="M000096-source">
|
310
209
|
<pre>
|
311
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
<span class="ruby-identifier">
|
317
|
-
|
318
|
-
|
319
|
-
<span class="ruby-keyword kw">
|
320
|
-
<span class="ruby-
|
321
|
-
<span class="ruby-identifier">
|
210
|
+
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 42</span>
|
211
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
212
|
+
<span class="ruby-identifier">request</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)
|
213
|
+
|
214
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">session_id</span>
|
215
|
+
<span class="ruby-identifier">session</span> = <span class="ruby-ivar">@mutex</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-ivar">@sessions</span>[<span class="ruby-identifier">request</span>.<span class="ruby-identifier">session_id</span>] }
|
216
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">session</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">session</span>.<span class="ruby-identifier">alive?</span>
|
217
|
+
<span class="ruby-identifier">session</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
218
|
+
<span class="ruby-keyword kw">else</span>
|
219
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">build_url</span>(<span class="ruby-identifier">:session_id</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:page_id</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>)
|
220
|
+
<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">RefreshResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"Invalid or expired session"</span>, <span class="ruby-identifier">url</span>).<span class="ruby-identifier">finish</span>
|
322
221
|
<span class="ruby-keyword kw">end</span>
|
222
|
+
<span class="ruby-keyword kw">else</span>
|
223
|
+
<span class="ruby-identifier">session</span> = <span class="ruby-identifier">new_session</span>()
|
224
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">build_url</span>(<span class="ruby-identifier">:session_id</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">session</span>.<span class="ruby-identifier">id</span>, <span class="ruby-identifier">:page_id</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>)
|
225
|
+
<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">RedirectResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">url</span>).<span class="ruby-identifier">finish</span>
|
323
226
|
<span class="ruby-keyword kw">end</span>
|
324
|
-
|
325
|
-
<span class="ruby-identifier">request_handler</span>.<span class="ruby-identifier">id</span> = <span class="ruby-identifier">unique_request_handler_id</span>()
|
326
|
-
<span class="ruby-identifier">request_handler</span>.<span class="ruby-identifier">application</span> = <span class="ruby-keyword kw">self</span>
|
327
|
-
<span class="ruby-ivar">@request_handlers</span>[<span class="ruby-identifier">request_handler</span>.<span class="ruby-identifier">id</span>] = <span class="ruby-identifier">request_handler</span>
|
328
|
-
}
|
329
|
-
<span class="ruby-keyword kw">end</span>
|
227
|
+
<span class="ruby-keyword kw">end</span>
|
330
228
|
</pre>
|
331
229
|
</div>
|
230
|
+
|
332
231
|
</div>
|
333
232
|
</div>
|
334
233
|
|
335
234
|
|
336
|
-
|
337
|
-
|
338
|
-
<h2 class="section-title"><a name="SEC00022">Properties</a></h2>
|
339
|
-
<div class="section-comment">
|
340
|
-
|
341
|
-
</div>
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
235
|
+
<div id="method-M000095" class="method-detail">
|
236
|
+
<a name="M000095"></a>
|
348
237
|
|
238
|
+
<div class="method-heading">
|
349
239
|
|
350
|
-
|
351
|
-
<div id="methods">
|
352
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
240
|
+
<a href="#M000095" class="method-signature">
|
353
241
|
|
354
|
-
|
355
|
-
<a name="M000299"></a>
|
242
|
+
<span class="method-name">cleanup_sessions</span><span class="method-args">()</span>
|
356
243
|
|
357
|
-
<div class="method-heading">
|
358
|
-
<a href="#M000299" class="method-signature">
|
359
|
-
<span class="method-name">get_property</span><span class="method-args">(prop, klass)</span>
|
360
244
|
</a>
|
245
|
+
|
361
246
|
</div>
|
362
|
-
|
247
|
+
|
363
248
|
<div class="method-description">
|
249
|
+
|
364
250
|
<p>
|
365
|
-
|
251
|
+
Garbage collect dead sessions
|
366
252
|
</p>
|
253
|
+
|
367
254
|
<p><a class="source-toggle" href="#"
|
368
|
-
onclick="toggleCode('
|
369
|
-
<div class="method-source-code" id="
|
255
|
+
onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
|
256
|
+
<div class="method-source-code" id="M000095-source">
|
370
257
|
<pre>
|
371
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line
|
372
|
-
|
373
|
-
|
374
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">properties</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">klass</span>, {})[<span class="ruby-identifier">prop</span>]
|
375
|
-
<span class="ruby-keyword kw">else</span>
|
376
|
-
<span class="ruby-keyword kw">nil</span>
|
258
|
+
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 35</span>
|
259
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup_sessions</span>
|
260
|
+
<span class="ruby-ivar">@mutex</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-ivar">@sessions</span>.<span class="ruby-identifier">garbage_collect</span> }
|
377
261
|
<span class="ruby-keyword kw">end</span>
|
378
|
-
<span class="ruby-keyword kw">end</span>
|
379
262
|
</pre>
|
380
263
|
</div>
|
264
|
+
|
381
265
|
</div>
|
382
266
|
</div>
|
383
267
|
|
384
|
-
<div id="method-M000297" class="method-detail">
|
385
|
-
<a name="M000297"></a>
|
386
268
|
|
387
|
-
|
388
|
-
|
389
|
-
<span class="method-name">properties</span><span class="method-args">()</span>
|
390
|
-
</a>
|
391
|
-
</div>
|
392
|
-
|
393
|
-
<div class="method-description">
|
394
|
-
<p><a class="source-toggle" href="#"
|
395
|
-
onclick="toggleCode('M000297-source');return false;">[Source]</a></p>
|
396
|
-
<div class="method-source-code" id="M000297-source">
|
397
|
-
<pre>
|
398
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 112</span>
|
399
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">properties</span>() <span class="ruby-ivar">@__properties</span> <span class="ruby-keyword kw">end</span>
|
400
|
-
</pre>
|
401
|
-
</div>
|
402
|
-
</div>
|
403
|
-
</div>
|
269
|
+
<h3 class="section-bar">Protected Instance methods</h3>
|
270
|
+
|
404
271
|
|
405
|
-
<div id="method-
|
406
|
-
<a name="
|
272
|
+
<div id="method-M000098" class="method-detail">
|
273
|
+
<a name="M000098"></a>
|
407
274
|
|
408
275
|
<div class="method-heading">
|
409
|
-
<a href="#M000298" class="method-signature">
|
410
|
-
<span class="method-name">properties=</span><span class="method-args">(props)</span>
|
411
|
-
</a>
|
412
|
-
</div>
|
413
|
-
|
414
|
-
<div class="method-description">
|
415
|
-
<p><a class="source-toggle" href="#"
|
416
|
-
onclick="toggleCode('M000298-source');return false;">[Source]</a></p>
|
417
|
-
<div class="method-source-code" id="M000298-source">
|
418
|
-
<pre>
|
419
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 113</span>
|
420
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">properties=</span>(<span class="ruby-identifier">props</span>) <span class="ruby-ivar">@__properties</span> = <span class="ruby-identifier">props</span> <span class="ruby-keyword kw">end</span>
|
421
|
-
</pre>
|
422
|
-
</div>
|
423
|
-
</div>
|
424
|
-
</div>
|
425
276
|
|
426
|
-
|
277
|
+
<a href="#M000098" class="method-signature">
|
427
278
|
|
428
|
-
|
429
|
-
<a name="M000301"></a>
|
279
|
+
<span class="method-name">insert_session</span><span class="method-args">(session, retries=3)</span>
|
430
280
|
|
431
|
-
<div class="method-heading">
|
432
|
-
<a href="#M000301" class="method-signature">
|
433
|
-
<span class="method-name">garbage_collect_handlers</span><span class="method-args">()</span>
|
434
281
|
</a>
|
282
|
+
|
435
283
|
</div>
|
436
|
-
|
284
|
+
|
437
285
|
<div class="method-description">
|
438
|
-
|
439
|
-
MUST be called while holding @mutex
|
440
|
-
</p>
|
286
|
+
|
441
287
|
<p><a class="source-toggle" href="#"
|
442
|
-
onclick="toggleCode('
|
443
|
-
<div class="method-source-code" id="
|
288
|
+
onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
|
289
|
+
<div class="method-source-code" id="M000098-source">
|
444
290
|
<pre>
|
445
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line
|
446
|
-
|
447
|
-
|
448
|
-
|
291
|
+
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 69</span>
|
292
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">insert_session</span>(<span class="ruby-identifier">session</span>, <span class="ruby-identifier">retries</span>=<span class="ruby-value">3</span>)
|
293
|
+
<span class="ruby-identifier">retries</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
|
294
|
+
<span class="ruby-ivar">@mutex</span>.<span class="ruby-identifier">synchronize</span> {
|
295
|
+
<span class="ruby-identifier">id</span> = <span class="ruby-ivar">@session_ids</span>.<span class="ruby-identifier">next</span>
|
296
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@sessions</span>[<span class="ruby-identifier">id</span>].<span class="ruby-identifier">nil?</span>
|
297
|
+
<span class="ruby-ivar">@sessions</span>[<span class="ruby-identifier">id</span>] = <span class="ruby-identifier">session</span>
|
298
|
+
<span class="ruby-identifier">session</span>.<span class="ruby-identifier">id</span> = <span class="ruby-identifier">id</span>
|
299
|
+
<span class="ruby-keyword kw">return</span>
|
300
|
+
<span class="ruby-keyword kw">end</span>
|
301
|
+
}
|
302
|
+
<span class="ruby-keyword kw">end</span>
|
303
|
+
<span class="ruby-identifier">raise</span>
|
304
|
+
<span class="ruby-keyword kw">end</span>
|
449
305
|
</pre>
|
450
306
|
</div>
|
307
|
+
|
451
308
|
</div>
|
452
309
|
</div>
|
453
310
|
|
454
|
-
|
455
|
-
|
311
|
+
|
312
|
+
<div id="method-M000097" class="method-detail">
|
313
|
+
<a name="M000097"></a>
|
456
314
|
|
457
315
|
<div class="method-heading">
|
458
|
-
<a href="#M000302" class="method-signature">
|
459
|
-
<span class="method-name">request_handler_expired</span><span class="method-args">(context)</span>
|
460
|
-
</a>
|
461
|
-
</div>
|
462
|
-
|
463
|
-
<div class="method-description">
|
464
|
-
<p><a class="source-toggle" href="#"
|
465
|
-
onclick="toggleCode('M000302-source');return false;">[Source]</a></p>
|
466
|
-
<div class="method-source-code" id="M000302-source">
|
467
|
-
<pre>
|
468
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 141</span>
|
469
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_handler_expired</span>(<span class="ruby-identifier">context</span>)
|
470
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">response</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">RefreshResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"Invalid or expired request handler!"</span>,
|
471
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">build_url</span>(<span class="ruby-identifier">:request_handler_id</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>,
|
472
|
-
<span class="ruby-identifier">:page_id</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>))
|
473
|
-
<span class="ruby-keyword kw">end</span>
|
474
|
-
</pre>
|
475
|
-
</div>
|
476
|
-
</div>
|
477
|
-
</div>
|
478
316
|
|
479
|
-
|
480
|
-
|
317
|
+
<a href="#M000097" class="method-signature">
|
318
|
+
|
319
|
+
<span class="method-name">new_session</span><span class="method-args">()</span>
|
481
320
|
|
482
|
-
<div class="method-heading">
|
483
|
-
<a href="#M000300" class="method-signature">
|
484
|
-
<span class="method-name">unique_request_handler_id</span><span class="method-args">()</span>
|
485
321
|
</a>
|
322
|
+
|
486
323
|
</div>
|
487
|
-
|
324
|
+
|
488
325
|
<div class="method-description">
|
489
|
-
|
490
|
-
MUST be called while holding @mutex
|
491
|
-
</p>
|
326
|
+
|
492
327
|
<p><a class="source-toggle" href="#"
|
493
|
-
onclick="toggleCode('
|
494
|
-
<div class="method-source-code" id="
|
328
|
+
onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
|
329
|
+
<div class="method-source-code" id="M000097-source">
|
495
330
|
<pre>
|
496
|
-
<span class="ruby-comment cmt"># File lib/wee/application.rb, line
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
331
|
+
<span class="ruby-comment cmt"># File lib/wee/application.rb, line 62</span>
|
332
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_session</span>
|
333
|
+
<span class="ruby-identifier">session</span> = <span class="ruby-ivar">@session_factory</span>.<span class="ruby-identifier">call</span>
|
334
|
+
<span class="ruby-identifier">session</span>.<span class="ruby-identifier">application</span> = <span class="ruby-keyword kw">self</span>
|
335
|
+
<span class="ruby-identifier">insert_session</span>(<span class="ruby-identifier">session</span>)
|
336
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">session</span>
|
337
|
+
<span class="ruby-keyword kw">end</span>
|
502
338
|
</pre>
|
503
339
|
</div>
|
340
|
+
|
504
341
|
</div>
|
505
342
|
</div>
|
506
343
|
|
507
344
|
|
345
|
+
|
508
346
|
</div>
|
509
347
|
|
510
348
|
|
511
|
-
</div>
|
512
349
|
|
513
350
|
|
351
|
+
</div>
|
352
|
+
|
514
353
|
<div id="validator-badges">
|
515
354
|
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
516
355
|
</div>
|
517
356
|
|
518
357
|
</body>
|
519
|
-
</html>
|
358
|
+
</html>
|