def download_attachments
      unless @scripts.all? { |s| s.attachments.empty? }
        @audit.create_new_section('Downloading attachments')
        audit_time do
          @scripts.each do |script|
            attach_dir = @right_scripts_cookbook.cache_dir(script)
            script.attachments.each do |a|
              script_file_path = File.join(attach_dir, a.file_name)
              @audit.update_status("Downloading #{a.file_name} into #{script_file_path} through Repose")
              begin
                attachment_dir = File.dirname(script_file_path)
                FileUtils.mkdir_p(attachment_dir)
                tempfile = Tempfile.open('attachment', attachment_dir)
                tempfile.binmode
                @downloader.download(a.url) do |response|
                  tempfile << response
                end
                File.unlink(script_file_path) if File.exists?(script_file_path)
                File.link(tempfile.path, script_file_path)
                tempfile.close!
                @audit.append_info(@downloader.details)
              rescue Exception => e
                tempfile.close! unless tempfile.nil?
                @audit.append_info("Repose download failed: #{e.message}.")
                if e.kind_of?(ReposeDownloader::DownloadException) && e.message.include?("Forbidden")
                  @audit.append_info("Often this means the download URL has expired while waiting for inputs to be satisfied.")
                end
                report_failure("Failed to download attachment '#{a.file_name}'", e.message)
              end
            end
          end
        end
      end
      true
    end
def download_attachments
      unless @scripts.all? { |s| s.attachments.empty? }
        @audit.create_new_section('Downloading attachments')
        audit_time do
          @scripts.each do |script|
            attach_dir = @right_scripts_cookbook.cache_dir(script)
            script.attachments.each do |a|
              script_file_path = File.join(attach_dir, a.file_name)
              @audit.update_status("Downloading #{a.file_name} into #{script_file_path} through Repose")
              begin
                attachment_dir = File.dirname(script_file_path)
                FileUtils.mkdir_p(attachment_dir)
                tempfile = Tempfile.open('attachment', attachment_dir)
                tempfile.binmode
                @downloader.download(a.url) do |response|
                  tempfile << response
                end
                File.unlink(script_file_path) if File.exists?(script_file_path)
                File.link(tempfile.path, script_file_path)
                tempfile.close!
                @audit.append_info(@downloader.details)
              rescue Exception => e
                tempfile.close! unless tempfile.nil?
                @audit.append_info("Repose download failed: #{e.message}.")
                if e.kind_of?(ReposeDownloader::DownloadException) && e.message.include?("Forbidden")
                  @audit.append_info("Often this means the download URL has expired while waiting for inputs to be satisfied.")
                end
                report_failure("Failed to download attachment '#{a.file_name}'", e.message)
              end
            end
          end
        end
      end
      true
    end
Download attachments, update @ok

 === Return
 true:: Always return true