S3File

Interact with your Amazon S3 bucket.

  • Move objects between S3 and your system.

  • Create buckets.

  • Delete buckets.

  • Fix buckets.

Installation

The gem requires you to have s3cmd a Python library for transfer of files, installed. s3tools.org/s3cmd.

Usage

The gem was designed to be similar to File class in Ruby. Thus you can use ls, cp_r, cp_rf, rm etc. You will need to start out with setting at the minimum a

:access_key and a 
:secret_access_key

so..

require 'rubygems'
require 's3file'
S3File.new(:access_key => 'blahblah', :secret_access_key => 'blahblah')

then use the code as you would normally would

S3File.ls("s3://bucket")
S3File.cp("s3://bucket/file.rb", ".")
S3File.cp_r("s3://bucket/files/", ".")
S3File.rm("s3://bucket/file.rb")

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 glen. See LICENSE for details.