Class: Padrino::Rendering::SafeERB

Inherits:
ERB
  • Object
show all
Defined in:
lib/padrino/rendering/erb_template.rb

Defined Under Namespace

Classes: Compiler

Instance Method Summary collapse

Instance Method Details

#make_compiler(trim_mode) ⇒ Object



12
13
14
# File 'lib/padrino/rendering/erb_template.rb', line 12

def make_compiler(trim_mode)
  Compiler.new(trim_mode)
end

#set_eoutvar(compiler, eoutvar = '_erbout') ⇒ Object



16
17
18
19
20
21
# File 'lib/padrino/rendering/erb_template.rb', line 16

def set_eoutvar(compiler, eoutvar = '_erbout')
  compiler.put_cmd = "#{eoutvar}.safe_concat"
  compiler.insert_cmd = "#{eoutvar}.concat"
  compiler.pre_cmd = ["#{eoutvar} = SafeBuffer.new"]
  compiler.post_cmd = ["#{eoutvar}.force_encoding(__ENCODING__)"]
end