Class: Sprockets::Sass::Importer
- Inherits:
-
Sass::Importers::Base
- Object
- Sass::Importers::Base
- Sprockets::Sass::Importer
- Defined in:
- lib/sprockets/sass/importer.rb
Constant Summary
- GLOB =
/\*|\[.+\]/
Instance Attribute Summary (collapse)
-
- (Object) context
readonly
Reference to the Sprockets context.
Instance Method Summary (collapse)
- - (Object) find(path, options)
- - (Object) find_relative(path, base_path, options)
-
- (Importer) initialize(context)
constructor
A new instance of Importer.
- - (Object) key(path, options)
- - (Object) mtime(path, options)
- - (Object) to_s
Constructor Details
- (Importer) initialize(context)
A new instance of Importer
13 14 15 |
# File 'lib/sprockets/sass/importer.rb', line 13 def initialize(context) @context = context end |
Instance Attribute Details
- (Object) context (readonly)
Reference to the Sprockets context
10 11 12 |
# File 'lib/sprockets/sass/importer.rb', line 10 def context @context end |
Instance Method Details
- (Object) find(path, options)
27 28 29 |
# File 'lib/sprockets/sass/importer.rb', line 27 def find(path, ) engine_from_path(path, ) end |
- (Object) find_relative(path, base_path, options)
18 19 20 21 22 23 24 |
# File 'lib/sprockets/sass/importer.rb', line 18 def find_relative(path, base_path, ) if path =~ GLOB engine_from_glob(path, base_path, ) else engine_from_path(path, ) end end |
- (Object) key(path, options)
41 42 43 44 |
# File 'lib/sprockets/sass/importer.rb', line 41 def key(path, ) path = Pathname.new(path) ["#{self.class.name}:#{path.dirname.}", path.basename] end |
- (Object) mtime(path, options)
32 33 34 35 36 37 38 |
# File 'lib/sprockets/sass/importer.rb', line 32 def mtime(path, ) if pathname = resolve(path) pathname.mtime end rescue Errno::ENOENT nil end |
- (Object) to_s
47 48 49 |
# File 'lib/sprockets/sass/importer.rb', line 47 def to_s "#{self.class.name}:#{context.pathname}" end |