Mixin which interfaces with the 'aws' and 'right_aws' libraries.
# File lib/dm-paperclip/storage/s3/aws_library.rb, line 8 def s3_connect! @s3 = Aws::S3.new( @s3_credentials[:access_key_id], @s3_credentials[:secret_access_key] ) @s3_bucket = @s3.bucket(bucket_name) end
# File lib/dm-paperclip/storage/s3/aws_library.rb, line 35 def s3_delete(key) @s3_bucket.key(key).delete end
# File lib/dm-paperclip/storage/s3/aws_library.rb, line 24 def s3_download(key,file) @s3_bucket.key(key).get { |chunk| file.write(chunk) } end
# File lib/dm-paperclip/storage/s3/aws_library.rb, line 20 def s3_exists?(key) @s3_bucket.keys(:prefix => key).any? { |s3_key| s3_key.name == key } end
Generated with the Darkfish Rdoc Generator 2.