wee 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +132 -0
- data/INSTALL +13 -3
- data/README +3 -3
- data/Rakefile +5 -1
- data/bin/wee +100 -0
- data/doc/rdoc/classes/Array.html +12 -12
- data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
- data/doc/rdoc/classes/Enumerable.html +6 -6
- data/doc/rdoc/classes/Main.html +265 -0
- data/doc/rdoc/classes/Object.html +12 -12
- data/doc/rdoc/classes/OgApplication.html +2 -2
- data/doc/rdoc/classes/OgScaffolder.html +444 -64
- data/doc/rdoc/classes/OgScaffolder/Editor.html +490 -0
- data/doc/rdoc/classes/OgSession.html +4 -4
- data/doc/rdoc/classes/Recipe.html +113 -0
- data/doc/rdoc/classes/String.html +12 -12
- data/doc/rdoc/classes/Struct.html +12 -12
- data/doc/rdoc/classes/Wee.html +10 -1
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +9 -9
- data/doc/rdoc/classes/Wee/Application.html +48 -47
- data/doc/rdoc/classes/Wee/Brush.html +19 -23
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +17 -14
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +20 -14
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +25 -21
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +234 -100
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +28 -22
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +23 -24
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +14 -14
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/Page.html +14 -14
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +33 -57
- data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +154 -0
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +20 -14
- 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 +42 -42
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +27 -21
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +20 -14
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +64 -36
- data/doc/rdoc/classes/Wee/CallbackStream.html +21 -21
- data/doc/rdoc/classes/Wee/Canvas.html +24 -24
- data/doc/rdoc/classes/Wee/Component.html +179 -151
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +12 -12
- data/doc/rdoc/classes/Wee/Decoration.html +42 -42
- data/doc/rdoc/classes/Wee/Delegate.html +27 -27
- data/doc/rdoc/classes/Wee/ErrorResponse.html +14 -14
- data/doc/rdoc/classes/Wee/FormDecoration.html +6 -6
- data/doc/rdoc/classes/Wee/GenericResponse.html +7 -7
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +326 -219
- data/doc/rdoc/classes/Wee/HtmlWriter.html +40 -40
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +19 -19
- data/doc/rdoc/classes/Wee/Md5IdGenerator.html +181 -0
- data/doc/rdoc/classes/Wee/MessageBox.html +12 -12
- data/doc/rdoc/classes/Wee/PageDecoration.html +18 -18
- data/doc/rdoc/classes/Wee/PagelessApplication.html +152 -0
- data/doc/rdoc/classes/Wee/PagelessRequest.html +177 -0
- data/doc/rdoc/classes/Wee/PagelessSession.html +320 -0
- data/doc/rdoc/classes/Wee/Presenter.html +145 -89
- data/doc/rdoc/classes/Wee/RedirectResponse.html +7 -7
- data/doc/rdoc/classes/Wee/RefreshResponse.html +7 -7
- data/doc/rdoc/classes/Wee/Request.html +116 -50
- data/doc/rdoc/classes/Wee/RequestHandler.html +31 -31
- data/doc/rdoc/classes/Wee/Response.html +76 -28
- data/doc/rdoc/classes/Wee/Session.html +129 -506
- data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +22 -40
- data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
- data/doc/rdoc/classes/Wee/Utils.html +70 -17
- 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 +82 -49
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +6 -6
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/INSTALL.html +17 -5
- data/doc/rdoc/files/README.html +9 -11
- 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 +1 -1
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +1 -3
- 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_rb.html +3 -3
- data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +4 -1
- data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +115 -0
- data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +107 -0
- data/doc/rdoc/files/lib/wee/pageless/application_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/pageless/request_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/pageless/session_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/pageless_rb.html +110 -0
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +8 -1
- data/doc/rdoc/files/lib/wee/request_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/response_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/session_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +114 -0
- data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +115 -0
- data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +111 -0
- data/doc/rdoc/files/lib/wee/template_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -1
- data/doc/rdoc/files/lib/wee_rb.html +4 -2
- data/doc/rdoc/fr_class_index.html +8 -4
- data/doc/rdoc/fr_file_index.html +17 -1
- data/doc/rdoc/fr_method_index.html +312 -267
- data/examples/live-update.rb +1 -1
- data/install.rb +14 -0
- data/lib/wee.rb +6 -2
- data/lib/wee/adaptors/webrick.rb +17 -5
- data/lib/wee/application.rb +2 -1
- data/lib/wee/continuation/session.rb +1 -146
- data/lib/wee/core/callback.rb +11 -5
- data/lib/wee/core/component.rb +14 -10
- data/lib/wee/databases/og.rb +3 -113
- data/lib/wee/databases/og/application.rb +3 -0
- data/lib/wee/databases/og/old_scaffolder.rb +98 -0
- data/lib/wee/databases/og/scaffolder.rb +174 -0
- data/lib/wee/databases/og/session.rb +9 -0
- data/lib/wee/idgen/md5.rb +21 -0
- data/lib/wee/{idgen.rb → idgen/simple.rb} +2 -4
- data/lib/wee/pageless.rb +3 -0
- data/lib/wee/pageless/application.rb +9 -0
- data/lib/wee/pageless/request.rb +15 -0
- data/lib/wee/pageless/session.rb +89 -0
- data/lib/wee/renderer/html/brushes.rb +100 -115
- data/lib/wee/renderer/html/canvas.rb +32 -2
- data/lib/wee/request.rb +36 -24
- data/lib/wee/response.rb +8 -1
- data/lib/wee/session.rb +13 -7
- data/lib/wee/skeleton/og/README +38 -0
- data/lib/wee/skeleton/og/components/main.rb +16 -0
- data/lib/wee/skeleton/og/conf/db.rb +8 -0
- data/lib/wee/skeleton/og/models/recipe.rb +5 -0
- data/lib/wee/skeleton/og/run.rb +23 -0
- data/lib/wee/skeleton/simple/README +32 -0
- data/lib/wee/skeleton/simple/components/main.rb +25 -0
- data/lib/wee/skeleton/simple/run.rb +12 -0
- data/lib/wee/template.rb +28 -0
- data/lib/wee/utils/autoreload.rb +29 -0
- data/lib/wee/utils/helper.rb +9 -5
- data/test/test_request.rb +4 -3
- data/wee.gemspec +3 -1
- metadata +91 -22
@@ -86,7 +86,7 @@
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
87
87
|
|
88
88
|
<div class="name-list">
|
89
|
-
<a href="#
|
89
|
+
<a href="#M000149">new</a>
|
90
90
|
</div>
|
91
91
|
</div>
|
92
92
|
|
@@ -108,21 +108,21 @@
|
|
108
108
|
<div id="methods">
|
109
109
|
<h3 class="section-bar">Public Class methods</h3>
|
110
110
|
|
111
|
-
<div id="method-
|
112
|
-
<a name="
|
111
|
+
<div id="method-M000149" class="method-detail">
|
112
|
+
<a name="M000149"></a>
|
113
113
|
|
114
114
|
<div class="method-heading">
|
115
|
-
<a href="#
|
115
|
+
<a href="#M000149" class="method-signature">
|
116
116
|
<span class="method-name">new</span><span class="method-args">()</span>
|
117
117
|
</a>
|
118
118
|
</div>
|
119
119
|
|
120
120
|
<div class="method-description">
|
121
121
|
<p><a class="source-toggle" href="#"
|
122
|
-
onclick="toggleCode('
|
123
|
-
<div class="method-source-code" id="
|
122
|
+
onclick="toggleCode('M000149-source');return false;">[Source]</a></p>
|
123
|
+
<div class="method-source-code" id="M000149-source">
|
124
124
|
<pre>
|
125
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
125
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 220</span>
|
126
126
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
127
127
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-value str">'table'</span>)
|
128
128
|
<span class="ruby-keyword kw">end</span>
|
@@ -86,8 +86,8 @@
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
87
87
|
|
88
88
|
<div class="name-list">
|
89
|
-
<a href="#
|
90
|
-
<a href="#
|
89
|
+
<a href="#M000145">new</a>
|
90
|
+
<a href="#M000146">with</a>
|
91
91
|
</div>
|
92
92
|
</div>
|
93
93
|
|
@@ -95,18 +95,24 @@
|
|
95
95
|
|
96
96
|
|
97
97
|
<!-- if includes -->
|
98
|
-
<div id="includes">
|
99
|
-
<h3 class="section-bar">Included Modules</h3>
|
100
|
-
|
101
|
-
<div id="includes-list">
|
102
|
-
<span class="include-name"><a href="InputCallbackMixin.html">Brush::InputCallbackMixin</a></span>
|
103
|
-
</div>
|
104
|
-
</div>
|
105
98
|
|
106
99
|
<div id="section">
|
107
100
|
|
108
101
|
|
109
102
|
|
103
|
+
<div id="aliases-list">
|
104
|
+
<h3 class="section-bar">External Aliases</h3>
|
105
|
+
|
106
|
+
<div class="name-list">
|
107
|
+
<table summary="aliases">
|
108
|
+
<tr class="top-aligned-row context-row">
|
109
|
+
<td class="context-item-name">__input_callback</td>
|
110
|
+
<td>-></td>
|
111
|
+
<td class="context-item-value">callback</td>
|
112
|
+
</tr>
|
113
|
+
</table>
|
114
|
+
</div>
|
115
|
+
</div>
|
110
116
|
|
111
117
|
|
112
118
|
|
@@ -116,21 +122,21 @@
|
|
116
122
|
<div id="methods">
|
117
123
|
<h3 class="section-bar">Public Class methods</h3>
|
118
124
|
|
119
|
-
<div id="method-
|
120
|
-
<a name="
|
125
|
+
<div id="method-M000145" class="method-detail">
|
126
|
+
<a name="M000145"></a>
|
121
127
|
|
122
128
|
<div class="method-heading">
|
123
|
-
<a href="#
|
129
|
+
<a href="#M000145" class="method-signature">
|
124
130
|
<span class="method-name">new</span><span class="method-args">()</span>
|
125
131
|
</a>
|
126
132
|
</div>
|
127
133
|
|
128
134
|
<div class="method-description">
|
129
135
|
<p><a class="source-toggle" href="#"
|
130
|
-
onclick="toggleCode('
|
131
|
-
<div class="method-source-code" id="
|
136
|
+
onclick="toggleCode('M000145-source');return false;">[Source]</a></p>
|
137
|
+
<div class="method-source-code" id="M000145-source">
|
132
138
|
<pre>
|
133
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
139
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 289</span>
|
134
140
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
135
141
|
<span class="ruby-keyword kw">super</span>(<span class="ruby-value str">'textarea'</span>)
|
136
142
|
<span class="ruby-keyword kw">end</span>
|
@@ -141,21 +147,21 @@
|
|
141
147
|
|
142
148
|
<h3 class="section-bar">Public Instance methods</h3>
|
143
149
|
|
144
|
-
<div id="method-
|
145
|
-
<a name="
|
150
|
+
<div id="method-M000146" class="method-detail">
|
151
|
+
<a name="M000146"></a>
|
146
152
|
|
147
153
|
<div class="method-heading">
|
148
|
-
<a href="#
|
154
|
+
<a href="#M000146" class="method-signature">
|
149
155
|
<span class="method-name">with</span><span class="method-args">(*args, &block)</span>
|
150
156
|
</a>
|
151
157
|
</div>
|
152
158
|
|
153
159
|
<div class="method-description">
|
154
160
|
<p><a class="source-toggle" href="#"
|
155
|
-
onclick="toggleCode('
|
156
|
-
<div class="method-source-code" id="
|
161
|
+
onclick="toggleCode('M000146-source');return false;">[Source]</a></p>
|
162
|
+
<div class="method-source-code" id="M000146-source">
|
157
163
|
<pre>
|
158
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
164
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 298</span>
|
159
165
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
160
166
|
<span class="ruby-keyword kw">super</span>
|
161
167
|
<span class="ruby-keyword kw">end</span>
|
@@ -86,7 +86,7 @@
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
87
87
|
|
88
88
|
<div class="name-list">
|
89
|
-
<a href="#
|
89
|
+
<a href="#M000187">new</a>
|
90
90
|
</div>
|
91
91
|
</div>
|
92
92
|
|
@@ -94,18 +94,24 @@
|
|
94
94
|
|
95
95
|
|
96
96
|
<!-- if includes -->
|
97
|
-
<div id="includes">
|
98
|
-
<h3 class="section-bar">Included Modules</h3>
|
99
|
-
|
100
|
-
<div id="includes-list">
|
101
|
-
<span class="include-name"><a href="InputCallbackMixin.html">Brush::InputCallbackMixin</a></span>
|
102
|
-
</div>
|
103
|
-
</div>
|
104
97
|
|
105
98
|
<div id="section">
|
106
99
|
|
107
100
|
|
108
101
|
|
102
|
+
<div id="aliases-list">
|
103
|
+
<h3 class="section-bar">External Aliases</h3>
|
104
|
+
|
105
|
+
<div class="name-list">
|
106
|
+
<table summary="aliases">
|
107
|
+
<tr class="top-aligned-row context-row">
|
108
|
+
<td class="context-item-name">__input_callback</td>
|
109
|
+
<td>-></td>
|
110
|
+
<td class="context-item-value">callback</td>
|
111
|
+
</tr>
|
112
|
+
</table>
|
113
|
+
</div>
|
114
|
+
</div>
|
109
115
|
|
110
116
|
|
111
117
|
|
@@ -115,21 +121,21 @@
|
|
115
121
|
<div id="methods">
|
116
122
|
<h3 class="section-bar">Public Class methods</h3>
|
117
123
|
|
118
|
-
<div id="method-
|
119
|
-
<a name="
|
124
|
+
<div id="method-M000187" class="method-detail">
|
125
|
+
<a name="M000187"></a>
|
120
126
|
|
121
127
|
<div class="method-heading">
|
122
|
-
<a href="#
|
128
|
+
<a href="#M000187" class="method-signature">
|
123
129
|
<span class="method-name">new</span><span class="method-args">()</span>
|
124
130
|
</a>
|
125
131
|
</div>
|
126
132
|
|
127
133
|
<div class="method-description">
|
128
134
|
<p><a class="source-toggle" href="#"
|
129
|
-
onclick="toggleCode('
|
130
|
-
<div class="method-source-code" id="
|
135
|
+
onclick="toggleCode('M000187-source');return false;">[Source]</a></p>
|
136
|
+
<div class="method-source-code" id="M000187-source">
|
131
137
|
<pre>
|
132
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
138
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 367</span>
|
133
139
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
134
140
|
<span class="ruby-keyword kw">super</span>
|
135
141
|
<span class="ruby-identifier">type</span>(<span class="ruby-value str">'text'</span>)
|
@@ -99,7 +99,7 @@ The format of the internal datastructure is:
|
|
99
99
|
<div id="contents-list">
|
100
100
|
<h3 class="section-bar">Contents</h3>
|
101
101
|
<ul>
|
102
|
-
<li><a href="#
|
102
|
+
<li><a href="#SEC00097">Friend methods for Wee::CallbackStream</a></li>
|
103
103
|
</ul>
|
104
104
|
</div>
|
105
105
|
|
@@ -107,11 +107,12 @@ The format of the internal datastructure is:
|
|
107
107
|
<h3 class="section-bar">Methods</h3>
|
108
108
|
|
109
109
|
<div class="name-list">
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
113
|
-
<a href="#
|
114
|
-
<a href="#
|
110
|
+
<a href="#M000238">all_of_type</a>
|
111
|
+
<a href="#M000237">get_callback_for</a>
|
112
|
+
<a href="#M000236">get_ids_for</a>
|
113
|
+
<a href="#M000233">new</a>
|
114
|
+
<a href="#M000234">register_for</a>
|
115
|
+
<a href="#M000235">register_named_for</a>
|
115
116
|
</div>
|
116
117
|
</div>
|
117
118
|
|
@@ -133,19 +134,19 @@ The format of the internal datastructure is:
|
|
133
134
|
<div id="methods">
|
134
135
|
<h3 class="section-bar">Public Class methods</h3>
|
135
136
|
|
136
|
-
<div id="method-
|
137
|
-
<a name="
|
137
|
+
<div id="method-M000233" class="method-detail">
|
138
|
+
<a name="M000233"></a>
|
138
139
|
|
139
140
|
<div class="method-heading">
|
140
|
-
<a href="#
|
141
|
+
<a href="#M000233" class="method-signature">
|
141
142
|
<span class="method-name">new</span><span class="method-args">(id_generator)</span>
|
142
143
|
</a>
|
143
144
|
</div>
|
144
145
|
|
145
146
|
<div class="method-description">
|
146
147
|
<p><a class="source-toggle" href="#"
|
147
|
-
onclick="toggleCode('
|
148
|
-
<div class="method-source-code" id="
|
148
|
+
onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
|
149
|
+
<div class="method-source-code" id="M000233-source">
|
149
150
|
<pre>
|
150
151
|
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 11</span>
|
151
152
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">id_generator</span>)
|
@@ -160,11 +161,11 @@ The format of the internal datastructure is:
|
|
160
161
|
|
161
162
|
<h3 class="section-bar">Public Instance methods</h3>
|
162
163
|
|
163
|
-
<div id="method-
|
164
|
-
<a name="
|
164
|
+
<div id="method-M000234" class="method-detail">
|
165
|
+
<a name="M000234"></a>
|
165
166
|
|
166
167
|
<div class="method-heading">
|
167
|
-
<a href="#
|
168
|
+
<a href="#M000234" class="method-signature">
|
168
169
|
<span class="method-name">register_for</span><span class="method-args">(object, type, callback)</span>
|
169
170
|
</a>
|
170
171
|
</div>
|
@@ -175,14 +176,41 @@ Register <tt>callback</tt> for <tt>object</tt> under <tt>type</tt> and
|
|
175
176
|
return a unique callback id.
|
176
177
|
</p>
|
177
178
|
<p><a class="source-toggle" href="#"
|
178
|
-
onclick="toggleCode('
|
179
|
-
<div class="method-source-code" id="
|
179
|
+
onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
|
180
|
+
<div class="method-source-code" id="M000234-source">
|
180
181
|
<pre>
|
181
182
|
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 19</span>
|
182
183
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register_for</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">callback</span>)
|
184
|
+
<span class="ruby-identifier">register_named_for</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">callback</span>, <span class="ruby-ivar">@idgen</span>.<span class="ruby-identifier">next</span>)
|
185
|
+
<span class="ruby-keyword kw">end</span>
|
186
|
+
</pre>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
<div id="method-M000235" class="method-detail">
|
192
|
+
<a name="M000235"></a>
|
193
|
+
|
194
|
+
<div class="method-heading">
|
195
|
+
<a href="#M000235" class="method-signature">
|
196
|
+
<span class="method-name">register_named_for</span><span class="method-args">(object, type, callback, named_id)</span>
|
197
|
+
</a>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
<div class="method-description">
|
201
|
+
<p>
|
202
|
+
Register <tt>callback</tt> for <tt>object</tt> under <tt>type</tt> with the
|
203
|
+
id <tt>named_id</tt>.
|
204
|
+
</p>
|
205
|
+
<p><a class="source-toggle" href="#"
|
206
|
+
onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
|
207
|
+
<div class="method-source-code" id="M000235-source">
|
208
|
+
<pre>
|
209
|
+
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 25</span>
|
210
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register_named_for</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">callback</span>, <span class="ruby-identifier">named_id</span>)
|
211
|
+
<span class="ruby-identifier">cid</span> = <span class="ruby-identifier">named_id</span>.<span class="ruby-identifier">to_s</span>
|
183
212
|
<span class="ruby-identifier">c</span> = (<span class="ruby-ivar">@callbacks</span>[<span class="ruby-identifier">type</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>)
|
184
213
|
<span class="ruby-identifier">o</span> = (<span class="ruby-ivar">@obj_to_id_map</span>[<span class="ruby-identifier">type</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>)
|
185
|
-
<span class="ruby-identifier">cid</span> = <span class="ruby-ivar">@idgen</span>.<span class="ruby-identifier">next</span>.<span class="ruby-identifier">to_s</span>
|
186
214
|
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"duplicate callback id"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">cid</span>)
|
187
215
|
<span class="ruby-identifier">c</span>[<span class="ruby-identifier">cid</span>] = <span class="ruby-identifier">callback</span>
|
188
216
|
(<span class="ruby-identifier">o</span>[<span class="ruby-identifier">object</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator"><<</span> <span class="ruby-identifier">cid</span>
|
@@ -196,7 +224,7 @@ return a unique callback id.
|
|
196
224
|
|
197
225
|
</div>
|
198
226
|
<div id="section">
|
199
|
-
<h2 class="section-title"><a name="
|
227
|
+
<h2 class="section-title"><a name="SEC00097">Friend methods for Wee::CallbackStream</a></h2>
|
200
228
|
<div class="section-comment">
|
201
229
|
|
202
230
|
</div>
|
@@ -212,21 +240,21 @@ return a unique callback id.
|
|
212
240
|
<div id="methods">
|
213
241
|
<h3 class="section-bar">Public Instance methods</h3>
|
214
242
|
|
215
|
-
<div id="method-
|
216
|
-
<a name="
|
243
|
+
<div id="method-M000238" class="method-detail">
|
244
|
+
<a name="M000238"></a>
|
217
245
|
|
218
246
|
<div class="method-heading">
|
219
|
-
<a href="#
|
247
|
+
<a href="#M000238" class="method-signature">
|
220
248
|
<span class="method-name">all_of_type</span><span class="method-args">(type)</span>
|
221
249
|
</a>
|
222
250
|
</div>
|
223
251
|
|
224
252
|
<div class="method-description">
|
225
253
|
<p><a class="source-toggle" href="#"
|
226
|
-
onclick="toggleCode('
|
227
|
-
<div class="method-source-code" id="
|
254
|
+
onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
|
255
|
+
<div class="method-source-code" id="M000238-source">
|
228
256
|
<pre>
|
229
|
-
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line
|
257
|
+
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 55</span>
|
230
258
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all_of_type</span>(<span class="ruby-identifier">type</span>)
|
231
259
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span> = <span class="ruby-ivar">@callbacks</span>[<span class="ruby-identifier">type</span>]
|
232
260
|
<span class="ruby-identifier">c</span>
|
@@ -239,21 +267,21 @@ return a unique callback id.
|
|
239
267
|
</div>
|
240
268
|
</div>
|
241
269
|
|
242
|
-
<div id="method-
|
243
|
-
<a name="
|
270
|
+
<div id="method-M000237" class="method-detail">
|
271
|
+
<a name="M000237"></a>
|
244
272
|
|
245
273
|
<div class="method-heading">
|
246
|
-
<a href="#
|
274
|
+
<a href="#M000237" class="method-signature">
|
247
275
|
<span class="method-name">get_callback_for</span><span class="method-args">(id, type)</span>
|
248
276
|
</a>
|
249
277
|
</div>
|
250
278
|
|
251
279
|
<div class="method-description">
|
252
280
|
<p><a class="source-toggle" href="#"
|
253
|
-
onclick="toggleCode('
|
254
|
-
<div class="method-source-code" id="
|
281
|
+
onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
|
282
|
+
<div class="method-source-code" id="M000237-source">
|
255
283
|
<pre>
|
256
|
-
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line
|
284
|
+
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 47</span>
|
257
285
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_callback_for</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">type</span>)
|
258
286
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span> = <span class="ruby-ivar">@callbacks</span>[<span class="ruby-identifier">type</span>]
|
259
287
|
<span class="ruby-identifier">c</span>[<span class="ruby-identifier">id</span>]
|
@@ -266,21 +294,21 @@ return a unique callback id.
|
|
266
294
|
</div>
|
267
295
|
</div>
|
268
296
|
|
269
|
-
<div id="method-
|
270
|
-
<a name="
|
297
|
+
<div id="method-M000236" class="method-detail">
|
298
|
+
<a name="M000236"></a>
|
271
299
|
|
272
300
|
<div class="method-heading">
|
273
|
-
<a href="#
|
301
|
+
<a href="#M000236" class="method-signature">
|
274
302
|
<span class="method-name">get_ids_for</span><span class="method-args">(object, type)</span>
|
275
303
|
</a>
|
276
304
|
</div>
|
277
305
|
|
278
306
|
<div class="method-description">
|
279
307
|
<p><a class="source-toggle" href="#"
|
280
|
-
onclick="toggleCode('
|
281
|
-
<div class="method-source-code" id="
|
308
|
+
onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
|
309
|
+
<div class="method-source-code" id="M000236-source">
|
282
310
|
<pre>
|
283
|
-
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line
|
311
|
+
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 39</span>
|
284
312
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_ids_for</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">type</span>)
|
285
313
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">o</span> = <span class="ruby-ivar">@obj_to_id_map</span>[<span class="ruby-identifier">type</span>]
|
286
314
|
<span class="ruby-identifier">o</span>[<span class="ruby-identifier">object</span>] <span class="ruby-operator">||</span> []
|
@@ -94,9 +94,9 @@ The intersection of registered callbacks and those that occured.
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
97
|
+
<a href="#M000300">all_of_type</a>
|
98
|
+
<a href="#M000298">new</a>
|
99
|
+
<a href="#M000299">with_callbacks_for</a>
|
100
100
|
</div>
|
101
101
|
</div>
|
102
102
|
|
@@ -118,11 +118,11 @@ The intersection of registered callbacks and those that occured.
|
|
118
118
|
<div id="methods">
|
119
119
|
<h3 class="section-bar">Public Class methods</h3>
|
120
120
|
|
121
|
-
<div id="method-
|
122
|
-
<a name="
|
121
|
+
<div id="method-M000298" class="method-detail">
|
122
|
+
<a name="M000298"></a>
|
123
123
|
|
124
124
|
<div class="method-heading">
|
125
|
-
<a href="#
|
125
|
+
<a href="#M000298" class="method-signature">
|
126
126
|
<span class="method-name">new</span><span class="method-args">(callbacks, ids_and_values)</span>
|
127
127
|
</a>
|
128
128
|
</div>
|
@@ -138,10 +138,10 @@ occurend in a request, e.g. { id => value }.
|
|
138
138
|
</dd>
|
139
139
|
</dl>
|
140
140
|
<p><a class="source-toggle" href="#"
|
141
|
-
onclick="toggleCode('
|
142
|
-
<div class="method-source-code" id="
|
141
|
+
onclick="toggleCode('M000298-source');return false;">[Source]</a></p>
|
142
|
+
<div class="method-source-code" id="M000298-source">
|
143
143
|
<pre>
|
144
|
-
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line
|
144
|
+
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 78</span>
|
145
145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">callbacks</span>, <span class="ruby-identifier">ids_and_values</span>)
|
146
146
|
<span class="ruby-ivar">@callbacks</span> = <span class="ruby-identifier">callbacks</span>
|
147
147
|
<span class="ruby-ivar">@ids_and_values</span> = <span class="ruby-identifier">ids_and_values</span>
|
@@ -154,11 +154,11 @@ occurend in a request, e.g. { id => value }.
|
|
154
154
|
|
155
155
|
<h3 class="section-bar">Public Instance methods</h3>
|
156
156
|
|
157
|
-
<div id="method-
|
158
|
-
<a name="
|
157
|
+
<div id="method-M000300" class="method-detail">
|
158
|
+
<a name="M000300"></a>
|
159
159
|
|
160
160
|
<div class="method-heading">
|
161
|
-
<a href="#
|
161
|
+
<a href="#M000300" class="method-signature">
|
162
162
|
<span class="method-name">all_of_type</span><span class="method-args">(type)</span>
|
163
163
|
</a>
|
164
164
|
</div>
|
@@ -169,10 +169,10 @@ Returns a [callback, value] array of all callbacks of <tt>type</tt> for
|
|
169
169
|
which an id was given.
|
170
170
|
</p>
|
171
171
|
<p><a class="source-toggle" href="#"
|
172
|
-
onclick="toggleCode('
|
173
|
-
<div class="method-source-code" id="
|
172
|
+
onclick="toggleCode('M000300-source');return false;">[Source]</a></p>
|
173
|
+
<div class="method-source-code" id="M000300-source">
|
174
174
|
<pre>
|
175
|
-
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line
|
175
|
+
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 95</span>
|
176
176
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all_of_type</span>(<span class="ruby-identifier">type</span>)
|
177
177
|
<span class="ruby-identifier">a</span> = []
|
178
178
|
<span class="ruby-ivar">@callbacks</span>.<span class="ruby-identifier">all_of_type</span>(<span class="ruby-identifier">type</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">id</span>, <span class="ruby-identifier">callback</span><span class="ruby-operator">|</span>
|
@@ -185,21 +185,21 @@ which an id was given.
|
|
185
185
|
</div>
|
186
186
|
</div>
|
187
187
|
|
188
|
-
<div id="method-
|
189
|
-
<a name="
|
188
|
+
<div id="method-M000299" class="method-detail">
|
189
|
+
<a name="M000299"></a>
|
190
190
|
|
191
191
|
<div class="method-heading">
|
192
|
-
<a href="#
|
192
|
+
<a href="#M000299" class="method-signature">
|
193
193
|
<span class="method-name">with_callbacks_for</span><span class="method-args">(object, type) {|@callbacks.get_callback_for(id, type), @ids_and_values[id]| ...}</span>
|
194
194
|
</a>
|
195
195
|
</div>
|
196
196
|
|
197
197
|
<div class="method-description">
|
198
198
|
<p><a class="source-toggle" href="#"
|
199
|
-
onclick="toggleCode('
|
200
|
-
<div class="method-source-code" id="
|
199
|
+
onclick="toggleCode('M000299-source');return false;">[Source]</a></p>
|
200
|
+
<div class="method-source-code" id="M000299-source">
|
201
201
|
<pre>
|
202
|
-
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line
|
202
|
+
<span class="ruby-comment cmt"># File lib/wee/core/callback.rb, line 84</span>
|
203
203
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_callbacks_for</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">type</span>)
|
204
204
|
<span class="ruby-identifier">matching_ids</span> = <span class="ruby-ivar">@callbacks</span>.<span class="ruby-identifier">get_ids_for</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">type</span>) <span class="ruby-operator">&</span> <span class="ruby-ivar">@ids</span>
|
205
205
|
<span class="ruby-identifier">matching_ids</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">id</span><span class="ruby-operator">|</span>
|