github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

john / bucket_head

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 3
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Gem to hit URI's and stick their contents on S3 — Read more

  cancel

http://github.com/john/bucket_head/tree/master

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

updated copyright/license 
john (author)
Wed Jul 15 04:47:06 -0700 2009
commit  9e873b47042b96c15d72d51c61147c268b63fd28
tree    61ef2bff0a2f830da9a50b1ef23f15cc00faa5e4
parent  c2e0283c3032897ac09937db6f6f39b2870073b5
bucket_head /
name age
history
message
file .document Tue Jul 14 12:53:04 -0700 2009 first commit [john]
file .gitignore Tue Jul 14 12:53:04 -0700 2009 first commit [john]
file .specification Tue Jul 14 12:53:04 -0700 2009 first commit [john]
file LICENSE Tue Jul 14 12:53:04 -0700 2009 first commit [john]
file README.rdoc Wed Jul 15 04:47:06 -0700 2009 updated copyright/license [john]
file Rakefile Loading commit data...
file VERSION.yml Tue Jul 14 12:53:04 -0700 2009 first commit [john]
file bucket_head.gemspec
directory lib/ Wed Jul 15 04:43:28 -0700 2009 added null check to bucket_access [john]
directory test/ Tue Jul 14 17:35:44 -0700 2009 improved test coverage [john]
README.rdoc

BucketHead

BucketHead grabs the contents of a URI—an image, html or xml file, whatever—and sticks them on S3. It requires either the RightAWS or AWS/S3 libraries. If both are present it uses RightAWS.

Install:

  sudo gem install john-bucket_head-0.1.0 --source http://gems.github.com

Usage:

Make a hash available in your environment called AWS_CREDENTIALS holding, yes, your AWS credential. In Rails you can create a config/initializers/amazon_credentials.rb file containing:

  AWS_CREDENTIALS = { :access_key => 'your-key-goes-here',
                      :secret_access_key => 'your-top-secret-key-goes-here'}

Then you can do something like t:

  BucketHead.set_bucket_name('your-bucket')
  BucketHead.put( :uri => 'http://wordie.org/', :key => 'fake-wordie.html')

That would result in the source of wordie.org/ being uploaded to: your-bucket.s3.amazonaws.com/fake-wordie.html

By default buckets and anything put in them have ‘public-read’ access. You can set bucket permissions, if, prior to bucket creation, you call:

  BucketHead.set_bucket_access( 'public-read|private|public-read-write|authenticated-read')

You can set access on individual objects within buckets with an ’:access’ argument:

  BucketHead.put( :uri => 'http://wordie.org/', :key => 'fake-wordie.html', :access => 'private')

BucketHead will try to base the content type on what it finds at the :uri, but you can set it explicitly if you want:

  BucketHead.put( :uri => 'http://wordie.org/', :key => 'fake-wordie.html', :access => 'private', :content_type => 'text/html')

Copyright

Copyright © 2009 John McGrath, released under the MIT License. See LICENSE for details.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server