diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-28 17:12:28 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-28 17:12:48 -0500 |
commit | 5ec2c7dc29b36d85b2658465b8a979deb0529d7e (patch) | |
tree | 33c3ee6bbd8fbdc53492cd0b6b9fd6ad6121be36 /actionpack/lib/action_view/template/handlers | |
parent | e23554d79e2db2324144f3ab58f82a895b93fbf5 (diff) | |
download | rails-5ec2c7dc29b36d85b2658465b8a979deb0529d7e.tar.gz rails-5ec2c7dc29b36d85b2658465b8a979deb0529d7e.tar.bz2 rails-5ec2c7dc29b36d85b2658465b8a979deb0529d7e.zip |
Ruby 1.9: ERB template encoding using a magic comment at the top of the file
Diffstat (limited to 'actionpack/lib/action_view/template/handlers')
-rw-r--r-- | actionpack/lib/action_view/template/handlers/erb.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb index 95f11d6490..d773df7d29 100644 --- a/actionpack/lib/action_view/template/handlers/erb.rb +++ b/actionpack/lib/action_view/template/handlers/erb.rb @@ -16,11 +16,7 @@ module ActionView self.default_format = Mime::HTML def compile(template) - src = ::ERB.new("<% __in_erb_template=true %>#{template.source}", nil, erb_trim_mode, '@output_buffer').src - - # Ruby 1.9 prepends an encoding to the source. However this is - # useless because you can only set an encoding on the first line - RUBY_VERSION >= '1.9' ? src.sub(/\A#coding:.*\n/, '') : src + ::ERB.new("<% __in_erb_template=true %>#{template.source}", nil, erb_trim_mode, '@output_buffer').src end end end |