From 92bff2ebf122252cf3ff64160bdfa9891fcff3f4 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 1 Jul 2009 16:25:33 -0700 Subject: Fix pattern to match various magic comment formats --- actionpack/lib/action_view/template/handlers/erb.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb index e3a7d96941..aab7baf442 100644 --- a/actionpack/lib/action_view/template/handlers/erb.rb +++ b/actionpack/lib/action_view/template/handlers/erb.rb @@ -17,7 +17,7 @@ module ActionView def compile(template) require 'erb' - magic = $1 if template.source =~ /\A(<%#.*coding:\s*(\S+)\s*-?%>)/ + 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 end -- cgit v1.2.3