action_dispatch.rb 2.7 KB
Newer Older
1
#--
2
# Copyright (c) 2004-2010 David Heinemeier Hansson
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

24 25
activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
26

27
require 'active_support'
28
require 'active_support/dependencies/autoload'
29

J
Joshua Peek 已提交
30
require 'rack'
31

J
Joshua Peek 已提交
32 33 34
module Rack
  autoload :Test, 'rack/test'
end
35

36
module ActionDispatch
C
Carlhuda 已提交
37
  extend ActiveSupport::Autoload
38

J
Joshua Peek 已提交
39 40 41 42
  autoload_under 'http' do
    autoload :Request
    autoload :Response
  end
J
Joshua Peek 已提交
43

J
Joshua Peek 已提交
44 45
  autoload_under 'middleware' do
    autoload :Callbacks
J
Joshua Peek 已提交
46
    autoload :Cookies
J
Joshua Peek 已提交
47
    autoload :Flash
48
    autoload :Head
J
Joshua Peek 已提交
49
    autoload :ParamsParser
C
Carlhuda 已提交
50
    autoload :RemoteIp
J
Joshua Peek 已提交
51 52 53 54
    autoload :Rescue
    autoload :ShowExceptions
    autoload :Static
  end
J
Joshua Peek 已提交
55

J
Joshua Peek 已提交
56 57
  autoload :MiddlewareStack, 'action_dispatch/middleware/stack'
  autoload :Routing
58

J
Joshua Peek 已提交
59
  module Http
60 61 62 63 64 65
    extend ActiveSupport::Autoload

    autoload :Cache
    autoload :Headers
    autoload :MimeNegotiation
    autoload :Parameters
66
    autoload :ParameterFilter
67
    autoload :FilterParameters
68 69 70
    autoload :Upload
    autoload :UploadedFile, 'action_dispatch/http/upload'
    autoload :URL
J
Joshua Peek 已提交
71
  end
72

J
Joshua Peek 已提交
73 74 75 76 77
  module Session
    autoload :AbstractStore, 'action_dispatch/middleware/session/abstract_store'
    autoload :CookieStore,   'action_dispatch/middleware/session/cookie_store'
    autoload :MemCacheStore, 'action_dispatch/middleware/session/mem_cache_store'
  end
C
Carlhuda 已提交
78

J
Joshua Peek 已提交
79 80 81 82 83 84 85
  autoload_under 'testing' do
    autoload :Assertions
    autoload :Integration
    autoload :PerformanceTest
    autoload :TestProcess
    autoload :TestRequest
    autoload :TestResponse
86 87 88 89
  end
end

autoload :Mime, 'action_dispatch/http/mime_type'