Module: Erubis::FastEnhancer

Included in:
FastEruby, FastXmlEruby
Defined in:
lib/erubis.rb

Overview

make Eruby faster

Instance Method Summary collapse

Instance Method Details

#add_src_text(src, text) ⇒ Object



198
199
200
201
202
203
204
205
# File 'lib/erubis.rb', line 198

def add_src_text(src, text)
  return if text.empty?
  #src << "_out << #{text.dump}" << (text[-1] == ?\n ? "\n" : "; ")
  src << "_out << #{text.dump}"
  n = text.count("\n")
  src << ("\n" * n)
  src << "; " if n == 0
end