class Tilt::ERBTemplate

def self.default_output_variable

def self.default_output_variable
  @@default_output_variable
end

def self.default_output_variable=(name)

def self.default_output_variable=(name)
  warn "#{self}.default_output_variable= has been replaced with the :outvar-option"
  @@default_output_variable = name
end

def precompiled(locals)

def precompiled(locals)
  source, offset = super
  [source, offset + 1]
end

def precompiled_postamble(locals)

def precompiled_postamble(locals)
  <<-RUBY
      #{super}
    ensure
      #{@outvar} = __original_outvar
    end
  RUBY
end

def precompiled_preamble(locals)

def precompiled_preamble(locals)
  <<-RUBY
    begin
      __original_outvar = #{@outvar} if defined?(#{@outvar})
      #{super}
  RUBY
end

def precompiled_template(locals)

def precompiled_template(locals)
  source = @engine.src
  source
end

def prepare

def prepare
  @outvar = options[:outvar] || self.class.default_output_variable
  options[:trim] = '<>' if !(options[:trim] == false) && (options[:trim].nil? || options[:trim] == true)
  @engine = if SUPPORTS_KVARGS
    ::ERB.new(data, trim_mode: options[:trim], eoutvar: @outvar)
  else
    ::ERB.new(data, options[:safe], options[:trim], @outvar)
  end
end