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.
19 20 21 |
# File 'lib/s3_meta_sync.rb', line 19 def initialize(config) @config = config end |
Instance Method Details
#sync(source, destination) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/s3_meta_sync.rb', line 23 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 |