Class: Sprockets::Sass::Importer

Inherits:
Sass::Importers::Base
  • Object
show all
Defined in:
lib/sprockets/sass/importer.rb

Constant Summary

GLOB =
/\*|\[.+\]/

Instance Method Summary collapse

Instance Method Details

#find(path, options) ⇒ Object

See Also:

  • Sass::Importers::Base#find


19
20
21
# File 'lib/sprockets/sass/importer.rb', line 19

def find(path, options)
  engine_from_path(path, nil, options)
end

#find_relative(path, base_path, options) ⇒ Object

See Also:

  • Sass::Importers::Base#find_relative


10
11
12
13
14
15
16
# File 'lib/sprockets/sass/importer.rb', line 10

def find_relative(path, base_path, options)
  if path =~ GLOB
    engine_from_glob(path, base_path, options)
  else
    engine_from_path(path, base_path, options)
  end
end

#key(path, options) ⇒ Object

See Also:

  • Sass::Importers::Base#key


33
34
35
36
# File 'lib/sprockets/sass/importer.rb', line 33

def key(path, options)
  path = Pathname.new(path)
  ["#{self.class.name}:#{path.dirname.expand_path}", path.basename]
end

#mtime(path, options) ⇒ Object

See Also:

  • Sass::Importers::Base#mtime


24
25
26
27
28
29
30
# File 'lib/sprockets/sass/importer.rb', line 24

def mtime(path, options)
  if pathname = resolve(path)
    pathname.mtime
  end
rescue Errno::ENOENT
  nil
end

#to_sObject

See Also:

  • Sass::Importers::Base#to_s


39
40
41
# File 'lib/sprockets/sass/importer.rb', line 39

def to_s
  "#{self.class.name}:#{context.pathname}"
end