/has_bucket

Simple wrapper around single-bucket S3 storage

Primary LanguageRubyMIT LicenseMIT

I Has a Bucket

Build Status

I Has a Bucket

Simple wrapper around single-bucket S3 storage.

Installation

Add this line to your application's Gemfile:

gem 'haz_bucket'

And then execute:

$ bundle

Or install it yourself as:

$ gem install haz_bucket

Usage

s3 = HazBucket.of("https://AWS_ACCESS_KEY:AWS_SECRET_ACCESS_KEY@s3.amazonaws.com/BUCKET_NAME")

s3.include?("key") # => false
s3["key"] = "value"
s3["key"] # => "value"
s3.include?("key") # => true
s3.delete("key")
s3.include?("key") # => false
s3.url_for("key") # => authenticated URL to object

TODO

  • select region based on hostname

Contributing

  1. Fork it ( https://github.com/JonathonMA/has_bucket/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request