wee 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -1
- data/Rakefile +5 -0
- data/TODO +6 -0
- data/doc/rdoc/classes/Enumerable.html +6 -6
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +10 -10
- data/doc/rdoc/classes/Wee/Application.html +110 -52
- data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +8 -15
- data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +8 -19
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +22 -22
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +156 -0
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +50 -25
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +36 -36
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +16 -16
- data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +8 -15
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/Page.html +14 -14
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +28 -28
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +14 -14
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +14 -14
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +36 -36
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +6 -6
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +28 -28
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush.html +19 -19
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +33 -33
- data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
- data/doc/rdoc/classes/Wee/Canvas.html +24 -24
- data/doc/rdoc/classes/Wee/Component.html +163 -138
- data/doc/rdoc/classes/Wee/Decoration.html +72 -41
- data/doc/rdoc/classes/Wee/Delegate.html +31 -31
- data/doc/rdoc/classes/Wee/ErrorResponse.html +12 -12
- data/doc/rdoc/classes/Wee/GenericResponse.html +6 -6
- data/doc/rdoc/classes/Wee/Helper.html +148 -0
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +267 -166
- data/doc/rdoc/classes/Wee/HtmlWriter.html +40 -40
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +12 -12
- data/doc/rdoc/classes/Wee/PageDecoration.html +199 -0
- data/doc/rdoc/classes/Wee/Presenter.html +69 -69
- data/doc/rdoc/classes/Wee/RedirectResponse.html +6 -6
- data/doc/rdoc/classes/Wee/RefreshResponse.html +6 -6
- data/doc/rdoc/classes/Wee/Request.html +18 -18
- data/doc/rdoc/classes/Wee/RequestHandler.html +32 -31
- data/doc/rdoc/classes/Wee/Response.html +24 -24
- data/doc/rdoc/classes/Wee/Session.html +83 -64
- data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +18 -18
- data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
- data/doc/rdoc/classes/Wee/Utils/LRUCache.html +6 -6
- data/doc/rdoc/classes/Wee/ValueHolder.html +18 -18
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +66 -62
- data/doc/rdoc/classes/Wee.html +63 -2
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +6 -9
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core_rb.html +3 -3
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/session_rb.html +2 -1
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +108 -0
- data/doc/rdoc/files/lib/wee_rb.html +2 -1
- data/doc/rdoc/fr_class_index.html +3 -1
- data/doc/rdoc/fr_file_index.html +4 -0
- data/doc/rdoc/fr_method_index.html +203 -191
- data/examples/example.rb +2 -16
- data/examples/test.rb +15 -18
- data/lib/wee/adaptors/webrick.rb +3 -1
- data/lib/wee/application.rb +55 -19
- data/lib/wee/components/page_decoration.rb +14 -0
- data/lib/wee/components.rb +1 -0
- data/lib/wee/core/callback.rb +1 -1
- data/lib/wee/core/component.rb +27 -3
- data/lib/wee/core/decoration.rb +9 -0
- data/lib/wee/renderer/html/brushes.rb +21 -23
- data/lib/wee/renderer/html/canvas.rb +25 -4
- data/lib/wee/requesthandler.rb +1 -0
- data/lib/wee/session.rb +21 -1
- data/lib/wee/utils/autoreload.rb +27 -0
- data/lib/wee/utils/helper.rb +15 -0
- data/lib/wee.rb +2 -1
- metadata +203 -191
- data/test/components/page_decoration.rb +0 -7
@@ -20,222 +20,234 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/Wee/
|
24
|
-
<a href="classes/Wee/
|
25
|
-
<a href="classes/Wee/
|
23
|
+
<a href="classes/Wee/HtmlWriter.html#M000203"><< (Wee::HtmlWriter)</a><br />
|
24
|
+
<a href="classes/Wee/Response.html#M000155"><< (Wee::Response)</a><br />
|
25
|
+
<a href="classes/Wee/HtmlCanvas.html#M000070"><< (Wee::HtmlCanvas)</a><br />
|
26
26
|
<a href="classes/Cache/StorageCache.html#M000010">[] (Cache::StorageCache)</a><br />
|
27
27
|
<a href="classes/Cache/StorageCache.html#M000011">[]= (Cache::StorageCache)</a><br />
|
28
|
-
<a href="classes/Wee/Brush/AnchorTag.html#
|
29
|
-
<a href="classes/Wee/Brush/FormTag.html#
|
30
|
-
<a href="classes/Cache/Strategy/LFU.html#M000022">access (Cache::Strategy::LFU)</a><br />
|
28
|
+
<a href="classes/Wee/Brush/AnchorTag.html#M000126">__set_url (Wee::Brush::AnchorTag)</a><br />
|
29
|
+
<a href="classes/Wee/Brush/FormTag.html#M000086">__set_url (Wee::Brush::FormTag)</a><br />
|
31
30
|
<a href="classes/Cache/Strategy/LRU.html#M000018">access (Cache::Strategy::LRU)</a><br />
|
32
31
|
<a href="classes/Cache/Strategy/Unbounded.html#M000026">access (Cache::Strategy::Unbounded)</a><br />
|
33
|
-
<a href="classes/
|
34
|
-
<a href="classes/Wee/
|
35
|
-
<a href="classes/Wee/
|
36
|
-
<a href="classes/Wee/Component.html#
|
37
|
-
<a href="classes/Wee/
|
38
|
-
<a href="classes/Wee/Brush/TableRowTag.html#
|
39
|
-
<a href="classes/Wee/
|
40
|
-
<a href="classes/Wee/
|
41
|
-
<a href="classes/Wee/CallbackRegistry.html#
|
42
|
-
<a href="classes/Wee/
|
43
|
-
<a href="classes/Wee/
|
44
|
-
<a href="classes/Wee/
|
45
|
-
<a href="classes/Wee/
|
46
|
-
<a href="classes/Wee/
|
47
|
-
<a href="classes/Wee
|
48
|
-
<a href="classes/Wee/
|
49
|
-
<a href="classes/Wee/
|
50
|
-
<a href="classes/Wee/
|
51
|
-
<a href="classes/Wee/
|
52
|
-
<a href="classes/Wee/
|
53
|
-
<a href="classes/Wee/
|
54
|
-
<a href="classes/Wee/
|
55
|
-
<a href="classes/Wee/
|
56
|
-
<a href="classes/Wee/
|
57
|
-
<a href="classes/Wee/
|
58
|
-
<a href="classes/Wee/Brush/
|
59
|
-
<a href="classes/Wee/
|
60
|
-
<a href="classes/Wee/Brush.html#
|
61
|
-
<a href="classes/Wee/
|
62
|
-
<a href="classes/Wee/
|
63
|
-
<a href="classes/Wee/
|
64
|
-
<a href="classes/Wee/
|
65
|
-
<a href="classes/Wee/
|
66
|
-
<a href="classes/Wee/
|
67
|
-
<a href="classes/Wee/
|
68
|
-
<a href="classes/Wee/Session.html#
|
32
|
+
<a href="classes/Cache/Strategy/LFU.html#M000022">access (Cache::Strategy::LFU)</a><br />
|
33
|
+
<a href="classes/Wee/Brush/FormTag.html#M000084">action (Wee::Brush::FormTag)</a><br />
|
34
|
+
<a href="classes/Wee/Snapshot.html#M000075">add (Wee::Snapshot)</a><br />
|
35
|
+
<a href="classes/Wee/Component.html#M000178">add_child (Wee::Component)</a><br />
|
36
|
+
<a href="classes/Wee/Component.html#M000182">add_decoration (Wee::Component)</a><br />
|
37
|
+
<a href="classes/Wee/Brush/TableRowTag.html#M000099">align_top (Wee::Brush::TableRowTag)</a><br />
|
38
|
+
<a href="classes/Wee/Brush/TableDataTag.html#M000097">align_top (Wee::Brush::TableDataTag)</a><br />
|
39
|
+
<a href="classes/Wee/RequestHandler.html#M000220">alive? (Wee::RequestHandler)</a><br />
|
40
|
+
<a href="classes/Wee/CallbackRegistry.html#M000160">all_of_type (Wee::CallbackRegistry)</a><br />
|
41
|
+
<a href="classes/Wee/CallbackStream.html#M000214">all_of_type (Wee::CallbackStream)</a><br />
|
42
|
+
<a href="classes/Wee/HtmlCanvas.html#M000063">anchor (Wee::HtmlCanvas)</a><br />
|
43
|
+
<a href="classes/Wee/Component.html#M000188">answer (Wee::Component)</a><br />
|
44
|
+
<a href="classes/Wee/Helper.html#M000034">app_for (Wee::Helper)</a><br />
|
45
|
+
<a href="classes/Wee/Request.html#M000207">application_path (Wee::Request)</a><br />
|
46
|
+
<a href="classes/Wee.html#M000033">autoreload (Wee)</a><br />
|
47
|
+
<a href="classes/Wee/Component.html#M000186">backtrack_state (Wee::Component)</a><br />
|
48
|
+
<a href="classes/Wee/Delegate.html#M000218">backtrack_state (Wee::Delegate)</a><br />
|
49
|
+
<a href="classes/Wee/Presenter.html#M000197">backtrack_state (Wee::Presenter)</a><br />
|
50
|
+
<a href="classes/Wee/Decoration.html#M000143">backtrack_state (Wee::Decoration)</a><br />
|
51
|
+
<a href="classes/Wee/Component.html#M000185">backtrack_state_chain (Wee::Component)</a><br />
|
52
|
+
<a href="classes/Wee/HtmlCanvas.html#M000065">bold (Wee::HtmlCanvas)</a><br />
|
53
|
+
<a href="classes/Wee/HtmlCanvas.html#M000067">break (Wee::HtmlCanvas)</a><br />
|
54
|
+
<a href="classes/Wee/Request.html#M000208">build_url (Wee::Request)</a><br />
|
55
|
+
<a href="classes/Wee/Component.html#M000187">call (Wee::Component)</a><br />
|
56
|
+
<a href="classes/Wee/LiteralMethodCallback.html#M000227">call (Wee::LiteralMethodCallback)</a><br />
|
57
|
+
<a href="classes/Wee/Brush/InputCallbackMixin.html#M000082">callback (Wee::Brush::InputCallbackMixin)</a><br />
|
58
|
+
<a href="classes/Wee/Brush/SelectListTag.html#M000106">callback (Wee::Brush::SelectListTag)</a><br />
|
59
|
+
<a href="classes/Wee/Brush/ActionURLCallbackMixin.html#M000080">callback (Wee::Brush::ActionURLCallbackMixin)</a><br />
|
60
|
+
<a href="classes/Wee/Brush/ActionCallbackMixin.html#M000081">callback (Wee::Brush::ActionCallbackMixin)</a><br />
|
61
|
+
<a href="classes/Wee/Component.html#M000177">children (Wee::Component)</a><br />
|
62
|
+
<a href="classes/Wee/Brush.html#M000079">close (Wee::Brush)</a><br />
|
63
|
+
<a href="classes/Wee/Canvas.html#M000162">close (Wee::Canvas)</a><br />
|
64
|
+
<a href="classes/Wee/Brush/TableRowTag.html#M000100">columns (Wee::Brush::TableRowTag)</a><br />
|
65
|
+
<a href="classes/Wee/Response.html#M000153">content_type (Wee::Response)</a><br />
|
66
|
+
<a href="classes/Wee/Response.html#M000154">content_type= (Wee::Response)</a><br />
|
67
|
+
<a href="classes/Wee/Session.html#M000136">create_page (Wee::Session)</a><br />
|
68
|
+
<a href="classes/Wee/Brush/GenericTagBrush.html#M000113">css_class (Wee::Brush::GenericTagBrush)</a><br />
|
69
|
+
<a href="classes/Wee/Session.html#M000131">current (Wee::Session)</a><br />
|
70
|
+
<a href="classes/Wee/SimpleIdGenerator.html#M000166">current (Wee::SimpleIdGenerator)</a><br />
|
69
71
|
<a href="classes/Cache/Strategy/CapacityBounded.html#M000014">dec (Cache::Strategy::CapacityBounded)</a><br />
|
70
|
-
<a href="classes/Wee/Component.html#
|
71
|
-
<a href="classes/Wee/Component.html#
|
72
|
-
<a href="classes/Wee/Application.html#
|
73
|
-
<a href="classes/Cache/StorageCache.html#M000007">delete (Cache::StorageCache)</a><br />
|
72
|
+
<a href="classes/Wee/Component.html#M000179">decoration (Wee::Component)</a><br />
|
73
|
+
<a href="classes/Wee/Component.html#M000180">decoration= (Wee::Component)</a><br />
|
74
|
+
<a href="classes/Wee/Application.html#M000146">default_request_handler (Wee::Application)</a><br />
|
74
75
|
<a href="classes/Cache/Strategy/LFU.html#M000023">delete (Cache::Strategy::LFU)</a><br />
|
75
76
|
<a href="classes/Cache/Strategy/LRU.html#M000019">delete (Cache::Strategy::LRU)</a><br />
|
77
|
+
<a href="classes/Cache/StorageCache.html#M000007">delete (Cache::StorageCache)</a><br />
|
76
78
|
<a href="classes/Cache/Strategy/Unbounded.html#M000027">delete (Cache::Strategy::Unbounded)</a><br />
|
77
|
-
<a href="classes/Wee/Brush/TextAreaTag.html#
|
78
|
-
<a href="classes/Wee/WEBrickAdaptor.html#
|
79
|
-
<a href="classes/Wee/WEBrickAdaptor.html#
|
80
|
-
<a href="classes/Wee/
|
81
|
-
<a href="classes/Wee/
|
82
|
-
<a href="classes/Wee/Presenter.html#
|
83
|
-
<a href="classes/Wee/
|
84
|
-
<a href="classes/Wee/Component.html#M000172">
|
79
|
+
<a href="classes/Wee/Brush/TextAreaTag.html#M000089">disabled (Wee::Brush::TextAreaTag)</a><br />
|
80
|
+
<a href="classes/Wee/WEBrickAdaptor.html#M000041">do_GET (Wee::WEBrickAdaptor)</a><br />
|
81
|
+
<a href="classes/Wee/WEBrickAdaptor.html#M000042">do_POST (Wee::WEBrickAdaptor)</a><br />
|
82
|
+
<a href="classes/Wee/Delegate.html#M000217">do_render (Wee::Delegate)</a><br />
|
83
|
+
<a href="classes/Wee/Decoration.html#M000142">do_render (Wee::Decoration)</a><br />
|
84
|
+
<a href="classes/Wee/Presenter.html#M000191">do_render (Wee::Presenter)</a><br />
|
85
|
+
<a href="classes/Wee/PageDecoration.html#M000211">do_render (Wee::PageDecoration)</a><br />
|
86
|
+
<a href="classes/Wee/Component.html#M000172">do_render_chain (Wee::Component)</a><br />
|
87
|
+
<a href="classes/Wee/Component.html#M000181">each_decoration (Wee::Component)</a><br />
|
85
88
|
<a href="classes/Cache/Strategy/CapacityBounded.html#M000016">empty? (Cache::Strategy::CapacityBounded)</a><br />
|
86
|
-
<a href="classes/Wee/HtmlWriter.html#
|
87
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
88
|
-
<a href="classes/Wee/
|
89
|
+
<a href="classes/Wee/HtmlWriter.html#M000204">encode_text (Wee::HtmlWriter)</a><br />
|
90
|
+
<a href="classes/Wee/HtmlCanvas.html#M000071">encode_text (Wee::HtmlCanvas)</a><br />
|
91
|
+
<a href="classes/Wee/Brush/FormTag.html#M000085">enctype (Wee::Brush::FormTag)</a><br />
|
92
|
+
<a href="classes/Wee/HtmlWriter.html#M000201">end_tag (Wee::HtmlWriter)</a><br />
|
89
93
|
<a href="classes/Cache/StorageCache.html#M000008">fetch (Cache::StorageCache)</a><br />
|
90
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
94
|
+
<a href="classes/Wee/HtmlCanvas.html#M000061">file_upload (Wee::HtmlCanvas)</a><br />
|
95
|
+
<a href="classes/Wee/HtmlCanvas.html#M000053">form (Wee::HtmlCanvas)</a><br />
|
91
96
|
<a href="classes/Cache/Strategy/CapacityBounded.html#M000015">full? (Cache::Strategy::CapacityBounded)</a><br />
|
92
|
-
<a href="classes/Wee/
|
93
|
-
<a href="classes/Wee/CallbackRegistry.html#
|
94
|
-
<a href="classes/Wee/
|
95
|
-
<a href="classes/Wee/
|
96
|
-
<a href="classes/Wee/
|
97
|
-
<a href="classes/Wee/
|
98
|
-
<a href="classes/Wee/
|
99
|
-
<a href="classes/Wee/
|
97
|
+
<a href="classes/Wee/Application.html#M000150">garbage_collect_handlers (Wee::Application)</a><br />
|
98
|
+
<a href="classes/Wee/CallbackRegistry.html#M000159">get_callback_for (Wee::CallbackRegistry)</a><br />
|
99
|
+
<a href="classes/Wee/CallbackRegistry.html#M000158">get_ids_for (Wee::CallbackRegistry)</a><br />
|
100
|
+
<a href="classes/Wee/PageDecoration.html#M000210">global? (Wee::PageDecoration)</a><br />
|
101
|
+
<a href="classes/Wee/Decoration.html#M000140">global? (Wee::Decoration)</a><br />
|
102
|
+
<a href="classes/Wee/HtmlCanvas.html#M000073">handle (Wee::HtmlCanvas)</a><br />
|
103
|
+
<a href="classes/Wee/Session.html#M000138">handle_new_page_view (Wee::Session)</a><br />
|
104
|
+
<a href="classes/Wee/Session.html#M000134">handle_request (Wee::Session)</a><br />
|
105
|
+
<a href="classes/Wee/WEBrickAdaptor.html#M000040">handle_request (Wee::WEBrickAdaptor)</a><br />
|
106
|
+
<a href="classes/Wee/RequestHandler.html#M000221">handle_request (Wee::RequestHandler)</a><br />
|
107
|
+
<a href="classes/Wee/Application.html#M000148">handle_request (Wee::Application)</a><br />
|
100
108
|
<a href="classes/Cache/StorageCache.html#M000006">has_key? (Cache::StorageCache)</a><br />
|
101
|
-
<a href="classes/Wee/Brush/TableRowTag.html#
|
102
|
-
<a href="classes/Wee/Brush/AnchorTag.html#
|
103
|
-
<a href="classes/Wee/Brush/GenericTagBrush.html#
|
104
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
105
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
109
|
+
<a href="classes/Wee/Brush/TableRowTag.html#M000101">headings (Wee::Brush::TableRowTag)</a><br />
|
110
|
+
<a href="classes/Wee/Brush/AnchorTag.html#M000125">href (Wee::Brush::AnchorTag)</a><br />
|
111
|
+
<a href="classes/Wee/Brush/GenericTagBrush.html#M000114">id (Wee::Brush::GenericTagBrush)</a><br />
|
112
|
+
<a href="classes/Wee/HtmlCanvas.html#M000068">image (Wee::HtmlCanvas)</a><br />
|
113
|
+
<a href="classes/Wee/HtmlCanvas.html#M000060">image_button (Wee::HtmlCanvas)</a><br />
|
106
114
|
<a href="classes/Cache/Strategy/CapacityBounded.html#M000013">inc (Cache::Strategy::CapacityBounded)</a><br />
|
107
|
-
<a href="classes/Wee/Component.html#
|
108
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
115
|
+
<a href="classes/Wee/Component.html#M000176">initialize (Wee::Component)</a><br />
|
116
|
+
<a href="classes/Wee/HtmlCanvas.html#M000054">input (Wee::HtmlCanvas)</a><br />
|
117
|
+
<a href="classes/Cache/Strategy/LFU.html#M000024">insert_or_extrude (Cache::Strategy::LFU)</a><br />
|
109
118
|
<a href="classes/Cache/Strategy/LRU.html#M000020">insert_or_extrude (Cache::Strategy::LRU)</a><br />
|
110
119
|
<a href="classes/Cache/Strategy/Unbounded.html#M000028">insert_or_extrude (Cache::Strategy::Unbounded)</a><br />
|
111
|
-
<a href="classes/Cache/Strategy/LFU.html#M000024">insert_or_extrude (Cache::Strategy::LFU)</a><br />
|
112
|
-
<a href="classes/Cache/Strategy/LRU.html#M000017">item_class (Cache::Strategy::LRU)</a><br />
|
113
|
-
<a href="classes/Cache/Strategy/LFU.html#M000021">item_class (Cache::Strategy::LFU)</a><br />
|
114
120
|
<a href="classes/Cache/Strategy/Unbounded.html#M000025">item_class (Cache::Strategy::Unbounded)</a><br />
|
115
|
-
<a href="classes/
|
116
|
-
<a href="classes/
|
117
|
-
<a href="classes/
|
118
|
-
<a href="classes/Wee/
|
119
|
-
<a href="classes/
|
120
|
-
<a href="classes/Wee/
|
121
|
-
<a href="classes/Wee/
|
122
|
-
<a href="classes/Wee/
|
123
|
-
<a href="classes/Wee/
|
124
|
-
<a href="classes/Wee/Brush/GenericEncodedTextBrush.html#
|
125
|
-
<a href="classes/Wee/
|
126
|
-
<a href="classes/Wee/Brush/
|
127
|
-
<a href="classes/Wee/Brush/GenericTagBrush.html#
|
128
|
-
<a href="classes/Wee/
|
129
|
-
<a href="classes/Wee/Brush/
|
130
|
-
<a href="classes/Wee/Brush/
|
131
|
-
<a href="classes/Wee/Brush.html#
|
132
|
-
<a href="classes/Wee/
|
133
|
-
<a href="classes/Wee/Brush/ImageButtonTag.html#
|
134
|
-
<a href="classes/Wee/
|
135
|
-
<a href="classes/Wee/Brush/
|
136
|
-
<a href="classes/Wee/
|
137
|
-
<a href="classes/Wee/
|
138
|
-
<a href="classes/Wee/Brush/
|
139
|
-
<a href="classes/Wee/Brush/
|
140
|
-
<a href="classes/Wee/
|
141
|
-
<a href="classes/Wee/
|
142
|
-
<a href="classes/Wee/Brush
|
143
|
-
<a href="classes/Wee/
|
144
|
-
<a href="classes/Wee/
|
145
|
-
<a href="classes/Wee/
|
146
|
-
<a href="classes/Wee/
|
147
|
-
<a href="classes/Wee/
|
148
|
-
<a href="classes/Wee/
|
149
|
-
<a href="classes/Wee/
|
150
|
-
<a href="classes/Wee/
|
151
|
-
<a href="classes/Wee/
|
152
|
-
<a href="classes/Wee/
|
121
|
+
<a href="classes/Cache/Strategy/LFU.html#M000021">item_class (Cache::Strategy::LFU)</a><br />
|
122
|
+
<a href="classes/Cache/Strategy/LRU.html#M000017">item_class (Cache::Strategy::LRU)</a><br />
|
123
|
+
<a href="classes/Wee/Brush/GenericTagBrush.html#M000115">method_missing (Wee::Brush::GenericTagBrush)</a><br />
|
124
|
+
<a href="classes/Wee/HtmlCanvas.html#M000046">method_missing (Wee::HtmlCanvas)</a><br />
|
125
|
+
<a href="classes/Enumerable.html#M000228">min_by (Enumerable)</a><br />
|
126
|
+
<a href="classes/Wee/WEBrickAdaptor.html#M000038">mount (Wee::WEBrickAdaptor)</a><br />
|
127
|
+
<a href="classes/Wee/Brush/SelectListTag.html#M000105">multiple (Wee::Brush::SelectListTag)</a><br />
|
128
|
+
<a href="classes/Wee/Canvas.html#M000164">nest (Wee::Canvas)</a><br />
|
129
|
+
<a href="classes/Wee/Brush/SubmitButtonTag.html#M000110">new (Wee::Brush::SubmitButtonTag)</a><br />
|
130
|
+
<a href="classes/Wee/Brush/GenericEncodedTextBrush.html#M000108">new (Wee::Brush::GenericEncodedTextBrush)</a><br />
|
131
|
+
<a href="classes/Wee/ValueHolder.html#M000169">new (Wee::ValueHolder)</a><br />
|
132
|
+
<a href="classes/Wee/Brush/SelectListTag.html#M000104">new (Wee::Brush::SelectListTag)</a><br />
|
133
|
+
<a href="classes/Wee/Brush/GenericTagBrush.html#M000111">new (Wee::Brush::GenericTagBrush)</a><br />
|
134
|
+
<a href="classes/Wee/RefreshResponse.html#M000168">new (Wee::RefreshResponse)</a><br />
|
135
|
+
<a href="classes/Wee/Brush/TableRowTag.html#M000098">new (Wee::Brush::TableRowTag)</a><br />
|
136
|
+
<a href="classes/Wee/Brush/TableDataTag.html#M000096">new (Wee::Brush::TableDataTag)</a><br />
|
137
|
+
<a href="classes/Wee/Brush/TableHeaderTag.html#M000095">new (Wee::Brush::TableHeaderTag)</a><br />
|
138
|
+
<a href="classes/Wee/Brush/TableTag.html#M000094">new (Wee::Brush::TableTag)</a><br />
|
139
|
+
<a href="classes/Wee/Brush/ImageButtonTag.html#M000117">new (Wee::Brush::ImageButtonTag)</a><br />
|
140
|
+
<a href="classes/Wee/SimpleIdGenerator.html#M000165">new (Wee::SimpleIdGenerator)</a><br />
|
141
|
+
<a href="classes/Wee/Brush/FileUploadTag.html#M000119">new (Wee::Brush::FileUploadTag)</a><br />
|
142
|
+
<a href="classes/Wee/Brush/TextInputTag.html#M000120">new (Wee::Brush::TextInputTag)</a><br />
|
143
|
+
<a href="classes/Wee/Brush/GenericTextBrush.html#M000092">new (Wee::Brush::GenericTextBrush)</a><br />
|
144
|
+
<a href="classes/Wee/Brush/TextAreaTag.html#M000088">new (Wee::Brush::TextAreaTag)</a><br />
|
145
|
+
<a href="classes/Wee/Brush/AnchorTag.html#M000123">new (Wee::Brush::AnchorTag)</a><br />
|
146
|
+
<a href="classes/Wee/Canvas.html#M000161">new (Wee::Canvas)</a><br />
|
147
|
+
<a href="classes/Wee/Brush/FormTag.html#M000083">new (Wee::Brush::FormTag)</a><br />
|
148
|
+
<a href="classes/Wee/Brush.html#M000077">new (Wee::Brush)</a><br />
|
149
|
+
<a href="classes/Wee/Brush/SelectOptionTag.html#M000127">new (Wee::Brush::SelectOptionTag)</a><br />
|
150
|
+
<a href="classes/Wee/Snapshot.html#M000074">new (Wee::Snapshot)</a><br />
|
151
|
+
<a href="classes/Wee/Brush/InputTag.html#M000129">new (Wee::Brush::InputTag)</a><br />
|
152
|
+
<a href="classes/Wee/RedirectResponse.html#M000189">new (Wee::RedirectResponse)</a><br />
|
153
|
+
<a href="classes/Wee/Request.html#M000206">new (Wee::Request)</a><br />
|
154
|
+
<a href="classes/Wee/Session.html#M000132">new (Wee::Session)</a><br />
|
155
|
+
<a href="classes/Wee/PageDecoration.html#M000209">new (Wee::PageDecoration)</a><br />
|
156
|
+
<a href="classes/Wee/HtmlCanvas.html#M000045">new (Wee::HtmlCanvas)</a><br />
|
157
|
+
<a href="classes/Wee/CallbackRegistry.html#M000156">new (Wee::CallbackRegistry)</a><br />
|
158
|
+
<a href="classes/Wee/CallbackStream.html#M000212">new (Wee::CallbackStream)</a><br />
|
159
|
+
<a href="classes/Wee/GenericResponse.html#M000043">new (Wee::GenericResponse)</a><br />
|
160
|
+
<a href="classes/Wee/WEBrickAdaptor.html#M000039">new (Wee::WEBrickAdaptor)</a><br />
|
161
|
+
<a href="classes/Wee/Delegate.html#M000215">new (Wee::Delegate)</a><br />
|
162
|
+
<a href="classes/Wee/Utils/LRUCache.html#M000035">new (Wee::Utils::LRUCache)</a><br />
|
153
163
|
<a href="classes/Cache/Strategy/CapacityBounded.html#M000012">new (Cache::Strategy::CapacityBounded)</a><br />
|
154
|
-
<a href="classes/Wee/RequestHandler.html#
|
155
|
-
<a href="classes/Wee/Response.html#M000143">new (Wee::Response)</a><br />
|
164
|
+
<a href="classes/Wee/RequestHandler.html#M000223">new (Wee::RequestHandler)</a><br />
|
156
165
|
<a href="classes/Cache/StorageCache.html#M000005">new (Cache::StorageCache)</a><br />
|
157
|
-
<a href="classes/Wee/
|
158
|
-
<a href="classes/Wee/
|
159
|
-
<a href="classes/Wee/
|
160
|
-
<a href="classes/Wee/
|
161
|
-
<a href="classes/Wee/
|
162
|
-
<a href="classes/Wee/
|
163
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
164
|
-
<a href="classes/Wee/
|
165
|
-
<a href="classes/Wee/
|
166
|
-
<a href="classes/Wee/
|
167
|
-
<a href="classes/Wee/
|
168
|
-
<a href="classes/Wee/Component.html#
|
169
|
-
<a href="classes/Wee/
|
170
|
-
<a href="classes/Wee/
|
171
|
-
<a href="classes/Wee/
|
172
|
-
<a href="classes/Wee/
|
173
|
-
<a href="classes/Wee/
|
174
|
-
<a href="classes/Wee/Brush/
|
175
|
-
<a href="classes/Wee/
|
176
|
-
<a href="classes/Wee/
|
177
|
-
<a href="classes/Wee/
|
178
|
-
<a href="classes/Wee/Component.html#
|
179
|
-
<a href="classes/Wee/
|
180
|
-
<a href="classes/Wee/
|
181
|
-
<a href="classes/Wee/ErrorResponse.html#
|
182
|
-
<a href="classes/Wee/
|
183
|
-
<a href="classes/Wee/Presenter.html#
|
184
|
-
<a href="classes/Wee/
|
185
|
-
<a href="classes/Wee/
|
186
|
-
<a href="classes/Wee/
|
187
|
-
<a href="classes/Wee/
|
188
|
-
<a href="classes/Wee/
|
166
|
+
<a href="classes/Wee/Response.html#M000152">new (Wee::Response)</a><br />
|
167
|
+
<a href="classes/Wee/ErrorResponse.html#M000224">new (Wee::ErrorResponse)</a><br />
|
168
|
+
<a href="classes/Wee/LiteralMethodCallback.html#M000226">new (Wee::LiteralMethodCallback)</a><br />
|
169
|
+
<a href="classes/Wee/Application.html#M000147">new (Wee::Application)</a><br />
|
170
|
+
<a href="classes/Wee/HtmlWriter.html#M000199">new (Wee::HtmlWriter)</a><br />
|
171
|
+
<a href="classes/Wee/SimpleIdGenerator.html#M000167">next (Wee::SimpleIdGenerator)</a><br />
|
172
|
+
<a href="classes/Wee/HtmlCanvas.html#M000057">option (Wee::HtmlCanvas)</a><br />
|
173
|
+
<a href="classes/Wee/HtmlCanvas.html#M000062">page (Wee::HtmlCanvas)</a><br />
|
174
|
+
<a href="classes/Wee/HtmlCanvas.html#M000066">paragraph (Wee::HtmlCanvas)</a><br />
|
175
|
+
<a href="classes/Wee/Decoration.html#M000141">process_callbacks (Wee::Decoration)</a><br />
|
176
|
+
<a href="classes/Wee/Presenter.html#M000196">process_callbacks (Wee::Presenter)</a><br />
|
177
|
+
<a href="classes/Wee/Component.html#M000175">process_callbacks (Wee::Component)</a><br />
|
178
|
+
<a href="classes/Wee/AnswerDecoration.html#M000044">process_callbacks (Wee::AnswerDecoration)</a><br />
|
179
|
+
<a href="classes/Wee/Delegate.html#M000216">process_callbacks (Wee::Delegate)</a><br />
|
180
|
+
<a href="classes/Wee/Component.html#M000174">process_callbacks_chain (Wee::Component)</a><br />
|
181
|
+
<a href="classes/Wee/Session.html#M000137">process_request (Wee::Session)</a><br />
|
182
|
+
<a href="classes/Wee/Presenter.html#M000193">r (Wee::Presenter)</a><br />
|
183
|
+
<a href="classes/Wee/Brush/TextAreaTag.html#M000090">readonly (Wee::Brush::TextAreaTag)</a><br />
|
184
|
+
<a href="classes/Wee/WEBrickAdaptor.html#M000037">register (Wee::WEBrickAdaptor)</a><br />
|
185
|
+
<a href="classes/Wee/HtmlCanvas.html#M000048">register_callback (Wee::HtmlCanvas)</a><br />
|
186
|
+
<a href="classes/Wee/CallbackRegistry.html#M000157">register_for (Wee::CallbackRegistry)</a><br />
|
187
|
+
<a href="classes/Wee/Component.html#M000183">remove_decoration (Wee::Component)</a><br />
|
188
|
+
<a href="classes/Wee/Component.html#M000184">remove_decoration_if (Wee::Component)</a><br />
|
189
|
+
<a href="classes/Wee/HtmlCanvas.html#M000072">render (Wee::HtmlCanvas)</a><br />
|
190
|
+
<a href="classes/Wee/ErrorResponse.html#M000225">render (Wee::ErrorResponse)</a><br />
|
191
|
+
<a href="classes/Wee/Component.html#M000173">render (Wee::Component)</a><br />
|
192
|
+
<a href="classes/Wee/Presenter.html#M000190">render (Wee::Presenter)</a><br />
|
193
|
+
<a href="classes/Wee/Presenter.html#M000192">renderer (Wee::Presenter)</a><br />
|
194
|
+
<a href="classes/Wee/Presenter.html#M000195">renderer_class (Wee::Presenter)</a><br />
|
195
|
+
<a href="classes/Wee/Application.html#M000151">request_handler_expired (Wee::Application)</a><br />
|
196
|
+
<a href="classes/Wee/Session.html#M000139">respond (Wee::Session)</a><br />
|
197
|
+
<a href="classes/Wee/Snapshot.html#M000076">restore (Wee::Snapshot)</a><br />
|
198
|
+
<a href="classes/String.html#M000032">restore_snapshot (String)</a><br />
|
189
199
|
<a href="classes/Struct.html#M000002">restore_snapshot (Struct)</a><br />
|
190
200
|
<a href="classes/Object.html#M000030">restore_snapshot (Object)</a><br />
|
191
201
|
<a href="classes/Array.html#M000004">restore_snapshot (Array)</a><br />
|
192
|
-
<a href="classes/
|
193
|
-
<a href="classes/Wee/
|
194
|
-
<a href="classes/Wee/
|
195
|
-
<a href="classes/Wee/
|
196
|
-
<a href="classes/Wee/
|
197
|
-
<a href="classes/Wee/
|
198
|
-
<a href="classes/Wee/
|
199
|
-
<a href="classes/Wee/
|
200
|
-
<a href="classes/Wee/Brush/TableRowTag.html#
|
201
|
-
<a href="classes/Wee/
|
202
|
-
<a href="classes/Wee/
|
203
|
-
<a href="classes/Wee/
|
204
|
-
<a href="classes/Wee/
|
202
|
+
<a href="classes/Wee/ValueHolder.html#M000171">restore_snapshot (Wee::ValueHolder)</a><br />
|
203
|
+
<a href="classes/Wee/Decoration.html#M000145">restore_snapshot (Wee::Decoration)</a><br />
|
204
|
+
<a href="classes/Wee/HtmlCanvas.html#M000058">select_list (Wee::HtmlCanvas)</a><br />
|
205
|
+
<a href="classes/Wee/Brush/SelectOptionTag.html#M000128">selected (Wee::Brush::SelectOptionTag)</a><br />
|
206
|
+
<a href="classes/Wee/Presenter.html#M000198">session (Wee::Presenter)</a><br />
|
207
|
+
<a href="classes/Wee/Canvas.html#M000163">set_brush (Wee::Canvas)</a><br />
|
208
|
+
<a href="classes/Wee/Session.html#M000133">snapshot (Wee::Session)</a><br />
|
209
|
+
<a href="classes/Wee/HtmlCanvas.html#M000064">space (Wee::HtmlCanvas)</a><br />
|
210
|
+
<a href="classes/Wee/Brush/TableRowTag.html#M000103">spacer (Wee::Brush::TableRowTag)</a><br />
|
211
|
+
<a href="classes/Wee/Brush/TableRowTag.html#M000102">spanning_column (Wee::Brush::TableRowTag)</a><br />
|
212
|
+
<a href="classes/Wee/WEBrickAdaptor.html#M000036">start (Wee::WEBrickAdaptor)</a><br />
|
213
|
+
<a href="classes/Wee/Session.html#M000135">start_request_response_loop (Wee::Session)</a><br />
|
214
|
+
<a href="classes/Wee/HtmlWriter.html#M000200">start_tag (Wee::HtmlWriter)</a><br />
|
215
|
+
<a href="classes/Wee/RequestHandler.html#M000222">statistics (Wee::RequestHandler)</a><br />
|
205
216
|
<a href="classes/Cache/StorageCache.html#M000009">store (Cache::StorageCache)</a><br />
|
206
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
207
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
208
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
209
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
210
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
211
|
-
<a href="classes/Wee/
|
212
|
-
<a href="classes/Object.html#M000029">take_snapshot (Object)</a><br />
|
217
|
+
<a href="classes/Wee/HtmlCanvas.html#M000059">submit_button (Wee::HtmlCanvas)</a><br />
|
218
|
+
<a href="classes/Wee/HtmlCanvas.html#M000049">table (Wee::HtmlCanvas)</a><br />
|
219
|
+
<a href="classes/Wee/HtmlCanvas.html#M000051">table_data (Wee::HtmlCanvas)</a><br />
|
220
|
+
<a href="classes/Wee/HtmlCanvas.html#M000052">table_header (Wee::HtmlCanvas)</a><br />
|
221
|
+
<a href="classes/Wee/HtmlCanvas.html#M000050">table_row (Wee::HtmlCanvas)</a><br />
|
222
|
+
<a href="classes/Wee/Decoration.html#M000144">take_snapshot (Wee::Decoration)</a><br />
|
213
223
|
<a href="classes/Array.html#M000003">take_snapshot (Array)</a><br />
|
224
|
+
<a href="classes/Object.html#M000029">take_snapshot (Object)</a><br />
|
225
|
+
<a href="classes/Wee/ValueHolder.html#M000170">take_snapshot (Wee::ValueHolder)</a><br />
|
214
226
|
<a href="classes/String.html#M000031">take_snapshot (String)</a><br />
|
215
227
|
<a href="classes/Struct.html#M000001">take_snapshot (Struct)</a><br />
|
216
|
-
<a href="classes/Wee/
|
217
|
-
<a href="classes/Wee/
|
218
|
-
<a href="classes/Wee/
|
219
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
220
|
-
<a href="classes/Wee/HtmlCanvas.html#
|
221
|
-
<a href="classes/Wee/
|
222
|
-
<a href="classes/Wee/Brush/
|
223
|
-
<a href="classes/Wee/
|
224
|
-
<a href="classes/Wee/
|
225
|
-
<a href="classes/Wee/
|
226
|
-
<a href="classes/Wee/HtmlWriter.html#
|
227
|
-
<a href="classes/Wee/Brush/ImageButtonTag.html#
|
228
|
-
<a href="classes/Wee/Brush/
|
229
|
-
<a href="classes/Wee/Brush/
|
230
|
-
<a href="classes/Wee/Brush/
|
231
|
-
<a href="classes/Wee/Brush.html#
|
232
|
-
<a href="classes/Wee/Brush/
|
233
|
-
<a href="classes/Wee/Brush/
|
234
|
-
<a href="classes/Wee/Brush/InputTag.html#
|
235
|
-
<a href="classes/Wee/Brush/
|
236
|
-
<a href="classes/Wee/Brush/
|
237
|
-
<a href="classes/Wee/CallbackStream.html#
|
238
|
-
<a href="classes/Wee/Presenter.html#
|
228
|
+
<a href="classes/Wee/RequestHandler.html#M000219">teminate (Wee::RequestHandler)</a><br />
|
229
|
+
<a href="classes/Wee/HtmlWriter.html#M000202">text (Wee::HtmlWriter)</a><br />
|
230
|
+
<a href="classes/Wee/HtmlCanvas.html#M000069">text (Wee::HtmlCanvas)</a><br />
|
231
|
+
<a href="classes/Wee/HtmlCanvas.html#M000056">text_area (Wee::HtmlCanvas)</a><br />
|
232
|
+
<a href="classes/Wee/HtmlCanvas.html#M000055">text_input (Wee::HtmlCanvas)</a><br />
|
233
|
+
<a href="classes/Wee/Brush/Page.html#M000121">title (Wee::Brush::Page)</a><br />
|
234
|
+
<a href="classes/Wee/Brush/GenericTagBrush.html#M000112">type (Wee::Brush::GenericTagBrush)</a><br />
|
235
|
+
<a href="classes/Wee/Application.html#M000149">unique_request_handler_id (Wee::Application)</a><br />
|
236
|
+
<a href="classes/Wee/Brush/AnchorTag.html#M000124">url (Wee::Brush::AnchorTag)</a><br />
|
237
|
+
<a href="classes/Wee/HtmlCanvas.html#M000047">url_for_callback (Wee::HtmlCanvas)</a><br />
|
238
|
+
<a href="classes/Wee/HtmlWriter.html#M000205">valid? (Wee::HtmlWriter)</a><br />
|
239
|
+
<a href="classes/Wee/Brush/ImageButtonTag.html#M000118">value (Wee::Brush::ImageButtonTag)</a><br />
|
240
|
+
<a href="classes/Wee/Brush/TextAreaTag.html#M000091">with (Wee::Brush::TextAreaTag)</a><br />
|
241
|
+
<a href="classes/Wee/Brush/FormTag.html#M000087">with (Wee::Brush::FormTag)</a><br />
|
242
|
+
<a href="classes/Wee/Brush/GenericEncodedTextBrush.html#M000109">with (Wee::Brush::GenericEncodedTextBrush)</a><br />
|
243
|
+
<a href="classes/Wee/Brush.html#M000078">with (Wee::Brush)</a><br />
|
244
|
+
<a href="classes/Wee/Brush/GenericTagBrush.html#M000116">with (Wee::Brush::GenericTagBrush)</a><br />
|
245
|
+
<a href="classes/Wee/Brush/SelectListTag.html#M000107">with (Wee::Brush::SelectListTag)</a><br />
|
246
|
+
<a href="classes/Wee/Brush/InputTag.html#M000130">with (Wee::Brush::InputTag)</a><br />
|
247
|
+
<a href="classes/Wee/Brush/Page.html#M000122">with (Wee::Brush::Page)</a><br />
|
248
|
+
<a href="classes/Wee/Brush/GenericTextBrush.html#M000093">with (Wee::Brush::GenericTextBrush)</a><br />
|
249
|
+
<a href="classes/Wee/CallbackStream.html#M000213">with_callbacks_for (Wee::CallbackStream)</a><br />
|
250
|
+
<a href="classes/Wee/Presenter.html#M000194">with_renderer_for (Wee::Presenter)</a><br />
|
239
251
|
</div>
|
240
252
|
</div>
|
241
253
|
</body>
|
data/examples/example.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
$LOAD_PATH.unshift << "../lib"
|
2
2
|
require 'wee'
|
3
|
-
require 'wee/utils/cache'
|
4
3
|
require 'window'
|
5
4
|
|
6
5
|
class Counter < Wee::Component
|
@@ -203,21 +202,8 @@ class MainPage < Wee::Component
|
|
203
202
|
end
|
204
203
|
end
|
205
204
|
|
206
|
-
class MySession < Wee::Session
|
207
|
-
def initialize
|
208
|
-
super do
|
209
|
-
self.root_component = MainPage.new
|
210
|
-
self.page_store = Wee::Utils::LRUCache.new(10) # backtrack up to 10 pages
|
211
|
-
end
|
212
|
-
end
|
213
|
-
end
|
214
|
-
|
215
205
|
if __FILE__ == $0
|
216
|
-
app = Wee::Application.new {|app|
|
217
|
-
app.default_request_handler { MySession.new }
|
218
|
-
app.id_generator = Wee::SimpleIdGenerator.new(rand(1_000_000))
|
219
|
-
}
|
220
|
-
|
221
206
|
require 'wee/adaptors/webrick'
|
222
|
-
|
207
|
+
require 'wee/utils/helper'
|
208
|
+
Wee::WEBrickAdaptor.register('/app' => Wee::Helper.app_for(MainPage)).start
|
223
209
|
end
|
data/examples/test.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
$LOAD_PATH.unshift << "../lib"
|
2
2
|
require 'wee'
|
3
|
-
require 'wee/webrick'
|
4
3
|
require 'wee/utils/cache'
|
5
4
|
|
6
|
-
|
7
5
|
class Counter < Wee::Component
|
8
6
|
def initialize(cnt)
|
9
7
|
super()
|
10
8
|
@cnt = cnt
|
11
|
-
|
9
|
+
end
|
10
|
+
|
11
|
+
def backtrack_state(snap)
|
12
|
+
super
|
13
|
+
snap.add(self)
|
12
14
|
end
|
13
15
|
|
14
16
|
def dec
|
@@ -20,9 +22,9 @@ class Counter < Wee::Component
|
|
20
22
|
end
|
21
23
|
|
22
24
|
def render
|
23
|
-
r.anchor.
|
25
|
+
r.anchor.callback(:dec).with("--")
|
24
26
|
r.space; r.text(@cnt.to_s); r.space
|
25
|
-
r.anchor.
|
27
|
+
r.anchor.callback(:inc).with("++")
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
@@ -45,22 +47,17 @@ class MySession < Wee::Session
|
|
45
47
|
super do
|
46
48
|
self.root_component = MainPage.new
|
47
49
|
self.page_store = Wee::Utils::LRUCache.new(10) # backtrack up to 10 pages
|
50
|
+
self.expire_after = 60
|
48
51
|
end
|
49
52
|
end
|
50
53
|
end
|
51
54
|
|
52
55
|
if __FILE__ == $0
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
app.path = '/app'
|
61
|
-
app.session_class = MySession
|
62
|
-
app.session_store = Wee::Utils::LRUCache.new(1000) # handle up to 1000 sessions
|
63
|
-
app.dumpfile = DUMP
|
64
|
-
}
|
65
|
-
end.start
|
56
|
+
app = Wee::Application.new {|app|
|
57
|
+
app.default_request_handler { MySession.new }
|
58
|
+
app.id_generator = Wee::SimpleIdGenerator.new(rand(1_000_000))
|
59
|
+
app.max_request_handlers = 2
|
60
|
+
}
|
61
|
+
require 'wee/adaptors/webrick'
|
62
|
+
Wee::WEBrickAdaptor.register('/app' => app).start
|
66
63
|
end
|