Class: ERB::Compiler::SimpleScanner

Inherits:
Scanner
  • Object
show all
Defined in:
lib/sinarey_support/erb/html_safe.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#scanObject



147
148
149
150
151
152
153
154
# File 'lib/sinarey_support/erb/html_safe.rb', line 147

def scan
  @src.scan(/(.*?)(<%%|%%>|<%==|<%=|<%#|<%|%>|\n|\z)/m) do |tokens|
    tokens.each do |token|
      next if token.empty?
      yield(token)
    end
  end
end