steamcannon-s3 0.3.2 → 0.3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/s3/bucket.rb +15 -7
- data/lib/s3/version.rb +1 -1
- metadata +4 -3
data/lib/s3/bucket.rb
CHANGED
@@ -57,10 +57,18 @@ module S3
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
# Saves the newly built bucket.
|
61
|
-
#
|
62
|
-
|
63
|
-
|
60
|
+
# Saves the newly built bucket.
|
61
|
+
#
|
62
|
+
# ==== Options
|
63
|
+
# * <tt>:location</tt> - location of the bucket
|
64
|
+
# (<tt>:eu</tt> or <tt>us</tt>)
|
65
|
+
# * Any other options are passed through to
|
66
|
+
# Connection#request
|
67
|
+
def save(options = {})
|
68
|
+
unless options.is_a?(Hash)
|
69
|
+
options = {:location => options}
|
70
|
+
end
|
71
|
+
create_bucket_configuration(options)
|
64
72
|
true
|
65
73
|
end
|
66
74
|
|
@@ -117,9 +125,9 @@ module S3
|
|
117
125
|
end
|
118
126
|
end
|
119
127
|
|
120
|
-
def create_bucket_configuration(
|
121
|
-
location = location.to_s.upcase if location
|
122
|
-
options
|
128
|
+
def create_bucket_configuration(options = {})
|
129
|
+
location = options[:location].to_s.upcase if options[:location]
|
130
|
+
options[:headers] ||= {}
|
123
131
|
if location and location != "US"
|
124
132
|
options[:body] = "<CreateBucketConfiguration><LocationConstraint>#{location}</LocationConstraint></CreateBucketConfiguration>"
|
125
133
|
options[:headers][:content_type] = "application/xml"
|
data/lib/s3/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steamcannon-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 93
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
9
|
- 2
|
10
|
-
|
10
|
+
- 1
|
11
|
+
version: 0.3.2.1
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- "Jakub Ku\xC5\xBAma"
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-24 00:00:00 -04:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|