Sha256: f7acaa0f8f98cbaa21ced865e28f7338f356c6859455d888f392caab8e353085

Contents?: true

Size: 819 Bytes

Versions: 7

Compression:

Stored size: 819 Bytes

Contents

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

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)
      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

7 entries across 7 versions & 1 rubygems

Version Path
fulmar-1.2.1 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.2.0 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.1.0 lib/fulmar/domain/service/file_sync_service.rb
fulmar-1.0.0 lib/fulmar/domain/service/file_sync_service.rb
fulmar-0.6.5 lib/fulmar/domain/service/file_sync_service.rb
fulmar-0.6.4 lib/fulmar/domain/service/file_sync_service.rb
fulmar-0.6.3 lib/fulmar/domain/service/file_sync_service.rb