Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for us-west-1 and ap-southeast-1 regions in S3 buckets #40

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Gem::Specification.new do |s|
s.name = %q{aws}
s.version = "2.3.25"
s.version = "2.3.9999"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Travis Reeder", "Chad Arimura", "RightScale"]
Expand Down
36 changes: 25 additions & 11 deletions lib/awsbase/support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
#
#
class String #:nodoc:

# Ruby 1.9 introduces an inherit argument for Module#const_get and
# #const_defined? and changes their default behavior.
if Module.method(:const_get).arity == 1
# Constantize tries to find a declared constant with the name specified
# in the string. It raises a NameError when the name is not in CamelCase
# or is not initialized.
Expand All @@ -40,17 +42,29 @@ class String #:nodoc:
# "Module".constantize #=> Module
# "Class".constantize #=> Class
def constantize()
camel_cased_word = self
names = camel_cased_word.split('::')
names.shift if names.empty? || names.first.empty?

constant = Object
names.each do |name|
constant = constant.const_get(name, false) || constant.const_missing(name)
end
constant
camel_cased_word = self
names = camel_cased_word.split('::')
names.shift if names.empty? || names.first.empty?
constant = Object
names.each do |name|
constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
end
constant
end

else
def constantize() #:nodoc:
camel_cased_word = self
names = camel_cased_word.split('::')
names.shift if names.empty? || names.first.empty?

constant = Object
names.each do |name|
constant = constant.const_get(name, false) || constant.const_missing(name)
end
constant
end
end
end


Expand Down
4 changes: 3 additions & 1 deletion lib/s3/right_s3_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ def list_all_my_buckets(headers={})
def create_bucket(bucket, headers={})
data = nil
unless headers[:location].blank?
data = "<CreateBucketConfiguration><LocationConstraint>#{headers[:location].to_s.upcase}</LocationConstraint></CreateBucketConfiguration>"
location = "#{headers[:location]}"
location.upcase! if location == 'eu'
data = "<CreateBucketConfiguration><LocationConstraint>#{location}</LocationConstraint></CreateBucketConfiguration>"
end
req_hash = generate_rest_request('PUT', headers.merge(:url=>bucket, :data => data))
request_info(req_hash, RightHttp2xxParser.new)
Expand Down
Binary file added pkg/aws-2.3.9999.gem
Binary file not shown.