method

detect_magic_comment

v2_2_9 - Show latest stable - Class: ERB::Compiler
detect_magic_comment(s)
private

No documentation available.

# File lib/erb.rb, line 713
    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)/, '')
          Encoding.find(enc)
        end
      end
    end