5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/httpimagestore/aws_sdk_regions_hack.rb', line 5
def [](name)
return S3::Bucket.new(name.to_s, :owner => nil, :config => config) if client.dns_compatible_bucket_name?(name) and not name.include? '.'
@@location_cache = {} unless defined? @@location_cache
region = @@location_cache[name] || @@location_cache[name] = S3::Bucket.new(name.to_s, :owner => nil, :config => config).location_constraint || @@location_cache[name] = :standard
return S3::Bucket.new(name.to_s, :owner => nil, :config => config) if region == :standard
S3::Bucket.new(name.to_s, :owner => nil, :config => config.with(region: region))
end
|