Class: Sprockets::SassImporter
- Inherits:
-
Sass::Importers::Filesystem
- Object
- Sass::Importers::Filesystem
- Sprockets::SassImporter
- Defined in:
- lib/sprockets/sass_importer.rb
Overview
This custom importer that tracks all imported filenames during compile.
Instance Attribute Summary collapse
-
#imported_filenames ⇒ Object
readonly
Returns the value of attribute imported_filenames.
Instance Method Summary collapse
- #find(*args) ⇒ Object
- #find_relative(*args) ⇒ Object
-
#initialize(*args) ⇒ SassImporter
constructor
A new instance of SassImporter.
Constructor Details
#initialize(*args) ⇒ SassImporter
Returns a new instance of SassImporter.
9 10 11 12 |
# File 'lib/sprockets/sass_importer.rb', line 9 def initialize(*args) @imported_filenames = [] super end |
Instance Attribute Details
#imported_filenames ⇒ Object (readonly)
Returns the value of attribute imported_filenames.
7 8 9 |
# File 'lib/sprockets/sass_importer.rb', line 7 def imported_filenames @imported_filenames end |
Instance Method Details
#find(*args) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/sprockets/sass_importer.rb', line 22 def find(*args) engine = super if engine && (filename = engine.[:filename]) @imported_filenames << filename end engine end |
#find_relative(*args) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/sprockets/sass_importer.rb', line 14 def find_relative(*args) engine = super if engine && (filename = engine.[:filename]) @imported_filenames << filename end engine end |