lib/faml/tilt.rb in faml-0.2.6 vs lib/faml/tilt.rb in faml-0.2.7

- old
+ new

@@ -1,11 +1,16 @@ require 'tilt' +require 'tilt/haml' require 'faml/engine' module Faml class Tilt < Tilt::Template def prepare - @code = Engine.new(options.merge(filename: File.expand_path(file))).call(data) + filename = nil + if file + filename = File.expand_path(file) + end + @code = Engine.new(options.merge(filename: filename)).call(data) end def precompiled_template(locals = {}) @code end