steamcannon-s3 0.3.2 → 0.3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/s3/bucket.rb +15 -7
  2. data/lib/s3/version.rb +1 -1
  3. 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. Optionally you can pass location
61
- # of the bucket (<tt>:eu</tt> or <tt>:us</tt>)
62
- def save(location = nil)
63
- create_bucket_configuration(location)
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(location = nil)
121
- location = location.to_s.upcase if location
122
- options = { :headers => {} }
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
@@ -1,3 +1,3 @@
1
1
  module S3
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.2.1"
3
3
  end
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: 23
4
+ hash: 93
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
9
  - 2
10
- version: 0.3.2
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-23 00:00:00 -04:00
19
+ date: 2010-09-24 00:00:00 -04:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency