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.



15
16
17
# File 'lib/s3_meta_sync.rb', line 15

def initialize(config)
  @config = config
end

Instance Method Details

#sync(source, destination) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/s3_meta_sync.rb', line 19

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