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

.configObject



5
6
7
# File 'lib/cloud-storage-sync/cloud_storage_sync.rb', line 5

def config
  @config ||= Config.new
end

.configure {|@config ||= Config.new| ... } ⇒ Object

Yields:



9
10
11
# File 'lib/cloud-storage-sync/cloud_storage_sync.rb', line 9

def configure(&proc)
  yield @config ||= Config.new
end

.storageObject



13
14
15
# File 'lib/cloud-storage-sync/cloud_storage_sync.rb', line 13

def storage
  @storage ||= Storage.new(config.credentials, config.options)
end

.syncObject

Raises:



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