diff --git a/lib/guard/guard.rb b/lib/guard/guard.rb index 8009903..aed9bc9 100644 --- a/lib/guard/guard.rb +++ b/lib/guard/guard.rb @@ -54,4 +54,4 @@ module Guard end end -end \ No newline at end of file +end diff --git a/lib/guard/listener.rb b/lib/guard/listener.rb index 1a8eeaf..b3bf224 100644 --- a/lib/guard/listener.rb +++ b/lib/guard/listener.rb @@ -29,6 +29,7 @@ module Guard @directory = directory.to_s @sha1_checksums_hash = {} @relativize_paths = options.fetch(:relativize_paths, true) + @cached_files = all_files update_last_event end @@ -49,6 +50,9 @@ module Guard def modified_files(dirs, options={}) files = potentially_modified_files(dirs, options).select { |path| file_modified?(path) } + deleted_files = @cached_files.collect { |path| "!#{path}" unless File.exists?(path) }.compact + files.concat(deleted_files) + @cached_files = all_files update_last_event relativize_paths(files) end