From 0b3005b3b457a022904c632369cddf76d074f481 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Mon, 19 Aug 2013 20:01:36 +0200 Subject: [PATCH] make obsolete_files a method (@mattr-) --- lib/jekyll/cleaner.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index b167f0a7..77c35345 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -9,12 +9,18 @@ module Jekyll # Cleans up the site's destination directory def cleanup! - obsolete_files = existing_files - new_files - new_dirs + replaced_files - FileUtils.rm_rf(obsolete_files.to_a) + FileUtils.rm_rf(obsolete_files) end 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. # # Returns a Set with the file paths