Sha256: afd5dc90874f6adbecc371051ab50f970df4a7259695e7a805e13ba4c0ac115b

Contents?: true

Size: 973 Bytes

Versions: 39

Compression:

Stored size: 973 Bytes

Contents

require 'fulmar/infrastructure/service/transfer/rsync'
require 'fulmar/infrastructure/service/transfer/rsync_with_versions'
require 'fulmar/infrastructure/service/transfer/tar'

module Fulmar
  # Creates the required transfer model from the configuration
  class FileSync
    def self.create_transfer(config)
      case config[:type]
      when 'rsync_with_versions'
        transfer_model = Fulmar::Infrastructure::Service::Transfer::RsyncWithVersions.new(config)
      when 'rsync'
        transfer_model = Fulmar::Infrastructure::Service::Transfer::Rsync.new(config)
      when 'tar'
        transfer_model = Fulmar::Infrastructure::Service::Transfer::Tar.new(config)
      else
        help = config[:type] == '' ? 'Add a "type: " field to your deployment yaml file. ' : ''
        transfer_model = nil
        fail "Transfer type '#{config[:type]}' is not valid. #{help}Valid values are: rsync, rsync_with_versions."
      end

      transfer_model
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
fulmar-1.10.1 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.10.0 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.9.2 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.9.1 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.9.0 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.15 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.14 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.13 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.12 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.11 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.10 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.9 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.8 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.7 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.6 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.5 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.4 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.3 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.2 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.8.1 lib/fulmar/domain/service/file_sync_service.rb