diff --git a/lib/haml/engine.rb b/lib/haml/engine.rb index 6cbbdfad..4b0e3a39 100644 --- a/lib/haml/engine.rb +++ b/lib/haml/engine.rb @@ -1,6 +1,5 @@ require File.dirname(__FILE__) + '/helpers' require File.dirname(__FILE__) + '/buffer' -require 'profiler' module Haml # This is the class where all the parsing and processing of the HAML @@ -75,7 +74,7 @@ module Haml # Processes the template and returns the resulting (X)HTML code as # a string. def to_html(scope = Object.new) - @scope = scope + @scope_object = scope # Compile the @precompiled buffer compile diff --git a/lib/haml/template.rb b/lib/haml/template.rb index 2d873c8f..a73245de 100644 --- a/lib/haml/template.rb +++ b/lib/haml/template.rb @@ -26,7 +26,7 @@ module Haml end # Set all the local assigns local_assigns.each do |key,val| - class << self; self; end.send(:define_method, key) &:val + self.class.send(:define_method, key) { val } end end