Methods
Constants
ENCODING_TAG | = | Regexp.new("\\A(<%#{ENCODING_FLAG}-?%>)[ \\t]*") |
Class Public methods
Instance Public methods
# File actionpack/lib/action_view/template/handlers/erb.rb, line 65 65: def call(template) 66: if template.source.encoding_aware? 67: # First, convert to BINARY, so in case the encoding is 68: # wrong, we can still find an encoding tag 69: # (<%# encoding %>) inside the String using a regular 70: # expression 71: template_source = template.source.dup.force_encoding("BINARY") 72: 73: erb = template_source.gsub(ENCODING_TAG, '') 74: encoding = $2 75: 76: erb.force_encoding valid_encoding(template.source.dup, encoding) 77: 78: # Always make sure we return a String in the default_internal 79: erb.encode! 80: else 81: erb = template.source.dup 82: end 83: 84: self.class.erb_implementation.new( 85: erb, 86: :trim => (self.class.erb_trim_mode == "-") 87: ).src 88: end