Run a callback when a sprite is removed.

This commit is contained in:
Chris Eppstein 2011-09-19 18:19:04 -07:00
parent 71e5d28a29
commit 38e4b3a3d9
2 changed files with 7 additions and 0 deletions

View File

@ -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) }

View File

@ -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