Method: Synqa::SyncOperation#doSync

Defined in:
lib/synqa.rb

#doSync(options = {}) ⇒ Object

Do the sync. Options: :full = true means clear the cached content files first, :dryRun means don’t do the actual copies and deletes, but just show what they would be.



969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
# File 'lib/synqa.rb', line 969

def doSync(options = {})
  if options[:full]
    clearCachedContentFiles()
  end
  getContentTrees()
  markSyncOperations()
  dryRun = options[:dryRun]
  if not dryRun
    @destinationLocation.clearCachedContentFile()
  end
  doAllCopyOperations(dryRun)
  doAllDeleteOperations(dryRun)
  if (not dryRun and @destinationLocation.cachedContentFile and @sourceLocation.cachedContentFile and
      File.exists?(@sourceLocation.cachedContentFile))
    FileUtils::Verbose.cp(@sourceLocation.cachedContentFile, @destinationLocation.cachedContentFile)
  end
  closeConnections()
end