Module: CloudStorageSync
- Defined in:
- lib/cloud_storage_sync.rb,
lib/cloud-storage-sync/config.rb,
lib/cloud-storage-sync/railtie.rb,
lib/cloud-storage-sync/storage.rb,
lib/cloud-storage-sync/version.rb,
lib/cloud-storage-sync/cloud_storage_sync.rb,
lib/generators/cloud_storage_sync/install_generator.rb,
lib/generators/cloud_storage_sync/install/install_generator.rb
Defined Under Namespace
Classes: Config, InstallGenerator, Railtie, Storage
Constant Summary
collapse
- VERSION =
"0.0.2"
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
5
6
7
|
# File 'lib/cloud-storage-sync/cloud_storage_sync.rb', line 5
def config
@config ||= Config.new
end
|
9
10
11
|
# File 'lib/cloud-storage-sync/cloud_storage_sync.rb', line 9
def configure(&proc)
yield @config ||= Config.new
end
|
.storage ⇒ Object
13
14
15
|
# File 'lib/cloud-storage-sync/cloud_storage_sync.rb', line 13
def storage
@storage ||= Storage.new(config.credentials, config.options)
end
|
.sync ⇒ Object
17
18
19
20
21
|
# File 'lib/cloud-storage-sync/cloud_storage_sync.rb', line 17
def sync
config.validate
raise Config::Invalid.new(config.errors.full_messages.join(', ')) unless config && config.valid?
storage.sync
end
|