Created
March 2, 2012 19:39
-
-
Save jeffrafter/1960778 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*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