lib/dynamodb/streams/client.rb in dynamodb-streams-client-0.0.1 vs lib/dynamodb/streams/client.rb in dynamodb-streams-client-0.0.2

- old
+ new

@@ -32,10 +32,15 @@ def initialize(options) @accessKeyId = options.fetch(:access_key_id) @secretAccessKey = options.fetch(:secret_access_key) @endpoint = URI.parse(options.fetch(:endpoint)) - @region = options[:region] || /([^.]+)\.amazonaws\.com\z/.match(@endpoint.host)[1] + @region = options[:region] + + unless @region or @region = (/([^.]+)\.amazonaws\.com\z/.match(@endpoint.host) || [])[1] + @region = [@endpoint.host, @endpoint.port].join(':') + end + @timeout = DEFAULT_TIMEOUT @debug = false @retry_num = 3 @retry_intvl = 10 end