plntr-fakes3 1.0.0.pre.10alpha18 → 1.0.0.pre.10alpha19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fakes3/server.rb +15 -3
- data/lib/fakes3/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4f3dd232ea3bdee5ad78e6855d033f4830ffbd503bdf75409a9dcbea71c5629
|
4
|
+
data.tar.gz: 60105e7a1fe4349af31d04ec259478607eea58fdde9c602eb1441399a11a03ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8096b795b6f9a11b9e8a0ba732bbb25058b3404cc130bf918be5209a2ed0205cbb8ea9a27024f332f2b5fc87d8521b86ec10cbb6640eadbb237f0292a96b5d70
|
7
|
+
data.tar.gz: 821e571c3a59778d3a1fd0239a8443fd9e59e28e26ace8eb261307e629039afc96bb1422981ecda8a155300ae8fcb4e8e37c01fcfd896c5a1b2b5cfc22962f6f
|
data/lib/fakes3/server.rb
CHANGED
@@ -25,6 +25,7 @@ module FakeS3
|
|
25
25
|
SET_ACL = "SET_ACL"
|
26
26
|
MOVE = "MOVE"
|
27
27
|
DELETE_OBJECT = "DELETE_OBJECT"
|
28
|
+
DELETE_OBJECTS = "DELETE_OBJECTS"
|
28
29
|
DELETE_BUCKET = "DELETE_BUCKET"
|
29
30
|
|
30
31
|
attr_accessor :bucket, :object, :type, :src_bucket,
|
@@ -247,6 +248,10 @@ module FakeS3
|
|
247
248
|
def do_POST(request,response)
|
248
249
|
dump_request request
|
249
250
|
s_req = normalize_request(request)
|
251
|
+
if s_req.type == Request::DELETE_OBJECTS
|
252
|
+
return do_DELETE(request, response)
|
253
|
+
end
|
254
|
+
|
250
255
|
key = request.query['key']
|
251
256
|
query = CGI::parse(request.request_uri.query || "")
|
252
257
|
|
@@ -323,12 +328,15 @@ module FakeS3
|
|
323
328
|
when Request::DELETE_OBJECT
|
324
329
|
bucket_obj = @store.get_bucket(s_req.bucket)
|
325
330
|
@store.delete_object(bucket_obj,s_req.object,s_req.webrick_request)
|
331
|
+
response.status = 204
|
332
|
+
response.body = ""
|
326
333
|
when Request::DELETE_BUCKET
|
327
334
|
@store.delete_bucket(s_req.bucket)
|
335
|
+
response.status = 204
|
336
|
+
response.body = ""
|
337
|
+
when Request::DELETE_OBJECTS
|
328
338
|
end
|
329
339
|
|
330
|
-
response.status = 204
|
331
|
-
response.body = ""
|
332
340
|
end
|
333
341
|
|
334
342
|
def do_OPTIONS(request, response)
|
@@ -473,6 +481,10 @@ module FakeS3
|
|
473
481
|
else
|
474
482
|
s_req.object = path[1..-1]
|
475
483
|
end
|
484
|
+
|
485
|
+
if webrick_req.query_string =~ /\bdelete\b/i
|
486
|
+
s_req.type = Request::DELETE_OBJECTS
|
487
|
+
end
|
476
488
|
end
|
477
489
|
|
478
490
|
# This method takes a webrick request and generates a normalized FakeS3 request
|
@@ -528,7 +540,7 @@ module FakeS3
|
|
528
540
|
warn "----------Dump Request-------------"
|
529
541
|
warn request.request_method
|
530
542
|
warn request.path
|
531
|
-
warn request.
|
543
|
+
warn request.query
|
532
544
|
request.each do |k,v|
|
533
545
|
warn "#{k}:#{v}"
|
534
546
|
end
|
data/lib/fakes3/version.rb
CHANGED