Skip to content

Commit

Permalink
HamlTemplate falls back to eval mode if haml version is too old
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Mar 4, 2010
1 parent 8835db8 commit af892d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/tilt.rb
Expand Up @@ -377,6 +377,14 @@ def prepare
@engine = ::Haml::Engine.new(data, haml_options)
end

def evaluate(scope, locals, &block)
if @engine.respond_to?(:precompiled_method_return_value, true)
super
else
@engine.render(scope, locals, &block)
end
end

# Precompiled Haml source. Taken from the precompiled_with_ambles
# method in Haml::Precompiler:
# http://github.com/nex3/haml/blob/master/lib/haml/precompiler.rb#L111-126
Expand Down

0 comments on commit af892d9

Please sign in to comment.