Run a callback when a sprite is removed.
This commit is contained in:
parent
71e5d28a29
commit
38e4b3a3d9
@ -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) }
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user