Module: Haml::Filters::ERB
- Includes:
- Base
- Defined in:
- /var/www/haml-pages/.haml/lib/haml/filters.rb
Overview
Parses the filtered text with ERB. Not available if the :suppress_eval option is set to true. Embedded Ruby code is evaluated in the same context as the Haml template.
Instance Method Summary
Methods included from Base
included, #internal_compile, #lazy_require, #render, #render_with_options
Instance Method Details
- compile(precompiler, text)
314 315 316 317 318 319 |
# File '/var/www/haml-pages/.haml/lib/haml/filters.rb', line 314
def compile(precompiler, text)
return if precompiler.options[:suppress_eval]
src = ::ERB.new(text).src.sub(/^#coding:.*?\n/, '').
sub(/^_erbout = '';/, "")
precompiler.send(:push_silent, src)
end
|