Class | Erubis::Eperl |
In: |
erubis/engine/eperl.rb
|
Parent: | Engine |
engine for Perl
# File erubis/engine/eperl.rb, line 25 def initialize(input, properties={}) @func = properties[:func] || 'print' super end
# File erubis/engine/eperl.rb, line 55 def add_expr_debug(src, code) code.strip! s = code.gsub(/\'/, "\\'") src << @func << "('*** debug: #{code}=', #{code}, \"\\n\");" end
# File erubis/engine/eperl.rb, line 51 def add_expr_escaped(src, code) src << @func << "(" << escaped_expr(code) << "); " end
# File erubis/engine/eperl.rb, line 47 def add_expr_literal(src, code) src << @func << "(" << code.strip << "); " end
# File erubis/engine/eperl.rb, line 38 def add_text(src, text) src << @func << "('" << escape_text(text) << "'); " unless text.empty? end
# File erubis/engine/eperl.rb, line 34 def escape_text(text) return text.gsub!(/['\\]/, '\\\\\&') || text end