How to delete files using the right-aws gem
I need to find out how to delet a file on my S3 bucket using the right-aws gem (https://github.com/rightscale/right_aws). The current doc (the README at github) isn't very helpful...
Has anyone tried doing som开发者_运维知识库ething similar and would like to share their findings?
The best is AWS::S3
RightAws::S3::Key have a method called delete. Click here for documentation.
With the newly released aws-sdk gem you can delete a file like so:
s3 = AWS::S3.new(:access_key_id => '...', :secret_access_key => '...')
s3.buckets['YOUR_BUCKET_NAME'].objects['OBJECT_KEY'].delete
精彩评论