action_dispatch.rb 3.0 KB
Newer Older
1
#--
2
# Copyright (c) 2004-2012 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
require 'active_support'
25
require 'active_support/rails'
26
require 'active_support/core_ext/module/attribute_accessors'
27

28 29
require 'action_pack'
require 'active_model'
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

39 40 41
  class IllegalStateError < StandardError
  end

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

J
Joshua Peek 已提交
47
  autoload_under 'middleware' do
48
    autoload :RequestId
49
    autoload :BestStandardsSupport
J
Joshua Peek 已提交
50
    autoload :Callbacks
J
Joshua Peek 已提交
51
    autoload :Cookies
52
    autoload :DebugExceptions
53
    autoload :ExceptionWrapper
J
Joshua Peek 已提交
54
    autoload :Flash
55
    autoload :Head
J
Joshua Peek 已提交
56
    autoload :ParamsParser
57
    autoload :PublicExceptions
58
    autoload :Reloader
C
Carlhuda 已提交
59
    autoload :RemoteIp
J
Joshua Peek 已提交
60
    autoload :ShowExceptions
61
    autoload :SSL
J
Joshua Peek 已提交
62 63
    autoload :Static
  end
J
Joshua Peek 已提交
64

J
Joshua Peek 已提交
65 66
  autoload :MiddlewareStack, 'action_dispatch/middleware/stack'
  autoload :Routing
67

J
Joshua Peek 已提交
68
  module Http
69 70 71 72 73 74
    extend ActiveSupport::Autoload

    autoload :Cache
    autoload :Headers
    autoload :MimeNegotiation
    autoload :Parameters
75
    autoload :ParameterFilter
76
    autoload :FilterParameters
77 78 79
    autoload :Upload
    autoload :UploadedFile, 'action_dispatch/http/upload'
    autoload :URL
J
Joshua Peek 已提交
80
  end
81

J
Joshua Peek 已提交
82 83 84 85
  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'
86
    autoload :CacheStore,    'action_dispatch/middleware/session/cache_store'
J
Joshua Peek 已提交
87
  end
C
Carlhuda 已提交
88

89 90
  mattr_accessor :test_app

J
Joshua Peek 已提交
91 92 93
  autoload_under 'testing' do
    autoload :Assertions
    autoload :Integration
94
    autoload :IntegrationTest, 'action_dispatch/testing/integration'
J
Joshua Peek 已提交
95 96 97 98
    autoload :PerformanceTest
    autoload :TestProcess
    autoload :TestRequest
    autoload :TestResponse
99 100 101 102
  end
end

autoload :Mime, 'action_dispatch/http/mime_type'