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