# File lib/ferret/browser.rb, line 10 def run(env) controller, action, args = :home, :index, nil query_string = env['QUERY_STRING']||'' params = parse_query_string(query_string) req_path = env['PATH_INFO'].gsub(/\/+/, '/') case req_path when '/' # nothing to do when /^\/?([-a-zA-Z]+)\/?$/ controller = $1 when /^\/?([-a-zA-Z]+)\/([-a-zA-Z]+)\/?(.*)?$/ controller = $1 action = $2 args = $3 else controller = :error args = req_path end controller_vars = { :params => params, :req_path => req_path, :query_string => query_string, } delegate(controller, action, args, controller_vars) end
Generated with the Darkfish Rdoc Generator 2.