Flowdock
method

detect_magic_comment

Importance_0
v1_9_3_125 - Show latest stable - 0 notes - Class: ERB::Compiler
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 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
Register or log in to add new notes.