def refresh
super
files_to_remove = Set.new
all_paths = Set.new
each do |file|
file.refresh
if File.exist? file.path
all_paths << file.path
else
files_to_remove << file
@tree_signal.call(:remove, file)
end
end
@files -= files_to_remove
begin
Dir.foreach(@path) do |file|
next if file =~ /^\./
path = File.join(@path, file)
next if @exclude_file_list.any? {|f| path[-(f.size+1)..-1] == "/#{f}" }
next if all_paths.include? path
@files << if File.directory? path
ListedDirectory.new(path, @exclude_file_list, self, &@tree_signal)
else
ListedFile.new(path, self, &@tree_signal)
end
end
rescue Errno::ENOENT
end
self
end