Class: Sprockets::SassImporter
- Inherits:
-
Sass::Importers::Filesystem
- Object
- Sass::Importers::Filesystem
- Sprockets::SassImporter
- Defined in:
- lib/sprockets/sass_importer.rb
Overview
This custom importer adds sprockets dependency tracking on to Sass ‘@import` statements. This makes the Sprockets and Sass caching systems work together.
Instance Method Summary collapse
- #find(*args) ⇒ Object
- #find_relative(*args) ⇒ Object
-
#initialize(context, root) ⇒ SassImporter
constructor
A new instance of SassImporter.
Constructor Details
#initialize(context, root) ⇒ SassImporter
Returns a new instance of SassImporter.
8 9 10 11 |
# File 'lib/sprockets/sass_importer.rb', line 8 def initialize(context, root) @context = context super root.to_s end |
Instance Method Details
#find(*args) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/sprockets/sass_importer.rb', line 21 def find(*args) engine = super if engine && (filename = engine.[:filename]) @context.depend_on_asset(filename) end engine end |
#find_relative(*args) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/sprockets/sass_importer.rb', line 13 def find_relative(*args) engine = super if engine && (filename = engine.[:filename]) @context.depend_on_asset(filename) end engine end |