1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Nix hardcoded regions: SES.

This commit is contained in:
Pavel Repin 2012-02-02 15:16:16 -08:00
parent b49cbc2199
commit 02dba9892e

View file

@ -40,7 +40,7 @@ module Fog
#
# ==== Parameters
# * options<~Hash> - config arguments for connection. Defaults to {}.
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-southeast-1']
# * region<~String> - optional region to use. For instance, 'us-east-1' and etc.
#
# ==== Returns
# * SES object with connection to AWS.
@ -52,12 +52,7 @@ module Fog
@connection_options = options[:connection_options] || {}
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region]
when 'us-east-1'
'email.us-east-1.amazonaws.com'
else
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
end
@host = options[:host] || "email.#{options[:region]}.amazonaws.com"
@path = options[:path] || '/'
@persistent = options[:persistent] || false
@port = options[:port] || 443