Permalink
Browse files

Pass outvar through to erubis for output buffer name

  • Loading branch information...
nesquena committed Feb 22, 2011
1 parent fe04954 commit 623811e72df0bc20f3e9d6925241927ff76b6f2c
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/tilt.rb
View
@@ -446,19 +446,19 @@ def initialize_engine
end
def prepare
@options.merge!(:preamble => false, :postamble => false)
@outvar = options.delete(:outvar) || self.class.default_output_variable
@options.merge!(:preamble => false, :postamble => false, :bufname => @outvar)
engine_class = options.delete(:engine_class)
engine_class = ::Erubis::EscapedEruby if options.delete(:escape_html)
@engine = (engine_class || ::Erubis::Eruby).new(data, options)
end
def precompiled_preamble(locals)
[super, "#{@outvar} = _buf = ''"].join("\n")
[super, "#{@outvar} = ''"].join("\n")
end
def precompiled_postamble(locals)
["_buf", super].join("\n")
[@outvar, super].join("\n")
end
# Erubis doesn't have ERB's line-off-by-one under 1.9 problem.

0 comments on commit 623811e

Please sign in to comment.