Class: S3MetaSync::Syncer

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_meta_sync.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Syncer

Returns a new instance of Syncer.



22
23
24
# File 'lib/s3_meta_sync.rb', line 22

def initialize(config)
  @config = config
end

Instance Method Details

#sync(source, destination) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/s3_meta_sync.rb', line 26

def sync(source, destination)
  raise if source.end_with?("/") or destination.end_with?("/")

  if destination.include?(":")
    @bucket, destination = destination.split(":")
    upload(source, destination)
  else
    @bucket, source = source.split(":")
    download(source, destination)
  end
end