make obsolete_files a method (@mattr-)
This commit is contained in:
parent
5d7dba476c
commit
0b3005b3b4
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue