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