1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Eval using block.binding rather than just block for 1.9 compatibility.

This commit is contained in:
Nathan Weizenbaum 2009-01-22 14:42:10 -08:00
parent 8e1b40e31f
commit 530d226ff6

View file

@ -254,7 +254,7 @@ module Haml
# the local variable <tt>foo</tt> would be assigned to "<p>13</p>\n".
#
def capture_haml(*args, &block)
buffer = eval('_hamlout', block) rescue haml_buffer
buffer = eval('_hamlout', block.binding) rescue haml_buffer
with_haml_buffer(buffer) do
position = haml_buffer.buffer.length
@ -412,7 +412,7 @@ END
# Returns whether or not +block+ is defined directly in a Haml template.
def block_is_haml?(block)
eval('_hamlout', block)
eval('_hamlout', block.binding)
true
rescue
false