diff --git a/lib/haml/template.rb b/lib/haml/template.rb index 6ad7d653..4c27df44 100644 --- a/lib/haml/template.rb +++ b/lib/haml/template.rb @@ -46,9 +46,7 @@ module Haml # with local_assigns available as local variables within the template. # Returns the result as a string. def render(template, local_assigns={}) - @view.instance_eval do - evaluate_assigns - end + @view.send(:evaluate_assigns) options = @@options.dup locals = options[:locals] || {} @@ -67,7 +65,6 @@ module Haml end engine.to_html(@view) { |*args| yield_proc.call(*args) } - end end end diff --git a/test/benchmark.rb b/test/benchmark.rb index 75b3baf6..1fa3ebe4 100644 --- a/test/benchmark.rb +++ b/test/benchmark.rb @@ -72,8 +72,8 @@ module Haml ActionView::Base.register_template_handler("haml", Haml::Template) @base = ActionView::Base.new(File.dirname(__FILE__)) times = Benchmark.bmbm do |b| - b.report("haml:") { runs.times { @base.render 'haml/templates/standard' } } - b.report("erb:") { runs.times { @base.render 'haml/rhtml/standard' } } + b.report("haml:") { runs.times { @base.render 'haml/templates/action_view' } } + b.report("erb:") { runs.times { @base.render 'haml/rhtml/action_view' } } end print_result["ERB", 1] diff --git a/test/haml/rhtml/_av_partial_1.rhtml b/test/haml/rhtml/_av_partial_1.rhtml new file mode 100644 index 00000000..7507a0be --- /dev/null +++ b/test/haml/rhtml/_av_partial_1.rhtml @@ -0,0 +1,12 @@ +
It has several nested partials,
+Nesting level <%= @nesting %>
+ <% if @nesting > 0 %> + <%= render :partial => 'haml/rhtml/av_partial_2' %> + <% end %> ++ <%= "Holy cow " + + "multiline " + + "tags! " + + "A pipe (|) even!" %> + <%= [1, 2, 3].collect { |n| "PipesIgnored|" } %> + <%= [1, 2, 3].collect { |n| + n.to_s + }.join("|") %> +
+