Class: Sprockets::SassImporter
- Inherits:
-
Sass::Importers::Filesystem
- Object
- Sass::Importers::Filesystem
- Sprockets::SassImporter
- Defined in:
- lib/classy_assets/sprockets/sass_importer.rb
Constant Summary collapse
- GLOB =
/\*|\[.+\]/
Instance Method Summary collapse
- #extensions ⇒ Object
- #find(name, options = {}) ⇒ Object
- #find_relative(name, base, options) ⇒ Object
-
#initialize(context, root) ⇒ SassImporter
constructor
A new instance of SassImporter.
Constructor Details
#initialize(context, root) ⇒ SassImporter
Returns a new instance of SassImporter.
13 14 15 16 |
# File 'lib/classy_assets/sprockets/sass_importer.rb', line 13 def initialize(context, root) @context = context super root.to_s end |
Instance Method Details
#extensions ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/classy_assets/sprockets/sass_importer.rb', line 18 def extensions { 'css' => :scss, 'css.erb' => :scss, 'scss.erb' => :scss, 'sass.erb' => :sass }.merge!(super) end |
#find(name, options = {}) ⇒ Object
27 28 29 30 |
# File 'lib/classy_assets/sprockets/sass_importer.rb', line 27 def find(name, = {}) return nil if name =~ GLOB # globs must be relative engine_from_path(name, root, ) end |
#find_relative(name, base, options) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/classy_assets/sprockets/sass_importer.rb', line 32 def find_relative(name, base, ) if name =~ GLOB glob_imports(name, Pathname.new(base), ) else engine_from_path(name, File.dirname(base), ) end end |