diff --git a/Gemfile.lock b/Gemfile.lock index 6afb9c26..5df9882b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - compass (0.12.0.alpha.0.5e89865) + compass (0.12.0.alpha.0.71494ce) chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.1) diff --git a/lib/compass/sass_extensions/sprites/sprite_map.rb b/lib/compass/sass_extensions/sprites/sprite_map.rb index aa9179a1..8c7f670f 100644 --- a/lib/compass/sass_extensions/sprites/sprite_map.rb +++ b/lib/compass/sass_extensions/sprites/sprite_map.rb @@ -17,10 +17,18 @@ module Compass name, path = Compass::SpriteImporter.path_and_name(uri) files = Compass::SpriteImporter.files(uri) sprites = files.map do |sprite| - sprite.gsub("#{Compass.configuration.images_path}/", "") + relative_name(sprite) end new(sprites, path, name, context, kwargs) end + + def self.relative_name(sprite) + Compass.configuration.sprite_load_path.each do |path| + if sprite.include?(path) + return sprite.gsub("#{path}/", "") + end + end + end def initialize(sprites, path, name, context, kwargs) @image_names = sprites