From 8ee60660cec54f008ddaa54a4e8e06d099d8c7f5 Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Thu, 25 Jun 2009 14:23:03 -0700 Subject: Try speeding up rails booting --- actionpack/lib/action_view/template/handlers/erb.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/template/handlers/erb.rb') 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 -- cgit v1.2.3