Flowdock
method

detect_magic_comment

Importance_0
detect_magic_comment(s) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# 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)/, '')
          enc = Encoding.find(enc)
        end
      end
    end
Register or log in to add new notes.