mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
require mime-types from inits
This commit is contained in:
parent
a608cad40f
commit
13bda13933
1 changed files with 17 additions and 0 deletions
|
@ -133,6 +133,20 @@ module Fog
|
|||
https_url(params, expires)
|
||||
end
|
||||
|
||||
def require_mime_types
|
||||
begin
|
||||
# Use mime/types/columnar if available, for reduced memory usage
|
||||
require 'mime/types/columnar'
|
||||
rescue LoadError
|
||||
begin
|
||||
require 'mime/types'
|
||||
rescue LoadError
|
||||
Fog::Logger.warning("'mime-types' missing, please install and try again.")
|
||||
exit(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def request_url(params)
|
||||
params = request_params(params)
|
||||
params_to_url(params)
|
||||
|
@ -406,6 +420,8 @@ module Fog
|
|||
end
|
||||
|
||||
def initialize(options={})
|
||||
require_mime_types
|
||||
|
||||
@use_iam_profile = options[:use_iam_profile]
|
||||
|
||||
@region = options[:region] || DEFAULT_REGION
|
||||
|
@ -473,6 +489,7 @@ module Fog
|
|||
# ==== Returns
|
||||
# * S3 object with connection to aws.
|
||||
def initialize(options={})
|
||||
require_mime_types
|
||||
|
||||
@use_iam_profile = options[:use_iam_profile]
|
||||
@instrumentor = options[:instrumentor]
|
||||
|
|
Loading…
Reference in a new issue