Sha256: bfc6a427685cd954b70a78076824f4a47e90835bb14c93b3650f4da8276b656b
Contents?: true
Size: 1.37 KB
Versions: 1
Compression:
Stored size: 1.37 KB
Contents
# Presss Presss uploads objects to and downloads objects from from Amazon S3. It's a tiny companion to a more complete implementation like AWS SDK. ## Install You can install Presss as a Rubygem or directly from the Git repository if you prefer. ## Configure You start by configuring Presss globally to use a certain bucket in a region with your credentials. Presss.config = { region: 'eu-west-1', bucket_name: 'my-bucket-name', access_key_id: 'access key ID', secret_access_key: 'access key secret' } For valid regions see the AWS documentation. You can test if a region works by getting the hostname for it. In this example the region is `eu-west-1`. $ host s3-eu-west-1.amazonaws.com ## Upload files The `put` method uploads anything that responds to either a `read` or `to_s` method. Currently the entire upload is stored in memory so it's not too great at uploading large files. File.open('as6745it.zip') do |file| Presss.put('books/12/as6745it.zip', file, 'application/zip') end ## Download files The `get` methods downloads the remote object and stores it in a string. Like with the put method this doesn't make it ideal for downloading large files. Presss.get('books/12/as6745it.zip') ## Copying Presss is freely distributable under the terms of an MIT-style license. See COPYING or http://www.opensource.org/licenses/mit-license.php.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
presss-0.9.0 | README.md |