lib/deas/route.rb in deas-0.24.0 vs lib/deas/route.rb in deas-0.24.1

- old
+ new

@@ -1,8 +1,9 @@ require 'deas/sinatra_runner' module Deas + class Route attr_reader :method, :path, :handler_proxy, :handler_class def initialize(method, path, handler_proxy) @@ -13,16 +14,18 @@ @handler_class = @handler_proxy.handler_class end # TODO: unit test this?? def run(sinatra_call) + runner = Deas::SinatraRunner.new(self.handler_class, sinatra_call) sinatra_call.request.env.tap do |env| - env['sinatra.params'] = sinatra_call.params + env['deas.params'] = runner.params env['deas.handler_class_name'] = self.handler_class.name env['deas.logging'].call " Handler: #{env['deas.handler_class_name']}" - env['deas.logging'].call " Params: #{env['sinatra.params'].inspect}" + env['deas.logging'].call " Params: #{env['deas.params'].inspect}" end - Deas::SinatraRunner.run(self.handler_class, sinatra_call) + runner.run end end + end