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: {
# aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
# aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
# google_storage_access_key_id: ENV['GOOGLE_STORAGE_ACCESS_KEY_ID'],
# google_storage_secret_access_key: ENV['GOOGLE_STORAGE_SECRET_ACCESS_KEY'],
rackspace_username: ENV['RACKSPACE_USERNAME'],
rackspace_api_key: ENV['RACKSPACE_API_KEY']
},
working_dir: '/path/from/root', # defaults to Dir.pwd
storage: {
local: {
provider: 'Local',
directory: 'relative/path' # relative to working_dir
},
remote: {
provider: 'Rackspace', # || 'AWS' || 'Google'
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 |