Sha256: 90bc73efef6dc2c6b6ebb422b133af4d3c5499e52d3140a2e264ffff3615b3b7

Contents?: true

Size: 976 Bytes

Versions: 3

Compression:

Stored size: 976 Bytes

Contents

module Fog
  module Storage
     def self.new(attributes) # monkey patch to add :external
      attributes = attributes.dup # prevent delete from having side effects
      case provider = attributes.delete(:provider).to_s.downcase.to_sym
      when :aws
        require 'fog/aws/storage'
        Fog::Storage::AWS.new(attributes)
      when :google
        require 'fog/google/storage'
        Fog::Storage::Google.new(attributes)
      when :local
        require 'fog/local/storage'
        Fog::Storage::Local.new(attributes)
      when :ninefold
        require 'fog/ninefold/storage'
        Fog::Storage::Ninefold.new(attributes)
      when :rackspace
        require 'fog/rackspace/storage'
        Fog::Storage::Rackspace.new(attributes)
      when :external
        require 'fog/external/storage'
        Fog::Storage::External.new(attributes)
      else
        raise ArgumentError.new("#{provider} is not a recognized storage provider")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-external-0.0.3 lib/fog-external.rb
fog-external-0.0.2 lib/fog-external.rb
fog-external-0.0.1 lib/fog-external.rb