Module: Datapimp::Sync
- Defined in:
- lib/datapimp/sync.rb,
lib/datapimp/sync/s3_bucket.rb,
lib/datapimp/sync/dropbox_delta.rb,
lib/datapimp/sync/cloudfront_distribution.rb
Defined Under Namespace
Classes: CloudfrontDistribution, DropboxDelta, DropboxFolder, GoogleDriveFolder, S3Bucket
Class Method Summary collapse
- .amazon(options = {}) ⇒ Object
- .data_source_types ⇒ Object
-
.dispatch_sync_folder_action(local, remote, options) ⇒ Object
Create any type of syncable folder and dispatch a run call to it with whatever options you want.
- .dropbox(options = {}) ⇒ Object
- .github(options = {}) ⇒ Object
- .google(options = {}) ⇒ Object
Class Method Details
.amazon(options = {}) ⇒ Object
38 39 40 41 |
# File 'lib/datapimp/sync.rb', line 38 def self.amazon(={}) require 'datapimp/clients/amazon' Datapimp::Clients::Amazon.client() end |
.data_source_types ⇒ Object
6 7 8 |
# File 'lib/datapimp/sync.rb', line 6 def self.data_source_types %w(dropbox amazon github google json excel nokogiri) end |
.dispatch_sync_folder_action(local, remote, options) ⇒ Object
Create any type of syncable folder and dispatch a run call to it with whatever options you want.
options:
- local: relative path to th local version of this folder
- remote: an identifier for the remote folder in the remote system
- action: push, pull, etc
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/datapimp/sync.rb', line 17 def self.dispatch_sync_folder_action(local, remote, ) = .to_mash action = .action folder = case when .type == "dropbox" Datapimp::Sync::DropboxFolder.new(local: local, remote: remote) when .type == "google" # Return the folders # collection = Datapimp::Sync.google.api.collections.first # # svg = collection.files.first # svg.export_as_file(/download/path, "image/svg+xml") Datapimp::Sync::GoogleDriveFolder.new(local: local, remote: remote) when .type == "aws" || .type == "s3"|| .type == "amazon" Datapimp::Sync::S3Bucket.new(local: local, remote: remote) end folder.run(action, ) end |
.dropbox(options = {}) ⇒ Object
43 44 45 46 |
# File 'lib/datapimp/sync.rb', line 43 def self.dropbox(={}) require 'datapimp/clients/dropbox' Datapimp::Clients::Dropbox.client() end |