Parent

Namespace

Files

HttpRouter

HttpRouter adapter

@private

Public Instance Methods

process_destination_path(path, env) click to toggle source
# File lib/padrino-core/application/routing.rb, line 24
def process_destination_path(path, env)
  Thread.current['padrino.instance'].instance_eval do
    request.route_obj = path.route
    @_response_buffer = nil
    @route    = path.route
    @params ||= {}
    @params.update(env['router.params'])
    @block_params = if path.route.is_a?(HttpRouter::RegexRoute)
      params_list = env['router.request'].extra_env['router.regex_match'].to_a
      params_list.shift
      @params[:captures] = params_list
      params_list
    else
      env['router.request'].params
    end
    # Provide access to the current controller to the request
    # Now we can eval route, but because we have "throw halt" we need to be
    # (en)sure to reset old layout and run controller after filters.
    original_params = @params
    parent_layout   = @layout
    successful      = false
    begin
      filter! :before
      (@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
      @layout = path.route.use_layout if path.route.use_layout
      @route.custom_conditions.each { |block| pass if block.bind(self).call == false } if @route.custom_conditions
      @block_params     = @block_params[0, @route.dest.arity] if @route.dest.arity > 0
      halt_response     = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
      @_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
      successful        = true
      halt halt_response
    ensure
      (@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
      @layout = parent_layout
      @params = original_params
    end
  end
end
rewrite_partial_path_info(env, request) click to toggle source
# File lib/padrino-core/application/routing.rb, line 21
def rewrite_partial_path_info(env, request); end
rewrite_path_info(env, request) click to toggle source
# File lib/padrino-core/application/routing.rb, line 22
def rewrite_path_info(env, request); end

[Validate]

Generated with the Darkfish Rdoc Generator 2.