Class: CompassRails4::SpriteImporter
- Inherits:
-
Compass::SpriteImporter
- Object
- Compass::SpriteImporter
- CompassRails4::SpriteImporter
- Defined in:
- lib/compass-rails4/patches/sprite_importer.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #find(uri, options) ⇒ Object
-
#initialize(context, root) ⇒ SpriteImporter
constructor
A new instance of SpriteImporter.
Constructor Details
#initialize(context, root) ⇒ SpriteImporter
Returns a new instance of SpriteImporter.
5 6 7 8 |
# File 'lib/compass-rails4/patches/sprite_importer.rb', line 5 def initialize(context, root) @context = context @root = root end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/compass-rails4/patches/sprite_importer.rb', line 3 def context @context end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
3 4 5 |
# File 'lib/compass-rails4/patches/sprite_importer.rb', line 3 def root @root end |
Instance Method Details
#find(uri, options) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/compass-rails4/patches/sprite_importer.rb', line 10 def find(uri, ) if old = super(uri, ) self.class.files(uri).each do |file| relative_path = Pathname.new(file).relative_path_from(Pathname.new(root)) begin pathname = context.resolve(relative_path) context.depend_on_asset(pathname) rescue Sprockets::FileNotFound end end end old end |