s3cp 1.1.10 → 1.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 1.1.11 (2012-12-13)
2
+
3
+ * Added: Support for requests with 'requester-pays' header (experimental).
4
+ To use, set environment variable S3CP_REQUESTER_PAYS to "1".
5
+ Details @ http://docs.amazonwebservices.com/AmazonS3/latest/dev/RequesterPaysBuckets.html
6
+ and http://docs.amazonwebservices.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
7
+
1
8
  === 1.1.10 (2012-12-13)
2
9
 
3
10
  * Added: New `s3edit` command for easy editing of files.
data/lib/s3cp/utils.rb CHANGED
@@ -211,3 +211,17 @@ module AWS
211
211
  end
212
212
  end
213
213
 
214
+ # Monkey-patch to add requester-pays support (experimental)
215
+ # http://docs.amazonwebservices.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
216
+ if ENV["S3CP_REQUESTER_PAYS"] =~ /(yes|on|1)/i
217
+ class AWS::S3::Request
218
+ def canonicalized_headers
219
+ headers["x-amz-request-payer"] = 'requester' # magic!
220
+ x_amz = headers.select{|name, value| name.to_s =~ /^x-amz-/i }
221
+ x_amz = x_amz.collect{|name, value| [name.downcase, value] }
222
+ x_amz = x_amz.sort_by{|name, value| name }
223
+ x_amz = x_amz.collect{|name, value| "#{name}:#{value}" }.join("\n")
224
+ x_amz == '' ? nil : x_amz
225
+ end
226
+ end
227
+ end
data/lib/s3cp/version.rb CHANGED
@@ -16,5 +16,5 @@
16
16
  # the License.
17
17
 
18
18
  module S3CP
19
- VERSION = "1.1.10"
19
+ VERSION = "1.1.11"
20
20
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3cp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 10
10
- version: 1.1.10
9
+ - 11
10
+ version: 1.1.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Boisvert