aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template.rb
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2011-12-24 15:57:54 +0300
committerSergey Nartimov <just.lest@gmail.com>2011-12-24 15:57:54 +0300
commit5ca86ac8f924b333a5a01a47cc07cbcf39c16e80 (patch)
treeda7a9a4d9cd8ad05648bde5d283715d5feea4d81 /actionpack/lib/action_view/template.rb
parenta5fa310f406e299a1ac54d1a227bde93b7ce282b (diff)
downloadrails-5ca86ac8f924b333a5a01a47cc07cbcf39c16e80.tar.gz
rails-5ca86ac8f924b333a5a01a47cc07cbcf39c16e80.tar.bz2
rails-5ca86ac8f924b333a5a01a47cc07cbcf39c16e80.zip
deprecate String#encoding_aware? and remove its usage
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r--actionpack/lib/action_view/template.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index eac6287b0b..2d9fc3df7a 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -184,7 +184,7 @@ module ActionView
# before passing the source on to the template engine, leaving a
# blank line in its stead.
def encode!
- return unless source.encoding_aware? && source.encoding == Encoding::BINARY
+ return unless source.encoding == Encoding::BINARY
# Look for # encoding: *. If we find one, we'll encode the
# String in that encoding, otherwise, we'll use the
@@ -265,20 +265,18 @@ module ActionView
end
end_src
- if source.encoding_aware?
- # Make sure the source is in the encoding of the returned code
- source.force_encoding(code.encoding)
+ # Make sure the source is in the encoding of the returned code
+ source.force_encoding(code.encoding)
- # In case we get back a String from a handler that is not in
- # BINARY or the default_internal, encode it to the default_internal
- source.encode!
+ # In case we get back a String from a handler that is not in
+ # BINARY or the default_internal, encode it to the default_internal
+ source.encode!
- # Now, validate that the source we got back from the template
- # handler is valid in the default_internal. This is for handlers
- # that handle encoding but screw up
- unless source.valid_encoding?
- raise WrongEncodingError.new(@source, Encoding.default_internal)
- end
+ # Now, validate that the source we got back from the template
+ # handler is valid in the default_internal. This is for handlers
+ # that handle encoding but screw up
+ unless source.valid_encoding?
+ raise WrongEncodingError.new(@source, Encoding.default_internal)
end
begin