aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/handlers/erb.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-25 14:23:03 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-25 14:32:15 -0700
commit8ee60660cec54f008ddaa54a4e8e06d099d8c7f5 (patch)
tree245f0b32314a3f10bf573642f398f539504ff656 /actionpack/lib/action_view/template/handlers/erb.rb
parentc117e8e848f2743bd9b346ccdc0e41e5987699cf (diff)
downloadrails-8ee60660cec54f008ddaa54a4e8e06d099d8c7f5.tar.gz
rails-8ee60660cec54f008ddaa54a4e8e06d099d8c7f5.tar.bz2
rails-8ee60660cec54f008ddaa54a4e8e06d099d8c7f5.zip
Try speeding up rails booting
Diffstat (limited to 'actionpack/lib/action_view/template/handlers/erb.rb')
-rw-r--r--actionpack/lib/action_view/template/handlers/erb.rb3
1 files changed, 2 insertions, 1 deletions
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