diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-25 14:23:03 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-25 14:32:15 -0700 |
commit | 8ee60660cec54f008ddaa54a4e8e06d099d8c7f5 (patch) | |
tree | 245f0b32314a3f10bf573642f398f539504ff656 /actionpack | |
parent | c117e8e848f2743bd9b346ccdc0e41e5987699cf (diff) | |
download | rails-8ee60660cec54f008ddaa54a4e8e06d099d8c7f5.tar.gz rails-8ee60660cec54f008ddaa54a4e8e06d099d8c7f5.tar.bz2 rails-8ee60660cec54f008ddaa54a4e8e06d099d8c7f5.zip |
Try speeding up rails booting
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/template/handlers/builder.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/handlers/erb.rb | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/template/handlers/builder.rb b/actionpack/lib/action_view/template/handlers/builder.rb index abe140af0b..5f381f7bf0 100644 --- a/actionpack/lib/action_view/template/handlers/builder.rb +++ b/actionpack/lib/action_view/template/handlers/builder.rb @@ -1,5 +1,3 @@ -require 'builder' - module ActionView module TemplateHandlers class Builder < TemplateHandler @@ -8,6 +6,7 @@ module ActionView self.default_format = Mime::XML def compile(template) + require 'builder' "xml = ::Builder::XmlMarkup.new(:indent => 2);" + "self.output_buffer = xml.target!;" + template.source + diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb index 21272ef089..e3a7d96941 100644 --- a/actionpack/lib/action_view/template/handlers/erb.rb +++ b/actionpack/lib/action_view/template/handlers/erb.rb @@ -1,4 +1,3 @@ -require 'erb' require 'active_support/core_ext/class/attribute_accessors' module ActionView @@ -16,6 +15,8 @@ module ActionView self.default_format = Mime::HTML def compile(template) + require 'erb' + magic = $1 if template.source =~ /\A(<%#.*coding:\s*(\S+)\s*-?%>)/ erb = "#{magic}<% __in_erb_template=true %>#{template.source}" ::ERB.new(erb, nil, erb_trim_mode, '@output_buffer').src |