6 Chef::Log.debug("Doing a remote recursive directory transfer for #{@new_resource}")
8 files_transferred = Set.new
9 files_to_transfer.each do |cookbook_file_relative_path|
10 create_cookbook_file(cookbook_file_relative_path)
11 files_transferred << ::File.dirname(::File.join(@new_resource.path, cookbook_file_relative_path))
12 files_transferred << ::File.join(@new_resource.path, cookbook_file_relative_path)
15 return unless @new_resource.purge
17 files_to_purge = Set.new(
18 Dir.glob(::File.join(@new_resource.path, "**", "*"), ::File::FNM_DOTMATCH).select do |name|
19 name !~ /(?:^|#{Regexp.escape(::File::SEPARATOR)})\.\.?$/
22 files_to_purge -= files_transferred
23 purge_unmanaged_files(files_to_purge)