Skip to content

Instantly share code, notes, and snippets.

@jeffrafter
Created March 2, 2012 19:39
Show Gist options
  • Save jeffrafter/1960778 to your computer and use it in GitHub Desktop.
Save jeffrafter/1960778 to your computer and use it in GitHub Desktop.
*snip*
# The config file format is like
#
# dropbox:
# app_key: YOUR_APP_KEY
# app_secret: YOUR_APP_SECRET
# storage:
# provider: AWS
# aws_access_key_id: YOUR_ACCESS_KEY
# aws_secret_access_key: YOUR_SECRET_ACCESS_KEY
# directory: DESTINATION_BUCKET
#
def initialize(options)
@options = options
@config = YAML.load_file(@options[:config_file]) || {}
@config.symbolize_keys!
@config[:dropbox].symbolize_keys!
@config[:storage].symbolize_keys!
end
*snip*
def storage
return @storage if @storage
storage_options = @config[:storage].dup
storage_options.delete(:directory)
@storage = Fog::Storage.new(storage_options)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment