aboisvert_aws 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/awsbase/right_awsbase.rb +116 -116
- data/lib/awsbase/version.rb +1 -1
- data/lib/s3/right_s3_interface.rb +167 -167
- data/lib/s3/right_s3_interface.rb.orig +1231 -0
- data/lib/s3/right_s3_interface.rb.rej +37 -0
- metadata +6 -4
@@ -0,0 +1,37 @@
|
|
1
|
+
--- lib/s3/right_s3_interface.rb
|
2
|
+
+++ lib/s3/right_s3_interface.rb
|
3
|
+
@@ -657,6 +659,34 @@
|
4
|
+
on_exception
|
5
|
+
end
|
6
|
+
|
7
|
+
+ # Deletes multiple keys. Returns an array with errors, if any.
|
8
|
+
+ #
|
9
|
+
+ # s3.delete_multiple('my_awesome_bucket', ['key1', 'key2', ...)
|
10
|
+
+ # #=> [ { :key => 'key2', :code => 'AccessDenied', :message => "Access Denied" } ]
|
11
|
+
+ #
|
12
|
+
+ def delete_multiple(bucket, keys=[], headers={})
|
13
|
+
+ errors = []
|
14
|
+
+ keys = Array.new(keys)
|
15
|
+
+ while keys.length > 0
|
16
|
+
+ data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
17
|
+
+ data += "<Delete>\n<Quiet>true</Quiet>\n"
|
18
|
+
+ keys.take(MULTI_OBJECT_DELETE_MAX_KEYS).each do |key|
|
19
|
+
+ data += "<Object><Key>#{AwsUtils::xml_escape(key)}</Key></Object>\n"
|
20
|
+
+ end
|
21
|
+
+ data += "</Delete>"
|
22
|
+
+ req_hash = generate_rest_request('POST', headers.merge(
|
23
|
+
+ :url => "#{bucket}?delete",
|
24
|
+
+ :data => data,
|
25
|
+
+ 'content-md5' => AwsUtils::content_md5(data)
|
26
|
+
+ ))
|
27
|
+
+ errors += request_info(req_hash, S3DeleteMultipleParser.new)
|
28
|
+
+ keys = keys.drop(MULTI_OBJECT_DELETE_MAX_KEYS)
|
29
|
+
+ end
|
30
|
+
+ errors
|
31
|
+
+ rescue
|
32
|
+
+ on_exception
|
33
|
+
+ end
|
34
|
+
+
|
35
|
+
# Copy an object.
|
36
|
+
# directive: :copy - copy meta-headers from source (default value)
|
37
|
+
# :replace - replace meta-headers by passed ones
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aboisvert_aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 1
|
10
|
+
version: 3.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- RightScale, Inc.
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-12-
|
18
|
+
date: 2011-12-19 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
prerelease: false
|
@@ -148,6 +148,8 @@ files:
|
|
148
148
|
- lib/route_53/right_route_53_interface.rb
|
149
149
|
- lib/s3/right_s3.rb
|
150
150
|
- lib/s3/right_s3_interface.rb
|
151
|
+
- lib/s3/right_s3_interface.rb.orig
|
152
|
+
- lib/s3/right_s3_interface.rb.rej
|
151
153
|
- lib/sdb/active_sdb.rb
|
152
154
|
- lib/sdb/right_sdb_interface.rb
|
153
155
|
- lib/sns/right_sns_interface.rb
|