Sha256: 97f5407391cb1ecb8bcc242b785dba366a278bed85c4c23fa465e83c5e91a212
Contents?: true
Size: 860 Bytes
Versions: 1
Compression:
Stored size: 860 Bytes
Contents
require 'yaml' module S3CorsFileupload module Config # this allows us to lazily instantiate the configuration by reading it in when it needs to be accessed class << self # if a method is called on the class, attempt to look it up in the config array def method_missing(meth, *args, &block) if args.empty? && block.nil? config[meth.to_s] else super end end private def config @config ||= YAML.load_file(File.join(::Rails.root, 'config', 'amazon_s3.yml'))[::Rails.env] rescue warn('WARNING: s3_cors_fileupload gem was unable to locate a configuration file in config/amazon_s3.yml and may not ' + 'be able to function properly. Please run `rails generate s3_cors_upload:install` before proceeding.') {} end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
s3_cors_fileupload-0.1.4 | lib/s3_cors_fileupload/rails/config.rb |