method
detect_magic_comment
v1_9_3_392 -
Show latest stable
- Class:
ERB::Compiler
detect_magic_comment(s)private
No documentation available.
# File lib/erb.rb, line 702
def detect_magic_comment(s)
if /\A<%#(.*)%>/ =~ s or (@percent and /\A%#(.*)/ =~ s)
comment = $1
comment = $1 if comment[/-\*-\s*(.*?)\s*-*-$/]
if %coding\s*[=:]\s*([[:alnum:]\-_]+)" =~ comment
enc = $1.sub(/-(?:mac|dos|unix)/, '')
enc = Encoding.find(enc)
end
end
end