make obsolete_files a method (@mattr-)

This commit is contained in:
maul.esel 2013-08-19 20:01:36 +02:00
parent 5d7dba476c
commit 0b3005b3b4
1 changed files with 8 additions and 2 deletions

View File

@ -9,12 +9,18 @@ module Jekyll
# Cleans up the site's destination directory # Cleans up the site's destination directory
def cleanup! def cleanup!
obsolete_files = existing_files - new_files - new_dirs + replaced_files FileUtils.rm_rf(obsolete_files)
FileUtils.rm_rf(obsolete_files.to_a)
end end
private private
# Private: The list of files and directories to be deleted during the cleanup process
#
# Returns an Array with the file and directory paths
def obsolete_files
(existing_files - new_files - new_dirs + replaced_files).to_a
end
# Private: The list of existing files, except those included in keep_files and hidden files. # Private: The list of existing files, except those included in keep_files and hidden files.
# #
# Returns a Set with the file paths # Returns a Set with the file paths