mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2096 from burns/mime_types
require mime/types in Fog::Storage
This commit is contained in:
commit
f3e873bb1a
14 changed files with 6 additions and 26 deletions
|
@ -66,7 +66,6 @@ module Fog
|
|||
include Utils
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
setup_credentials(options)
|
||||
end
|
||||
|
||||
|
@ -80,8 +79,6 @@ module Fog
|
|||
include Utils
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
|
||||
setup_credentials(options)
|
||||
@connection_options = options[:connection_options] || {}
|
||||
@hmac = Fog::HMAC.new('sha1', @storage_secret_decoded)
|
||||
|
|
|
@ -47,7 +47,6 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@use_iam_profile = options[:use_iam_profile]
|
||||
setup_credentials(options)
|
||||
end
|
||||
|
@ -181,7 +180,7 @@ EOF
|
|||
params[:headers]['Date'] = Fog::Time.now.to_date_header
|
||||
params[:headers]['x-amz-security-token'] = @aws_session_token if @aws_session_token
|
||||
params[:headers]['Authorization'] = "AWS #{@aws_access_key_id}:#{signature(params)}"
|
||||
params[:path] = "/#{@version}/#{params[:path]}"
|
||||
params[:path] = "/#{@version}/#{params[:path]}"
|
||||
@connection.request(params, &block)
|
||||
end
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@use_iam_profile = options[:use_iam_profile]
|
||||
setup_credentials(options)
|
||||
@region = options[:region]
|
||||
|
|
|
@ -335,7 +335,6 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@use_iam_profile = options[:use_iam_profile]
|
||||
setup_credentials(options)
|
||||
@region = options[:region] || DEFAULT_REGION
|
||||
|
@ -387,7 +386,6 @@ module Fog
|
|||
# * S3 object with connection to aws.
|
||||
def initialize(options={})
|
||||
require 'fog/core/parser'
|
||||
require 'mime/types'
|
||||
|
||||
@use_iam_profile = options[:use_iam_profile]
|
||||
setup_credentials(options)
|
||||
|
|
|
@ -144,7 +144,6 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@google_storage_access_key_id = options[:google_storage_access_key_id]
|
||||
end
|
||||
|
||||
|
@ -162,7 +161,7 @@ module Fog
|
|||
|
||||
end
|
||||
|
||||
|
||||
|
||||
class Real
|
||||
include Utils
|
||||
|
||||
|
@ -185,7 +184,6 @@ module Fog
|
|||
# * Storage object with connection to google.
|
||||
def initialize(options={})
|
||||
require 'fog/core/parser'
|
||||
require 'mime/types'
|
||||
|
||||
@google_storage_access_key_id = options[:google_storage_access_key_id]
|
||||
@google_storage_secret_access_key = options[:google_storage_secret_access_key]
|
||||
|
|
|
@ -220,7 +220,6 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
# deprecate hp_account_id
|
||||
if options[:hp_account_id]
|
||||
Fog::Logger.deprecation(":hp_account_id is deprecated, please use :hp_access_key instead.")
|
||||
|
@ -250,7 +249,6 @@ module Fog
|
|||
attr_reader :hp_cdn_ssl
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
# deprecate hp_account_id
|
||||
if options[:hp_account_id]
|
||||
Fog::Logger.deprecation(":hp_account_id is deprecated, please use :hp_access_key instead.")
|
||||
|
|
|
@ -196,7 +196,6 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
setup_credentials(options)
|
||||
options[:region] ||= 'us-east-1'
|
||||
@host = options[:host] || Fog::InternetArchive::API_DOMAIN_NAME
|
||||
|
@ -248,7 +247,6 @@ module Fog
|
|||
# * S3 object with connection to aws.
|
||||
def initialize(options={})
|
||||
require 'fog/core/parser'
|
||||
require 'mime/types'
|
||||
|
||||
setup_credentials(options)
|
||||
@connection_options = options[:connection_options] || {}
|
||||
|
|
|
@ -33,7 +33,6 @@ module Fog
|
|||
def initialize(options={})
|
||||
Fog::Mock.not_implemented
|
||||
|
||||
require 'mime/types'
|
||||
@local_root = ::File.expand_path(options[:local_root])
|
||||
|
||||
@endpoint = options[:endpoint] || build_endpoint_from_options(options)
|
||||
|
@ -68,7 +67,6 @@ module Fog
|
|||
attr_reader :endpoint
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@local_root = ::File.expand_path(options[:local_root])
|
||||
|
||||
@endpoint = options[:endpoint] || build_endpoint_from_options(options)
|
||||
|
|
|
@ -26,7 +26,6 @@ module Fog
|
|||
include Utils
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@ninefold_storage_token = options[:ninefold_storage_token]
|
||||
@ninefold_storage_secret = options[:ninefold_storage_secret]
|
||||
end
|
||||
|
|
|
@ -45,7 +45,6 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@openstack_api_key = options[:openstack_api_key]
|
||||
@openstack_username = options[:openstack_username]
|
||||
@path = '/v1/AUTH_1234'
|
||||
|
@ -74,7 +73,6 @@ module Fog
|
|||
class Real
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@openstack_api_key = options[:openstack_api_key]
|
||||
@openstack_username = options[:openstack_username]
|
||||
@openstack_auth_url = options[:openstack_auth_url]
|
||||
|
|
|
@ -74,7 +74,6 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@rackspace_api_key = options[:rackspace_api_key]
|
||||
@rackspace_username = options[:rackspace_username]
|
||||
@rackspace_cdn_ssl = options[:rackspace_cdn_ssl]
|
||||
|
@ -108,7 +107,6 @@ module Fog
|
|||
attr_reader :rackspace_cdn_ssl
|
||||
|
||||
def initialize(options={})
|
||||
require 'mime/types'
|
||||
@rackspace_api_key = options[:rackspace_api_key]
|
||||
@rackspace_username = options[:rackspace_username]
|
||||
@rackspace_cdn_ssl = options[:rackspace_cdn_ssl]
|
||||
|
|
|
@ -47,7 +47,6 @@ module Fog
|
|||
include Utils
|
||||
|
||||
def initialize(options = {})
|
||||
require 'mime/types'
|
||||
require 'multi_json'
|
||||
|
||||
configure_uri_options(options)
|
||||
|
|
|
@ -15,7 +15,7 @@ module Fog
|
|||
include Utils
|
||||
|
||||
def self.data
|
||||
@data ||= Hash.new do |hash, key|
|
||||
@data ||= Hash.new do |hash, key|
|
||||
hash[key] = {}
|
||||
end
|
||||
end
|
||||
|
@ -24,7 +24,7 @@ module Fog
|
|||
@data = nil
|
||||
end
|
||||
|
||||
def initialize(options = {})
|
||||
def initialize(options = {})
|
||||
configure_uri_options(options)
|
||||
end
|
||||
|
||||
|
@ -41,7 +41,6 @@ module Fog
|
|||
include Utils
|
||||
|
||||
def initialize(options = {})
|
||||
require 'mime/types'
|
||||
require 'multi_json'
|
||||
|
||||
configure_uri_options(options)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'mime/types'
|
||||
|
||||
module Fog
|
||||
module Storage
|
||||
|
||||
|
|
Loading…
Reference in a new issue