2004-11-23 20:04:44 -05:00
|
|
|
#--
|
2010-01-31 18:10:53 -05:00
|
|
|
# Copyright (c) 2004-2010 David Heinemeier Hansson
|
2004-11-23 20:04:44 -05:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#++
|
|
|
|
|
2009-12-16 12:56:51 -05:00
|
|
|
activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
|
|
|
|
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
|
2010-07-21 05:46:38 -04:00
|
|
|
|
2009-12-20 17:06:40 -05:00
|
|
|
require 'active_support/ruby/shim'
|
2009-12-16 12:56:51 -05:00
|
|
|
require 'active_support/core_ext/class/attribute_accessors'
|
|
|
|
|
|
|
|
require 'action_pack'
|
2009-01-22 17:18:10 -05:00
|
|
|
|
2008-11-23 14:42:07 -05:00
|
|
|
module ActionView
|
2009-12-02 23:01:01 -05:00
|
|
|
extend ActiveSupport::Autoload
|
|
|
|
|
2009-12-22 18:27:37 -05:00
|
|
|
eager_autoload do
|
|
|
|
autoload :Context
|
|
|
|
autoload :Template
|
|
|
|
autoload :Helpers
|
|
|
|
|
|
|
|
autoload_under "render" do
|
2010-03-08 08:46:57 -05:00
|
|
|
autoload :Layouts
|
2009-12-22 18:27:37 -05:00
|
|
|
autoload :Partials
|
|
|
|
autoload :Rendering
|
|
|
|
end
|
|
|
|
|
2010-03-07 09:24:30 -05:00
|
|
|
autoload :Base
|
2010-03-08 15:06:26 -05:00
|
|
|
autoload :LookupContext
|
|
|
|
autoload :Resolver, 'action_view/template/resolver'
|
|
|
|
autoload :PathResolver, 'action_view/template/resolver'
|
|
|
|
autoload :FileSystemResolver, 'action_view/template/resolver'
|
|
|
|
autoload :PathSet, 'action_view/paths'
|
2009-12-22 18:27:37 -05:00
|
|
|
|
2010-03-19 14:49:53 -04:00
|
|
|
autoload :MissingTemplate, 'action_view/template/error'
|
|
|
|
autoload :ActionViewError, 'action_view/template/error'
|
2010-05-17 11:41:54 -04:00
|
|
|
autoload :EncodingError, 'action_view/template/error'
|
|
|
|
autoload :TemplateError, 'action_view/template/error'
|
|
|
|
autoload :WrongEncodingError, 'action_view/template/error'
|
2010-03-19 14:49:53 -04:00
|
|
|
|
2009-12-22 18:27:37 -05:00
|
|
|
autoload :TemplateHandler, 'action_view/template'
|
|
|
|
autoload :TemplateHandlers, 'action_view/template'
|
2008-11-23 14:42:07 -05:00
|
|
|
end
|
2010-01-04 16:59:23 -05:00
|
|
|
|
|
|
|
autoload :TestCase, 'action_view/test_case'
|
2010-05-17 11:41:54 -04:00
|
|
|
|
|
|
|
ENCODING_FLAG = '#.*coding[:=]\s*(\S+)[ \t]*'
|
2008-11-23 14:42:07 -05:00
|
|
|
end
|
2008-01-21 15:45:04 -05:00
|
|
|
|
2010-03-10 16:11:48 -05:00
|
|
|
require 'active_support/i18n'
|
For performance reasons, you can no longer call html_safe! on Strings. Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self).
* Additionally, instead of doing concat("</form>".html_safe), you can do
safe_concat("</form>"), which will skip both the flag set, and the flag
check.
* For the first pass, I converted virtually all #html_safe!s to #html_safe,
and the tests pass. A further optimization would be to try to use
#safe_concat as much as possible, reducing the performance impact if
we know up front that a String is safe.
2010-01-31 22:17:42 -05:00
|
|
|
require 'active_support/core_ext/string/output_safety'
|
2009-10-07 16:31:20 -04:00
|
|
|
|
2008-11-18 03:59:46 -05:00
|
|
|
I18n.load_path << "#{File.dirname(__FILE__)}/action_view/locale/en.yml"
|