Module: Haml::Filters::ERB

Includes:
Base
Defined in:
lib/haml/filters.rb

Instance Method Summary collapse

Methods included from Base

included, #internal_compile, #lazy_require, #render, #render_with_options

Instance Method Details

#compile(precompiler, text) ⇒ Object



226
227
228
229
230
231
# File 'lib/haml/filters.rb', line 226

def compile(precompiler, text)
  return if precompiler.options[:suppress_eval]
  src = ::ERB.new(text).src.sub(/^#coding:.*?\n/, '').
    sub(/^_erbout = '';/, "").gsub("\n", ';')
  precompiler.send(:push_silent, src)
end