From b1201792a79a526776967864ed9b9132519ecd9b Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Thu, 15 Oct 2009 17:54:01 +1300 Subject: Make the erubis implementation easier for plugins to change. --- actionpack/lib/action_view/template/handlers/erb.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/template') diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb index a780ab8d85..8993dd2b35 100644 --- a/actionpack/lib/action_view/template/handlers/erb.rb +++ b/actionpack/lib/action_view/template/handlers/erb.rb @@ -37,11 +37,14 @@ module ActionView self.erb_trim_mode = '-' self.default_format = Mime::HTML + + cattr_accessor :erubis_implementation + self.erubis_implementation = Erubis def compile(template) magic = $1 if template.source =~ /\A(<%#.*coding[:=]\s*(\S+)\s*-?%>)/ erb = "#{magic}<% __in_erb_template=true %>#{template.source}" - Erubis.new(erb, :trim=>(self.class.erb_trim_mode == "-")).src + self.class.erubis_implementation.new(erb, :trim=>(self.class.erb_trim_mode == "-")).src end end end -- cgit v1.2.3