Class: S3MetaSync::Syncer
- Inherits:
-
Object
- Object
- S3MetaSync::Syncer
- Defined in:
- lib/s3_meta_sync.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Syncer
constructor
A new instance of Syncer.
- #sync(source, destination) ⇒ Object
Constructor Details
#initialize(config) ⇒ Syncer
Returns a new instance of Syncer.
25 26 27 |
# File 'lib/s3_meta_sync.rb', line 25 def initialize(config) @config = config end |
Instance Method Details
#sync(source, destination) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/s3_meta_sync.rb', line 29 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 |