This custom importer adds sprockets dependency tracking on to Sass `@import` statements. This makes the Sprockets and Sass caching systems work together.
# File lib/sprockets/sass_importer.rb, line 8 def initialize(context, root) @context = context super root.to_s end
# File lib/sprockets/sass_importer.rb, line 21 def find(*args) engine = super if engine && (filename = engine.options[:filename]) @context.depend_on(filename) end engine end
# File lib/sprockets/sass_importer.rb, line 13 def find_relative(*args) engine = super if engine && (filename = engine.options[:filename]) @context.depend_on(filename) end engine end