Module: Erubis::PercentLineEnhancer
Overview
regards lines starting with ‘%’ as program code
this is for compatibility to eruby and ERB.
this is language-independent.
Class Method Summary collapse
-
.desc ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#add_text(src, text) ⇒ Object
– def init_generator(properties={}) super @prefixchar = ‘%’ @prefixrexp = /^%(.*?r?n)/ end ++.
Methods included from PrefixedLineEnhancer
Class Method Details
.desc ⇒ Object
:nodoc:
504 505 506 |
# File 'lib/erubis/enhancer.rb', line 504 def self.desc # :nodoc: "regard lines starting with '%' as program code" end |
Instance Method Details
#add_text(src, text) ⇒ Object
– def init_generator(properties={})
super
@prefixchar = '%'
@prefixrexp = /^\%(.*?\r?\n)/
end ++
516 517 518 519 520 521 522 |
# File 'lib/erubis/enhancer.rb', line 516 def add_text(src, text) unless @prefixrexp @prefixchar = '%' @prefixrexp = /^\%(.*?\r?\n)/ end super(src, text) end |