diff --git a/lib/compass/configuration/data.rb b/lib/compass/configuration/data.rb index 2bd3b997..45c9e0c4 100644 --- a/lib/compass/configuration/data.rb +++ b/lib/compass/configuration/data.rb @@ -38,6 +38,12 @@ module Compass define_callback :sprite_generated chained_method :run_sprite_generated + # on_sprite_removed + # yields the filename + # usage: on_sprite_removed {|filename| do_something(filename) } + define_callback :sprite_removed + chained_method :run_sprite_removed + # on_stylesheet_saved # yields the filename # usage: on_stylesheet_saved {|filename| do_something(filename) } diff --git a/lib/compass/sass_extensions/sprites/sprite_methods.rb b/lib/compass/sass_extensions/sprites/sprite_methods.rb index e674aae3..251b5865 100644 --- a/lib/compass/sass_extensions/sprites/sprite_methods.rb +++ b/lib/compass/sass_extensions/sprites/sprite_methods.rb @@ -68,6 +68,7 @@ module Compass Dir[File.join(Compass.configuration.images_path, "#{path}-*.png")].each do |file| options[:compass][:logger].record(:remove, relativize(file)) unless options[:quiet] FileUtils.rm file + Compass.configuration.run_sprite_removed(file) end end