lib/hogan_assets/tilt.rb in hogan_assets-1.3.0 vs lib/hogan_assets/tilt.rb in hogan_assets-1.3.1

- old
+ new

@@ -9,19 +9,17 @@ rescue LoadError # haml not available end def evaluate(scope, locals, &block) - text = data # Ugly, yes, but to not taint data variable - - if scope.pathname.extname == '.hamstache' + text = if scope.pathname.extname == '.hamstache' raise "Unable to complile #{scope.pathname} because haml is not available. Did you add the haml gem?" unless HoganAssets::Config.haml_available? - text = Haml::Engine.new(data, @options).render - compiled_template = Hogan.compile(source) + Haml::Engine.new(data, @options).render else - compiled_template = Hogan.compile(data) + data end + compiled_template = Hogan.compile(text) template_name = scope.logical_path.inspect # Only emit the source template if we are using lambdas text = '' unless HoganAssets::Config.lambda_support? <<-TEMPLATE