action_view.rb 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #--
  2. # Copyright (c) 2004-2011 David Heinemeier Hansson
  3. #
  4. # Permission is hereby granted, free of charge, to any person obtaining
  5. # a copy of this software and associated documentation files (the
  6. # "Software"), to deal in the Software without restriction, including
  7. # without limitation the rights to use, copy, modify, merge, publish,
  8. # distribute, sublicense, and/or sell copies of the Software, and to
  9. # permit persons to whom the Software is furnished to do so, subject to
  10. # the following conditions:
  11. #
  12. # The above copyright notice and this permission notice shall be
  13. # included in all copies or substantial portions of the Software.
  14. #
  15. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18. # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  19. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  20. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  21. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. #++
  23. require 'active_support/ruby/shim'
  24. require 'active_support/core_ext/class/attribute_accessors'
  25. require 'action_pack'
  26. module ActionView
  27. extend ActiveSupport::Autoload
  28. eager_autoload do
  29. autoload :AssetPaths
  30. autoload :Base
  31. autoload :Context
  32. autoload :CompiledTemplates, "action_view/context"
  33. autoload :Helpers
  34. autoload :LookupContext
  35. autoload :PathSet
  36. autoload :Template
  37. autoload :TestCase
  38. autoload_under "renderer" do
  39. autoload :Renderer
  40. autoload :AbstractRenderer
  41. autoload :PartialRenderer
  42. autoload :TemplateRenderer
  43. autoload :StreamingTemplateRenderer
  44. end
  45. autoload_at "action_view/template/resolver" do
  46. autoload :Resolver
  47. autoload :PathResolver
  48. autoload :FileSystemResolver
  49. autoload :OptimizedFileSystemResolver
  50. autoload :FallbackFileSystemResolver
  51. end
  52. autoload_at "action_view/buffers" do
  53. autoload :OutputBuffer
  54. autoload :StreamingBuffer
  55. end
  56. autoload_at "action_view/flows" do
  57. autoload :OutputFlow
  58. autoload :StreamingFlow
  59. end
  60. autoload_at "action_view/template/error" do
  61. autoload :MissingTemplate
  62. autoload :ActionViewError
  63. autoload :EncodingError
  64. autoload :TemplateError
  65. autoload :WrongEncodingError
  66. end
  67. end
  68. ENCODING_FLAG = '#.*coding[:=]\s*(\S+)[ \t]*'
  69. end
  70. require 'active_support/i18n'
  71. require 'active_support/core_ext/string/output_safety'
  72. I18n.load_path << "#{File.dirname(__FILE__)}/action_view/locale/en.yml"