diff --git a/lib/fog/atmos/storage.rb b/lib/fog/atmos/storage.rb index a4533ef62..a0f756cb8 100644 --- a/lib/fog/atmos/storage.rb +++ b/lib/fog/atmos/storage.rb @@ -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) diff --git a/lib/fog/aws/cdn.rb b/lib/fog/aws/cdn.rb index 19bc1e245..78d33144e 100644 --- a/lib/fog/aws/cdn.rb +++ b/lib/fog/aws/cdn.rb @@ -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 diff --git a/lib/fog/aws/dns.rb b/lib/fog/aws/dns.rb index a1012aba7..869ce1126 100644 --- a/lib/fog/aws/dns.rb +++ b/lib/fog/aws/dns.rb @@ -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] diff --git a/lib/fog/aws/storage.rb b/lib/fog/aws/storage.rb index cb0bf190b..e147f2b78 100644 --- a/lib/fog/aws/storage.rb +++ b/lib/fog/aws/storage.rb @@ -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) diff --git a/lib/fog/google/storage.rb b/lib/fog/google/storage.rb index 23a969905..d4839d3ba 100644 --- a/lib/fog/google/storage.rb +++ b/lib/fog/google/storage.rb @@ -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] diff --git a/lib/fog/hp/storage.rb b/lib/fog/hp/storage.rb index e66ccb3ac..72de3a240 100644 --- a/lib/fog/hp/storage.rb +++ b/lib/fog/hp/storage.rb @@ -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.") diff --git a/lib/fog/internet_archive/storage.rb b/lib/fog/internet_archive/storage.rb index 64d136617..aacd4754d 100644 --- a/lib/fog/internet_archive/storage.rb +++ b/lib/fog/internet_archive/storage.rb @@ -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] || {} diff --git a/lib/fog/local/storage.rb b/lib/fog/local/storage.rb index 63555b3a1..17e5f2616 100644 --- a/lib/fog/local/storage.rb +++ b/lib/fog/local/storage.rb @@ -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) diff --git a/lib/fog/ninefold/storage.rb b/lib/fog/ninefold/storage.rb index 0990eca32..6d1a699ec 100644 --- a/lib/fog/ninefold/storage.rb +++ b/lib/fog/ninefold/storage.rb @@ -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 diff --git a/lib/fog/openstack/storage.rb b/lib/fog/openstack/storage.rb index f6636f04b..a38f95b60 100644 --- a/lib/fog/openstack/storage.rb +++ b/lib/fog/openstack/storage.rb @@ -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] diff --git a/lib/fog/rackspace/storage.rb b/lib/fog/rackspace/storage.rb index dec87ef05..0c7db1d78 100644 --- a/lib/fog/rackspace/storage.rb +++ b/lib/fog/rackspace/storage.rb @@ -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] diff --git a/lib/fog/riakcs/provisioning.rb b/lib/fog/riakcs/provisioning.rb index 232e0120d..eecb8b35d 100644 --- a/lib/fog/riakcs/provisioning.rb +++ b/lib/fog/riakcs/provisioning.rb @@ -47,7 +47,6 @@ module Fog include Utils def initialize(options = {}) - require 'mime/types' require 'multi_json' configure_uri_options(options) diff --git a/lib/fog/riakcs/usage.rb b/lib/fog/riakcs/usage.rb index 82cf209dd..cfa815fa3 100644 --- a/lib/fog/riakcs/usage.rb +++ b/lib/fog/riakcs/usage.rb @@ -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) diff --git a/lib/fog/storage.rb b/lib/fog/storage.rb index fefda43ea..30c8014dc 100644 --- a/lib/fog/storage.rb +++ b/lib/fog/storage.rb @@ -1,3 +1,5 @@ +require 'mime/types' + module Fog module Storage