lib/fakes3/xml_adapter.rb in plntr-fakes3-1.0.0.pre.10alpha49 vs lib/fakes3/xml_adapter.rb in plntr-fakes3-1.0.0.pre.10alpha50
- old
+ new
@@ -217,30 +217,34 @@
result.ETag("\"#{object.md5}\"")
}
output
end
- # <CompleteMultipartUploadResult>
- # <Location>http://Example-Bucket.s3.amazonaws.com/Example-Object</Location>
- # <Bucket>Example-Bucket</Bucket>
- # <Key>Example-Object</Key>
- # <ETag>"3858f62230ac3c915f300c664312c11f-9"</ETag>
- # </CompleteMultipartUploadResult>
- def self.delete_objects_result(results)
+ # <DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+ # <Deleted>
+ # <Key>sample1.txt</Key>
+ # </Deleted>
+ # <Error>
+ # <Key>sample2.txt</Key>
+ # <Code>AccessDenied</Code>
+ # <Message>Access Denied</Message>
+ # </Error>
+ # </DeleteResult>
+ def self.delete_objects_result(result_objects)
output = ""
xml = Builder::XmlMarkup.new(:target => output)
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
- xml.DeleteResult { |lst|
- results.each do |res|
+ xml.DeleteResult(:xmlns => "http://s3.amazonaws.com/doc/2006-03-01/") { |result|
+ result_objects.each do |res|
if not res[:code].nil?
- lst.Error { |err|
- err.Key(res[:key])
- err.Code(res[:code])
- err.Message(res[:message])
+ result.Error { |error|
+ error.Key(res[:key])
+ error.Code(res[:code])
+ error.Message(res[:message])
}
else
- lst.Deleted { |del|
- del.Key(res[:key])
+ result.Deleted { |deleted|
+ deleted.Key(res[:key])
}
end
end
}
output