action_dispatch.rb 2.9 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

J
José Valim 已提交
27 28 29
activemodel_path = File.expand_path('../../../activemodel/lib', __FILE__)
$:.unshift(activemodel_path) if File.directory?(activemodel_path) && !$:.include?(activemodel_path)

30
require 'active_support'
31
require 'active_support/dependencies/autoload'
32

33 34
require 'action_pack'
require 'active_model'
J
Joshua Peek 已提交
35
require 'rack'
36

J
Joshua Peek 已提交
37 38 39
module Rack
  autoload :Test, 'rack/test'
end
40

41
module ActionDispatch
C
Carlhuda 已提交
42
  extend ActiveSupport::Autoload
43

J
Joshua Peek 已提交
44 45 46 47
  autoload_under 'http' do
    autoload :Request
    autoload :Response
  end
J
Joshua Peek 已提交
48

J
Joshua Peek 已提交
49 50
  autoload_under 'middleware' do
    autoload :Callbacks
J
Joshua Peek 已提交
51
    autoload :Cookies
J
Joshua Peek 已提交
52
    autoload :Flash
53
    autoload :Head
J
Joshua Peek 已提交
54
    autoload :ParamsParser
C
Carlhuda 已提交
55
    autoload :RemoteIp
J
Joshua Peek 已提交
56 57 58 59
    autoload :Rescue
    autoload :ShowExceptions
    autoload :Static
  end
J
Joshua Peek 已提交
60

J
Joshua Peek 已提交
61 62
  autoload :MiddlewareStack, 'action_dispatch/middleware/stack'
  autoload :Routing
63

J
Joshua Peek 已提交
64
  module Http
65 66 67 68 69 70
    extend ActiveSupport::Autoload

    autoload :Cache
    autoload :Headers
    autoload :MimeNegotiation
    autoload :Parameters
71
    autoload :ParameterFilter
72
    autoload :FilterParameters
73 74 75
    autoload :Upload
    autoload :UploadedFile, 'action_dispatch/http/upload'
    autoload :URL
J
Joshua Peek 已提交
76
  end
77

J
Joshua Peek 已提交
78 79 80 81 82
  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 已提交
83

J
Joshua Peek 已提交
84 85 86 87 88 89 90
  autoload_under 'testing' do
    autoload :Assertions
    autoload :Integration
    autoload :PerformanceTest
    autoload :TestProcess
    autoload :TestRequest
    autoload :TestResponse
91 92 93 94
  end
end

autoload :Mime, 'action_dispatch/http/mime_type'