Module: Closync
- Defined in:
- lib/closync.rb,
lib/closync/sync.rb,
lib/closync/config.rb,
lib/closync/storage.rb,
lib/closync/version.rb
Overview
The three supported object storage providers are Amazon S3, Google Coloud Storage, and Rackspace Cloudfiles.
In addition to loading configuration via yml file (see README.md), Closync can also be used programmatically:
require 'closync'
config = Closync::Config.new({
credentials: {
rackspace_username: ENV['RACKSPACE_USERNAME'],
rackspace_api_key: ENV['RACKSPACE_API_KEY']
},
working_dir: '/path/from/root',
storage: {
local: {
provider: 'Local',
directory: 'relative/path'
},
remote: {
provider: 'Rackspace',
directory: 'bucket_name'
}
},
cache_control: {
'default' => (60*60*24*365),
'.html' => (60*5),
'.htm' => (60*5)
}
})
Closync::Sync.new(config).push!
Defined Under Namespace
Classes: Config, Storage, Sync
Constant Summary
collapse
- VERSION =
'0.1.2'
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
49
50
51
52
|
# File 'lib/closync.rb', line 49
def config
@config ||= Config.new
@config
end
|
.config=(data) ⇒ Object
45
46
47
|
# File 'lib/closync.rb', line 45
def config=(data)
@config = data
end
|
54
55
56
57
|
# File 'lib/closync.rb', line 54
def configure(&proc)
@config ||= Config.new
yield @config
end
|
.push! ⇒ Object
59
60
61
|
# File 'lib/closync.rb', line 59
def push!
Sync.new(config).push!
end
|