154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
# File 'lib/wunderbar/sinatra.rb', line 154
def evaluate(scope, locals, &block)
builder = TextBuilder.new(scope)
begin
result = _evaluate_safely(builder, scope, locals, &block)
builder._ result.to_s if builder.target!.empty? and result
scope.response.status = 404 if builder.target!.empty?
rescue Exception => exception
scope.['Content-Type'] = self.class.default_mime_type
scope.response.status = 500
builder._exception exception
end
builder.target!
end
|