Pull buffer assignment up

Since everything goes through a `run` method, we can pull the buffer
assignment up.
上级 c740ebda
......@@ -212,6 +212,7 @@ def initialize(context = nil, assigns = {}, controller = nil, formats = nil) #:n
def run(method, locals, buffer, &block)
_old_output_buffer = @output_buffer
@output_buffer = buffer
send(method, locals, buffer, &block)
ensure
@output_buffer = _old_output_buffer
......
......@@ -13,7 +13,7 @@ def initialize(input, properties = {})
# Dup properties so that we don't modify argument
properties = Hash[properties]
properties[:preamble] = "@output_buffer = output_buffer;"
properties[:preamble] = ""
properties[:postamble] = "@output_buffer.to_s"
properties[:bufvar] = "@output_buffer"
properties[:escapefunc] = ""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册