class Sprockets::SassTemplate
def evaluate(context, locals, &block)
def evaluate(context, locals, &block) # Use custom importer that knows about Sprockets Caching cache_store = SassCacheStore.new(context.environment) options = { :filename => eval_file, :line => line, :syntax => syntax, :cache_store => cache_store, :importer => SassImporter.new(context.pathname.to_s), :load_paths => context.environment.paths.map { |path| SassImporter.new(path.to_s) }, :sprockets => { :context => context, :environment => context.environment } } result = ::Sass::Engine.new(data, options).render # Track all imported files filenames = ([options[:importer].imported_filenames] + options[:load_paths].map(&:imported_filenames)).flatten.uniq filenames.each { |filename| context.depend_on(filename) } result rescue ::Sass::SyntaxError => e # Annotates exception message with parse line number context.__LINE__ = e.sass_backtrace.first[:line] raise e end