lib/jekyll-s3/endpoint.rb in jekyll-s3-2.4.2 vs lib/jekyll-s3/endpoint.rb in jekyll-s3-2.4.3
- old
+ new
@@ -1,10 +1,12 @@
module Jekyll
module S3
class Endpoint
+ DEFAULT_LOCATION_CONSTRAINT = 'us-east-1'
attr_reader :region, :location_constraint, :hostname, :website_hostname
- def initialize(location_constraint)
+ def initialize(location_constraint=nil)
+ location_constraint = DEFAULT_LOCATION_CONSTRAINT if location_constraint.nil?
raise "Invalid S3 location constraint #{location_constraint}" unless
location_constraints.has_key?location_constraint
@region = location_constraints.fetch(location_constraint)[:region]
@hostname = location_constraints.fetch(location_constraint)[:endpoint]
@website_hostname = location_constraints.fetch(location_constraint)[:website_hostname]