wee 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +286 -0
- data/Features +185 -0
- data/doc/rdoc/classes/ActionView.html +107 -0
- data/doc/rdoc/classes/ActionView/Base.html +133 -0
- data/doc/rdoc/classes/Array.html +7 -59
- 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/Hash.html +120 -0
- data/doc/rdoc/classes/Main.html +58 -34
- data/doc/rdoc/classes/Object.html +12 -12
- data/doc/rdoc/classes/OgScaffolder.html +165 -166
- data/doc/rdoc/classes/OgScaffolder/Editor.html +112 -112
- data/doc/rdoc/classes/String.html +7 -59
- data/doc/rdoc/classes/Struct.html +14 -14
- data/doc/rdoc/classes/Wee.html +70 -6
- data/doc/rdoc/classes/Wee/AbstractSession.html +502 -0
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +11 -11
- data/doc/rdoc/classes/Wee/Application.html +139 -84
- data/doc/rdoc/classes/Wee/Brush.html +21 -18
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +90 -17
- data/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +162 -0
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +41 -17
- 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 +112 -86
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +160 -0
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +15 -15
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +21 -21
- 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/RadioButtonTag.html +234 -0
- data/doc/rdoc/classes/Wee/Brush/RadioButtonTag/RadioGroup.html +207 -0
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +124 -28
- data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -7
- 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 +42 -42
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +48 -15
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +38 -38
- data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
- data/doc/rdoc/classes/Wee/CanvasMixin.html +225 -0
- data/doc/rdoc/classes/Wee/Component.html +202 -201
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +7 -7
- data/doc/rdoc/classes/Wee/ComponentDispatcher.html +289 -0
- data/doc/rdoc/classes/Wee/ComponentRunner.html +321 -0
- data/doc/rdoc/classes/Wee/Context.html +63 -3
- data/doc/rdoc/classes/Wee/Decoration.html +45 -45
- data/doc/rdoc/classes/Wee/Delegate.html +30 -30
- data/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +164 -0
- data/doc/rdoc/classes/Wee/ErrorResponse.html +16 -16
- data/doc/rdoc/classes/Wee/Examples.html +114 -0
- data/doc/rdoc/classes/Wee/Examples/Calculator.html +319 -0
- data/doc/rdoc/classes/Wee/Examples/Counter.html +289 -0
- data/doc/rdoc/classes/Wee/Examples/EditableCounter.html +210 -0
- data/doc/rdoc/classes/Wee/Examples/Window.html +346 -0
- data/doc/rdoc/classes/Wee/FastCGIAdaptor.html +227 -0
- data/doc/rdoc/classes/Wee/FormDecoration.html +6 -6
- data/doc/rdoc/classes/Wee/GenericResponse.html +7 -7
- data/doc/rdoc/classes/Wee/HtmlCanvasRenderer.html +1230 -0
- data/doc/rdoc/classes/Wee/HtmlWriter.html +40 -40
- data/doc/rdoc/classes/Wee/IdGenerator.html +148 -0
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +27 -14
- data/doc/rdoc/classes/Wee/LoginDecoration.html +261 -0
- data/doc/rdoc/classes/Wee/Md5IdGenerator.html +14 -14
- data/doc/rdoc/classes/Wee/MessageBox.html +14 -14
- data/doc/rdoc/classes/Wee/Nitro.html +114 -0
- data/doc/rdoc/classes/Wee/Nitro/ControllerClassMixin.html +192 -0
- data/doc/rdoc/classes/Wee/Nitro/ControllerMixin.html +345 -0
- data/doc/rdoc/classes/Wee/Nitro/FormTag.html +155 -0
- data/doc/rdoc/classes/Wee/Nitro/HtmlCanvasRenderer.html +178 -0
- data/doc/rdoc/classes/Wee/Page.html +4 -0
- data/doc/rdoc/classes/Wee/PageDecoration.html +18 -18
- data/doc/rdoc/classes/Wee/PagelessApplication.html +13 -11
- data/doc/rdoc/classes/Wee/PagelessComponentDriver.html +296 -0
- data/doc/rdoc/classes/Wee/PagelessRequest.html +52 -21
- data/doc/rdoc/classes/Wee/PagelessSession.html +130 -91
- data/doc/rdoc/classes/Wee/Pager.html +534 -0
- data/doc/rdoc/classes/Wee/Presenter.html +482 -298
- data/doc/rdoc/classes/Wee/Rails.html +114 -0
- data/doc/rdoc/classes/Wee/Rails/ControllerClassMixin.html +192 -0
- data/doc/rdoc/classes/Wee/Rails/ControllerMixin.html +342 -0
- data/doc/rdoc/classes/Wee/Rails/FormTag.html +155 -0
- data/doc/rdoc/classes/Wee/Rails/HtmlCanvasRenderer.html +177 -0
- data/doc/rdoc/classes/Wee/RedirectResponse.html +7 -7
- data/doc/rdoc/classes/Wee/RefreshResponse.html +7 -7
- data/doc/rdoc/classes/Wee/Renderer.html +208 -0
- data/doc/rdoc/classes/Wee/RenderingContext.html +175 -3
- data/doc/rdoc/classes/Wee/Request.html +197 -46
- data/doc/rdoc/classes/Wee/RequestHandler.html +31 -31
- data/doc/rdoc/classes/Wee/Response.html +44 -43
- data/doc/rdoc/classes/Wee/Session.html +296 -402
- data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +14 -14
- data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
- data/doc/rdoc/classes/Wee/Utils.html +22 -22
- data/doc/rdoc/classes/Wee/Utils/LRUCache.html +6 -6
- data/doc/rdoc/classes/Wee/ValueHolder.html +19 -19
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +72 -46
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +6 -6
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/INSTALL.html +1 -1
- data/doc/rdoc/files/README.html +8 -12
- data/doc/rdoc/files/lib/cache/cache_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/abstractsession_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/adaptors/fastcgi_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/adaptors/nitro_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/adaptors/rails_rb.html +101 -0
- 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/component_dispatcher_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/login_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/pager_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components_rb.html +4 -1
- data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/continuation_rb.html +1 -1
- 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/componentrunner_rb.html +110 -0
- data/doc/rdoc/files/lib/wee/core/context_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core/decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/idgen_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core/page_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/renderer_rb.html +107 -0
- data/doc/rdoc/files/lib/wee/core/snapshot_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/valueholder_rb.html +2 -2
- data/doc/rdoc/files/lib/wee/core_ext_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core_rb.html +7 -14
- data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/examples/calculator_rb.html +107 -0
- data/doc/rdoc/files/lib/wee/examples/counter_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/examples/editable_counter_rb.html +114 -0
- data/doc/rdoc/files/lib/wee/examples/window_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/page_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/pageless/application_rb.html +8 -1
- data/doc/rdoc/files/lib/wee/pageless/request_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/pageless/session_rb.html +2 -1
- data/doc/rdoc/files/lib/wee/pageless_rb.html +1 -1
- 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/renderer/html/writer_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/request_rb.html +5 -4
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/response_rb.html +2 -1
- data/doc/rdoc/files/lib/wee/session_rb.html +2 -3
- data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +2 -2
- data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/snapshot_ext_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/template_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils_rb.html +1 -1
- data/doc/rdoc/files/lib/wee_rb.html +5 -3
- data/doc/rdoc/fr_class_index.html +34 -2
- data/doc/rdoc/fr_file_index.html +17 -1
- data/doc/rdoc/fr_method_index.html +464 -314
- data/examples/ajax/ajax.rb +1 -1
- data/examples/demo.rb +47 -0
- data/examples/{calendar.rb → demo/calendar.rb} +89 -97
- data/examples/{example.rb → demo/example.rb} +17 -97
- data/examples/dispatcher.rb +37 -0
- data/examples/draw.rb +14 -11
- data/examples/nitro/run.rb +42 -0
- data/examples/radio.rb +44 -0
- data/examples/test.rb +3 -27
- data/lib/wee.rb +15 -3
- data/lib/wee/adaptors/nitro.rb +154 -0
- data/lib/wee/adaptors/rails.rb +154 -0
- data/lib/wee/application.rb +22 -20
- data/lib/wee/components.rb +3 -0
- data/lib/wee/components/component_dispatcher.rb +46 -0
- data/lib/wee/components/login_decoration.rb +35 -0
- data/lib/wee/components/messagebox.rb +2 -2
- data/lib/wee/components/pager.rb +102 -0
- data/lib/wee/continuation/core/component.rb +13 -12
- data/lib/wee/continuation/session.rb +11 -19
- data/lib/wee/core.rb +8 -7
- data/lib/wee/core/component.rb +8 -28
- data/lib/wee/core/componentrunner.rb +73 -0
- data/lib/wee/core/context.rb +27 -0
- data/lib/wee/core/idgen.rb +5 -0
- data/lib/wee/core/page.rb +1 -0
- data/lib/wee/core/presenter.rb +10 -126
- data/lib/wee/core/renderer.rb +23 -0
- data/lib/wee/core_ext.rb +122 -0
- data/lib/wee/databases/og/scaffolder.rb +0 -1
- data/lib/wee/examples/calculator.rb +70 -0
- data/lib/wee/examples/counter.rb +33 -0
- data/lib/wee/examples/editable_counter.rb +31 -0
- data/{examples → lib/wee/examples}/window.rb +29 -23
- data/lib/wee/idgen/md5.rb +1 -1
- data/lib/wee/idgen/simple.rb +1 -1
- data/lib/wee/pageless/session.rb +2 -3
- data/lib/wee/renderer/html/brushes.rb +142 -22
- data/lib/wee/renderer/html/canvas.rb +57 -19
- data/lib/wee/response.rb +3 -2
- data/lib/wee/session.rb +10 -54
- data/lib/wee/skeleton/og/components/main.rb +5 -1
- data/lib/wee/skeleton/og/conf/db.rb +1 -1
- data/lib/wee/snapshot_ext.rb +4 -10
- data/lib/wee/template.rb +19 -5
- data/lib/wee/utils/helper.rb +2 -2
- metadata +90 -13
- data/examples/calculator.rb +0 -67
- data/lib/wee/context.rb +0 -2
data/lib/wee/response.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'time'
|
2
|
+
require 'cgi'
|
2
3
|
|
3
4
|
class Wee::Response
|
4
5
|
DEFAULT_HEADER = {}.freeze
|
@@ -77,8 +78,8 @@ class Wee::ErrorResponse < Wee::Response
|
|
77
78
|
|
78
79
|
def render(c)
|
79
80
|
c << "<html><head><title>Error occured</title></head><body>"
|
80
|
-
c << "<p>#{ @exception }"
|
81
|
-
c << @exception.backtrace.join("<br/>")
|
81
|
+
c << "<p>#{ CGI.escapeHTML(@exception.inspect) }<br/>"
|
82
|
+
c << @exception.backtrace.map{|s| CGI.escapeHTML(s)}.join("<br/>")
|
82
83
|
c << "</p>"
|
83
84
|
c << "</body></html>"
|
84
85
|
end
|
data/lib/wee/session.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'wee/abstractsession'
|
2
|
-
require 'wee/page'
|
3
2
|
|
4
3
|
class Wee::Session < Wee::AbstractSession
|
5
4
|
|
6
|
-
attr_accessor :
|
5
|
+
attr_accessor :component_runner
|
7
6
|
attr_accessor :page_store
|
8
7
|
|
9
8
|
def initialize(&block)
|
@@ -26,10 +25,10 @@ class Wee::Session < Wee::AbstractSession
|
|
26
25
|
|
27
26
|
with_session do
|
28
27
|
block.call(self) if block
|
29
|
-
raise ArgumentError, "No
|
28
|
+
raise ArgumentError, "No component runner specified" if @component_runner.nil?
|
30
29
|
raise ArgumentError, "No page_store specified" if @page_store.nil?
|
31
30
|
|
32
|
-
@initial_snapshot = snapshot
|
31
|
+
@initial_snapshot = @component_runner.snapshot
|
33
32
|
end
|
34
33
|
end
|
35
34
|
|
@@ -102,61 +101,26 @@ class Wee::Session < Wee::AbstractSession
|
|
102
101
|
# new page view.
|
103
102
|
|
104
103
|
callback_stream = Wee::CallbackStream.new(@page.callbacks, @context.request.fields)
|
105
|
-
|
104
|
+
premature_response = @component_runner.process_callbacks(callback_stream)
|
106
105
|
|
107
106
|
post_callbacks_hook()
|
108
107
|
|
109
|
-
if
|
108
|
+
if premature_response
|
110
109
|
# replace existing page with new snapshot
|
111
|
-
@page.snapshot =
|
110
|
+
@page.snapshot = @component_runner.snapshot
|
112
111
|
@page_store[@context.request.page_id] = @page
|
113
112
|
@snapshot_page_id = @context.request.page_id
|
114
113
|
|
115
114
|
# and send response
|
116
|
-
set_response(@context,
|
115
|
+
set_response(@context, premature_response)
|
117
116
|
else
|
118
117
|
handle_new_page_view(@context)
|
119
118
|
end
|
120
119
|
end
|
121
120
|
|
122
|
-
# This method triggers two tree traversals of process_callbacks on the root
|
123
|
-
# component. First, all input callbacks are invoked, then in the second
|
124
|
-
# traversal, the first found action callback is invoked (there's only ever
|
125
|
-
# one per request) and then the traversal is stopped
|
126
|
-
#
|
127
|
-
# NOTE: Input callbacks should never call other components!
|
128
|
-
#
|
129
|
-
# Returns nil or send_response in case of a premature response.
|
130
|
-
|
131
|
-
def invoke_callbacks(callback_stream)
|
132
|
-
if callback_stream.all_of_type(:action).size > 1
|
133
|
-
raise "Not allowed to specify more than one action callback"
|
134
|
-
end
|
135
|
-
|
136
|
-
send_response = catch(:wee_send_response) {
|
137
|
-
catch(:wee_back_to_session) {
|
138
|
-
# invoke input callbacks
|
139
|
-
@root_component.process_callbacks_chain {|this|
|
140
|
-
callback_stream.with_callbacks_for(this, :input) { |callback, value|
|
141
|
-
callback.call(value)
|
142
|
-
}
|
143
|
-
}
|
144
|
-
|
145
|
-
# invoke first found action callback. only the first action callback is invoked.
|
146
|
-
@root_component.process_callbacks_chain {|this|
|
147
|
-
callback_stream.with_callbacks_for(this, :action) { |callback, value|
|
148
|
-
callback.call
|
149
|
-
throw :wee_back_to_session
|
150
|
-
}
|
151
|
-
}
|
152
|
-
}
|
153
|
-
nil
|
154
|
-
}
|
155
|
-
end
|
156
|
-
|
157
121
|
def handle_new_page_view(context, snapshot=nil)
|
158
122
|
new_page_id = @idgen.next.to_s
|
159
|
-
new_page = create_page(snapshot ||
|
123
|
+
new_page = create_page(snapshot || @component_runner.snapshot)
|
160
124
|
@page_store[new_page_id] = new_page
|
161
125
|
@snapshot_page_id = new_page_id
|
162
126
|
redirect_url = context.request.build_url(:page_id => new_page_id)
|
@@ -166,9 +130,8 @@ class Wee::Session < Wee::AbstractSession
|
|
166
130
|
def respond(context, callbacks)
|
167
131
|
pre_respond_hook
|
168
132
|
set_response(context, Wee::GenericResponse.new('text/html', ''))
|
169
|
-
|
170
|
-
|
171
|
-
@root_component.do_render_chain(rctx)
|
133
|
+
rctx = Wee::RenderingContext.new(context, callbacks, Wee::HtmlWriter.new(context.response.content))
|
134
|
+
@component_runner.render(rctx)
|
172
135
|
end
|
173
136
|
|
174
137
|
def pre_respond_hook
|
@@ -177,13 +140,6 @@ class Wee::Session < Wee::AbstractSession
|
|
177
140
|
def post_callbacks_hook
|
178
141
|
end
|
179
142
|
|
180
|
-
# Take a snapshot of the root component and return it.
|
181
|
-
|
182
|
-
def snapshot
|
183
|
-
@root_component.backtrack_state_chain(snap = Wee::Snapshot.new)
|
184
|
-
return snap.freeze
|
185
|
-
end
|
186
|
-
|
187
143
|
# Return a new Wee::Page object with the given snapshot assigned.
|
188
144
|
|
189
145
|
def create_page(snapshot)
|
data/lib/wee/snapshot_ext.rb
CHANGED
@@ -14,7 +14,7 @@ class Object
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
module Wee::DupReplaceSnapshotMixin
|
18
18
|
def take_snapshot
|
19
19
|
dup
|
20
20
|
end
|
@@ -24,15 +24,9 @@ class Array
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
class
|
28
|
-
|
29
|
-
|
30
|
-
end
|
31
|
-
|
32
|
-
def restore_snapshot(snap)
|
33
|
-
replace(snap)
|
34
|
-
end
|
35
|
-
end
|
27
|
+
class Array; include Wee::DupReplaceSnapshotMixin end
|
28
|
+
class String; include Wee::DupReplaceSnapshotMixin end
|
29
|
+
class Hash; include Wee::DupReplaceSnapshotMixin end
|
36
30
|
|
37
31
|
class Struct
|
38
32
|
def take_snapshot
|
data/lib/wee/template.rb
CHANGED
@@ -7,6 +7,12 @@ class Wee::Presenter
|
|
7
7
|
"lookup_property(#{ hash[:property].inspect })"
|
8
8
|
elsif hash.has_key?(:file)
|
9
9
|
hash[:file].inspect
|
10
|
+
elsif hash.has_key?(:local)
|
11
|
+
# like file, but use relative to current path
|
12
|
+
|
13
|
+
caller_path = caller.first.sub(/:\d+$/, "")
|
14
|
+
|
15
|
+
File.join(File.dirname(caller_path), hash[:local]).inspect
|
10
16
|
else
|
11
17
|
caller_path = caller.first.sub(/:\d+$/, "")
|
12
18
|
basename = caller_path[0, caller_path.rindex(".rb")]
|
@@ -19,10 +25,18 @@ class Wee::Presenter
|
|
19
25
|
end.inspect
|
20
26
|
end
|
21
27
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
28
|
+
if hash[:r_as_param]
|
29
|
+
class_eval %{
|
30
|
+
def #{ method }(r)
|
31
|
+
r.template(#{ file_code })
|
32
|
+
end
|
33
|
+
}
|
34
|
+
else
|
35
|
+
class_eval %{
|
36
|
+
def #{ method }
|
37
|
+
r.template(#{ file_code })
|
38
|
+
end
|
39
|
+
}
|
40
|
+
end
|
27
41
|
end
|
28
42
|
end
|
data/lib/wee/utils/helper.rb
CHANGED
@@ -34,9 +34,9 @@ module Wee::Utils
|
|
34
34
|
app.default_request_handler {
|
35
35
|
options[:session].new {|sess|
|
36
36
|
if component
|
37
|
-
sess.
|
37
|
+
sess.component_runner = Wee::ComponentRunner.new(component.new)
|
38
38
|
else
|
39
|
-
sess.
|
39
|
+
sess.component_runner = Wee::ComponentRunner.new(block.call)
|
40
40
|
end
|
41
41
|
if sess.respond_to?(:page_store=)
|
42
42
|
# This is so that you can use a Pageless session, which does not have
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.8.
|
2
|
+
rubygems_version: 0.8.10
|
3
3
|
specification_version: 1
|
4
4
|
name: wee
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2005-
|
6
|
+
version: 0.9.0
|
7
|
+
date: 2005-07-12
|
8
8
|
summary: Wee is a framework for building highly dynamic web applications.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- bin
|
34
34
|
- benchmark
|
35
35
|
- examples
|
36
|
+
- Features
|
36
37
|
- Rakefile
|
37
38
|
- wee.gemspec
|
38
39
|
- TODO
|
@@ -93,6 +94,7 @@ files:
|
|
93
94
|
- doc/rdoc/files/lib/wee/component_rb.html
|
94
95
|
- doc/rdoc/files/lib/wee/template_rb.html
|
95
96
|
- doc/rdoc/files/lib/wee/page_rb.html
|
97
|
+
- doc/rdoc/files/lib/wee/examples
|
96
98
|
- doc/rdoc/files/lib/wee/component_ext_rb.html
|
97
99
|
- doc/rdoc/files/lib/wee/components_rb.html
|
98
100
|
- doc/rdoc/files/lib/wee/core_rb.html
|
@@ -113,16 +115,26 @@ files:
|
|
113
115
|
- doc/rdoc/files/lib/wee/decoration_rb.html
|
114
116
|
- doc/rdoc/files/lib/wee/stuff_rb.html
|
115
117
|
- doc/rdoc/files/lib/wee/request_rb.html
|
118
|
+
- doc/rdoc/files/lib/wee/core_ext_rb.html
|
119
|
+
- doc/rdoc/files/lib/wee/abstractsession_rb.html
|
116
120
|
- doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html
|
117
121
|
- doc/rdoc/files/lib/wee/components/form_decoration_rb.html
|
118
122
|
- doc/rdoc/files/lib/wee/components/messagebox_rb.html
|
119
123
|
- doc/rdoc/files/lib/wee/components/page_decoration_rb.html
|
124
|
+
- doc/rdoc/files/lib/wee/components/component_dispatcher_rb.html
|
125
|
+
- doc/rdoc/files/lib/wee/components/login_decoration_rb.html
|
126
|
+
- doc/rdoc/files/lib/wee/components/pager_rb.html
|
127
|
+
- doc/rdoc/files/lib/wee/core/componentrunner_rb.html
|
120
128
|
- doc/rdoc/files/lib/wee/core/valueholder_rb.html
|
121
129
|
- doc/rdoc/files/lib/wee/core/callback_rb.html
|
122
130
|
- doc/rdoc/files/lib/wee/core/snapshot_rb.html
|
123
131
|
- doc/rdoc/files/lib/wee/core/component_rb.html
|
124
132
|
- doc/rdoc/files/lib/wee/core/decoration_rb.html
|
125
133
|
- doc/rdoc/files/lib/wee/core/presenter_rb.html
|
134
|
+
- doc/rdoc/files/lib/wee/core/context_rb.html
|
135
|
+
- doc/rdoc/files/lib/wee/core/idgen_rb.html
|
136
|
+
- doc/rdoc/files/lib/wee/core/renderer_rb.html
|
137
|
+
- doc/rdoc/files/lib/wee/core/page_rb.html
|
126
138
|
- doc/rdoc/files/lib/wee/pageless/application_rb.html
|
127
139
|
- doc/rdoc/files/lib/wee/pageless/session_rb.html
|
128
140
|
- doc/rdoc/files/lib/wee/pageless/request_rb.html
|
@@ -138,6 +150,9 @@ files:
|
|
138
150
|
- doc/rdoc/files/lib/wee/rendering/html/canvas_rb.html
|
139
151
|
- doc/rdoc/files/lib/wee/rendering/html/writer_rb.html
|
140
152
|
- doc/rdoc/files/lib/wee/adaptors/webrick_rb.html
|
153
|
+
- doc/rdoc/files/lib/wee/adaptors/fastcgi_rb.html
|
154
|
+
- doc/rdoc/files/lib/wee/adaptors/rails_rb.html
|
155
|
+
- doc/rdoc/files/lib/wee/adaptors/nitro_rb.html
|
141
156
|
- doc/rdoc/files/lib/wee/skeleton/og
|
142
157
|
- doc/rdoc/files/lib/wee/skeleton/simple
|
143
158
|
- doc/rdoc/files/lib/wee/skeleton/og/models
|
@@ -161,6 +176,10 @@ files:
|
|
161
176
|
- doc/rdoc/files/lib/wee/utils/autoreload_rb.html
|
162
177
|
- doc/rdoc/files/lib/wee/utils/helper_rb.html
|
163
178
|
- doc/rdoc/files/lib/wee/utils/cache_rb.html
|
179
|
+
- doc/rdoc/files/lib/wee/examples/calculator_rb.html
|
180
|
+
- doc/rdoc/files/lib/wee/examples/counter_rb.html
|
181
|
+
- doc/rdoc/files/lib/wee/examples/window_rb.html
|
182
|
+
- doc/rdoc/files/lib/wee/examples/editable_counter_rb.html
|
164
183
|
- doc/rdoc/files/lib/cache/cache_rb.html
|
165
184
|
- doc/rdoc/classes/Wee
|
166
185
|
- doc/rdoc/classes/OgScaffolder
|
@@ -178,6 +197,9 @@ files:
|
|
178
197
|
- doc/rdoc/classes/String.html
|
179
198
|
- doc/rdoc/classes/Object.html
|
180
199
|
- doc/rdoc/classes/Recipe.html
|
200
|
+
- doc/rdoc/classes/ActionView.html
|
201
|
+
- doc/rdoc/classes/Hash.html
|
202
|
+
- doc/rdoc/classes/ActionView
|
181
203
|
- doc/rdoc/classes/Wee/Utils
|
182
204
|
- doc/rdoc/classes/Wee/Component
|
183
205
|
- doc/rdoc/classes/Wee/StateRegistry
|
@@ -225,6 +247,24 @@ files:
|
|
225
247
|
- doc/rdoc/classes/Wee/PagelessSession.html
|
226
248
|
- doc/rdoc/classes/Wee/ErrorResponse.html
|
227
249
|
- doc/rdoc/classes/Wee/Md5IdGenerator.html
|
250
|
+
- doc/rdoc/classes/Wee/Nitro
|
251
|
+
- doc/rdoc/classes/Wee/Nitro.html
|
252
|
+
- doc/rdoc/classes/Wee/Rails
|
253
|
+
- doc/rdoc/classes/Wee/CanvasMixin.html
|
254
|
+
- doc/rdoc/classes/Wee/Rails.html
|
255
|
+
- doc/rdoc/classes/Wee/Examples
|
256
|
+
- doc/rdoc/classes/Wee/ComponentDispatcher.html
|
257
|
+
- doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html
|
258
|
+
- doc/rdoc/classes/Wee/Examples.html
|
259
|
+
- doc/rdoc/classes/Wee/ComponentRunner.html
|
260
|
+
- doc/rdoc/classes/Wee/IdGenerator.html
|
261
|
+
- doc/rdoc/classes/Wee/Renderer.html
|
262
|
+
- doc/rdoc/classes/Wee/Pager.html
|
263
|
+
- doc/rdoc/classes/Wee/FastCGIAdaptor.html
|
264
|
+
- doc/rdoc/classes/Wee/LoginDecoration.html
|
265
|
+
- doc/rdoc/classes/Wee/PagelessComponentDriver.html
|
266
|
+
- doc/rdoc/classes/Wee/AbstractSession.html
|
267
|
+
- doc/rdoc/classes/Wee/HtmlCanvasRenderer.html
|
228
268
|
- doc/rdoc/classes/Wee/Utils/LRUCache.html
|
229
269
|
- doc/rdoc/classes/Wee/Component/OnAnswer.html
|
230
270
|
- doc/rdoc/classes/Wee/StateRegistry/Snapshot.html
|
@@ -254,11 +294,28 @@ files:
|
|
254
294
|
- doc/rdoc/classes/Wee/Brush/JavascriptTag.html
|
255
295
|
- doc/rdoc/classes/Wee/Brush/SelectOptionTag.html
|
256
296
|
- doc/rdoc/classes/Wee/Brush/AnchorTag.html
|
297
|
+
- doc/rdoc/classes/Wee/Brush/RadioButtonTag
|
257
298
|
- doc/rdoc/classes/Wee/Brush/SelectListTag.html
|
258
299
|
- doc/rdoc/classes/Wee/Brush/TextAreaTag.html
|
259
300
|
- doc/rdoc/classes/Wee/Brush/ImageButtonTag.html
|
260
301
|
- doc/rdoc/classes/Wee/Brush/TableRowTag.html
|
302
|
+
- doc/rdoc/classes/Wee/Brush/HiddenInputTag.html
|
303
|
+
- doc/rdoc/classes/Wee/Brush/CheckboxTag.html
|
304
|
+
- doc/rdoc/classes/Wee/Brush/RadioButtonTag.html
|
261
305
|
- doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html
|
306
|
+
- doc/rdoc/classes/Wee/Brush/RadioButtonTag/RadioGroup.html
|
307
|
+
- doc/rdoc/classes/Wee/Nitro/ControllerClassMixin.html
|
308
|
+
- doc/rdoc/classes/Wee/Nitro/ControllerMixin.html
|
309
|
+
- doc/rdoc/classes/Wee/Nitro/FormTag.html
|
310
|
+
- doc/rdoc/classes/Wee/Nitro/HtmlCanvasRenderer.html
|
311
|
+
- doc/rdoc/classes/Wee/Rails/ControllerClassMixin.html
|
312
|
+
- doc/rdoc/classes/Wee/Rails/ControllerMixin.html
|
313
|
+
- doc/rdoc/classes/Wee/Rails/FormTag.html
|
314
|
+
- doc/rdoc/classes/Wee/Rails/HtmlCanvasRenderer.html
|
315
|
+
- doc/rdoc/classes/Wee/Examples/EditableCounter.html
|
316
|
+
- doc/rdoc/classes/Wee/Examples/Calculator.html
|
317
|
+
- doc/rdoc/classes/Wee/Examples/Window.html
|
318
|
+
- doc/rdoc/classes/Wee/Examples/Counter.html
|
262
319
|
- doc/rdoc/classes/OgScaffolder/Editor.html
|
263
320
|
- doc/rdoc/classes/Cache/Strategy
|
264
321
|
- doc/rdoc/classes/Cache/StorageCache.html
|
@@ -273,6 +330,7 @@ files:
|
|
273
330
|
- doc/rdoc/classes/Cache/Strategy/LRU/Item.html
|
274
331
|
- doc/rdoc/classes/Cache/Strategy/Unbounded/Item.html
|
275
332
|
- doc/rdoc/classes/Cache/Strategy/LFU/Item.html
|
333
|
+
- doc/rdoc/classes/ActionView/Base.html
|
276
334
|
- lib/wee
|
277
335
|
- lib/cache
|
278
336
|
- lib/wee.rb
|
@@ -286,10 +344,10 @@ files:
|
|
286
344
|
- lib/wee/renderer
|
287
345
|
- lib/wee/continuation
|
288
346
|
- lib/wee/adaptors
|
347
|
+
- lib/wee/examples
|
289
348
|
- lib/wee/requesthandler.rb
|
290
349
|
- lib/wee/snapshot_ext.rb
|
291
350
|
- lib/wee/session.rb
|
292
|
-
- lib/wee/context.rb
|
293
351
|
- lib/wee/components.rb
|
294
352
|
- lib/wee/request.rb
|
295
353
|
- lib/wee/core.rb
|
@@ -297,9 +355,10 @@ files:
|
|
297
355
|
- lib/wee/response.rb
|
298
356
|
- lib/wee/utils.rb
|
299
357
|
- lib/wee/pageless.rb
|
300
|
-
- lib/wee/template.rb
|
301
|
-
- lib/wee/abstractsession.rb
|
302
358
|
- lib/wee/continuation.rb
|
359
|
+
- lib/wee/core_ext.rb
|
360
|
+
- lib/wee/abstractsession.rb
|
361
|
+
- lib/wee/template.rb
|
303
362
|
- lib/wee/page.rb
|
304
363
|
- lib/wee/skeleton/og
|
305
364
|
- lib/wee/skeleton/simple
|
@@ -315,9 +374,12 @@ files:
|
|
315
374
|
- lib/wee/skeleton/simple/run.rb
|
316
375
|
- lib/wee/skeleton/simple/README
|
317
376
|
- lib/wee/skeleton/simple/components/main.rb
|
318
|
-
- lib/wee/components/
|
377
|
+
- lib/wee/components/login_decoration.rb
|
319
378
|
- lib/wee/components/messagebox.rb
|
379
|
+
- lib/wee/components/pager.rb
|
320
380
|
- lib/wee/components/wrapper_decoration.rb
|
381
|
+
- lib/wee/components/page_decoration.rb
|
382
|
+
- lib/wee/components/component_dispatcher.rb
|
321
383
|
- lib/wee/components/form_decoration.rb
|
322
384
|
- lib/wee/idgen/simple.rb
|
323
385
|
- lib/wee/idgen/md5.rb
|
@@ -330,9 +392,14 @@ files:
|
|
330
392
|
- lib/wee/core/component.rb
|
331
393
|
- lib/wee/core/snapshot.rb
|
332
394
|
- lib/wee/core/decoration.rb
|
395
|
+
- lib/wee/core/context.rb
|
396
|
+
- lib/wee/core/idgen.rb
|
397
|
+
- lib/wee/core/renderer.rb
|
398
|
+
- lib/wee/core/componentrunner.rb
|
333
399
|
- lib/wee/core/presenter.rb
|
334
400
|
- lib/wee/core/valueholder.rb
|
335
401
|
- lib/wee/core/callback.rb
|
402
|
+
- lib/wee/core/page.rb
|
336
403
|
- lib/wee/utils/autoreload.rb
|
337
404
|
- lib/wee/utils/helper.rb
|
338
405
|
- lib/wee/utils/cache.rb
|
@@ -348,6 +415,12 @@ files:
|
|
348
415
|
- lib/wee/continuation/core/component.rb
|
349
416
|
- lib/wee/adaptors/fastcgi.rb
|
350
417
|
- lib/wee/adaptors/webrick.rb
|
418
|
+
- lib/wee/adaptors/rails.rb
|
419
|
+
- lib/wee/adaptors/nitro.rb
|
420
|
+
- lib/wee/examples/calculator.rb
|
421
|
+
- lib/wee/examples/counter.rb
|
422
|
+
- lib/wee/examples/window.rb
|
423
|
+
- lib/wee/examples/editable_counter.rb
|
351
424
|
- lib/cache/cache.rb
|
352
425
|
- bin/wee
|
353
426
|
- benchmark/Centrino1300
|
@@ -363,19 +436,23 @@ files:
|
|
363
436
|
- benchmark/Centrino600/result.2000.counter.render
|
364
437
|
- benchmark/Centrino600/result.2000.filehandler
|
365
438
|
- examples/ajax
|
366
|
-
- examples/
|
439
|
+
- examples/demo
|
440
|
+
- examples/nitro
|
441
|
+
- examples/radio.rb
|
367
442
|
- examples/draw.rb
|
368
443
|
- examples/hw.rb
|
369
|
-
- examples/test.rb
|
370
444
|
- examples/live-update.rb
|
371
|
-
- examples/
|
445
|
+
- examples/test.rb
|
446
|
+
- examples/og-test.rb
|
447
|
+
- examples/demo.rb
|
372
448
|
- examples/cc.rb
|
449
|
+
- examples/dispatcher.rb
|
373
450
|
- examples/ObjectSpaceBrowser.rb
|
374
|
-
- examples/calculator.rb
|
375
|
-
- examples/calendar.rb
|
376
|
-
- examples/example.rb
|
377
451
|
- examples/ajax/ajax.rb
|
378
452
|
- examples/ajax/ajax.js
|
453
|
+
- examples/demo/calendar.rb
|
454
|
+
- examples/demo/example.rb
|
455
|
+
- examples/nitro/run.rb
|
379
456
|
test_files: []
|
380
457
|
rdoc_options: []
|
381
458
|
extra_rdoc_files: []
|