aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2009-10-15 17:54:01 +1300
committerMichael Koziarski <michael@koziarski.com>2009-10-15 17:54:01 +1300
commitb1201792a79a526776967864ed9b9132519ecd9b (patch)
tree3216c38b8bd75f5733b4b1fa63dcc5a6d2fd81d4 /actionpack
parentcc1ad46eadfad2c617d897927eb4bc0c36e1d033 (diff)
downloadrails-b1201792a79a526776967864ed9b9132519ecd9b.tar.gz
rails-b1201792a79a526776967864ed9b9132519ecd9b.tar.bz2
rails-b1201792a79a526776967864ed9b9132519ecd9b.zip
Make the erubis implementation easier for plugins to change.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/template/handlers/erb.rb5
1 files changed, 4 insertions, 1 deletions
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