I've got round to packaging my latest attempt at an Amazon S3 library for Ruby into a gem. (For those of you unfamiliar with it, S3 is a network storage solution.) It is less complete than my previous effort, but more solid, more elegant, and with a test suite (which uses RSpec - I haven't added RSpec as a gem dependency (you can ignore the tests if you like), but for reference I developed the tests using RSpec 0.5.12). It has big chunks based on the Amazon S3 Ruby sample code, but I've wrapped it up and made it nice and neat. I've also done things like provide a mechanism for streaming files to S3 (the Amazon sample doesn't do this) using customisable chunk sizes (the Net::HTTP library in Ruby uses 1024 byte chunks by default; mine is customisable). There's lots left to do, of course, but I didn't want another Tuesday to go by without a Ruby Tuesday :).
Download the attached file and install it with a:
gem install s33r-0.1.gem
To use it from inside your Ruby script:
require 's33r'
If you want to see an example program which uses the library, have a look at bin/s3cli.rb. This is a simple command line client which you can use to post a file to S3 and email a link to the file to someone. Useful for sending big files to people without clogging their email inbox with enormous files. It is also intended as a demonstration of how to use the library. Full instructions are included at the top of the file.
By the way, I've tested this on Linux, but not on Windows or Mac.
Anyone aware of other S3 libraries for Ruby?
| Attachment | Size |
|---|---|
| s33r-0.1.gem | 27 KB |
Comments
Your article has helped me
Your article has helped me to understand this subject on a different level. I would like to appreciate your efforts for exploring this issue. Thank you for your information. www.outdoordaybed.net/
A reliable blog always
A reliable blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that characterize a blog to be a best one. where can I buy ink
Wonderful. It’s indeed an
Wonderful. It’s indeed an art to stop new visitors with your attractive writing style. Truly impressive and nice information. Thanks for sharing. giveaway
Future residents are within
Future residents are within a short driving distance to Ang Ko Kio Hub and Compass Point. With such a short drive to the city area as well as the orchard and bugis area, entertainment for your love ones and family will come at a stone’s throw away.
Belgravia Villas Project Details
It's categorized as one of a
It's categorized as one of a great gem. ANd the price is also so expensive but it's also depend on the source and quality too.
structured settlement quotes
nice blog
This part of the reference to the text in the example,best sunglasses
the language is too flat, can be amended as appropriate, to make the language more vivid.
nice blog but if u talk
nice blog but if u talk about the ruby so i want to told Yoruba that ruby is very fine gem of red color and itss very effective.
Austin Locksmith
and bookmark
and bookmark http://onlinecasinochecklist.co.uk/
Your blog has been saved to
Your blog has been saved to my bookmarks and I have also shot out an email to my friends look forward to reading more posts in the future!
social work college
bestpokerarticles
http://www.bestpokerarticles.com | his was really interesting info in this blog that to very happy for the nice technology in this blog. I am really admired for this info in this blog that to very much enjoyed for the great technology in this blog. It was searching the nice approach is visible in this blog that to way of presentation is really great. I am really thank you very much for the nice info in this blog that to utilize the nice info in this blog.
My brother recommended I
My brother recommended I would possibly like this website. He used to be totally right. This publish truly made my day. You can not imagine just how much time I had spent for this info! Thank you! - toko tas branded wanita
Again they donât must be
Again they donât must be connected pass4sure 350-029 to see all of that. In the event that they are connected to somebody you connected with they will see those notifications in http://www.pass4sure-tests.com/test/350-029.html the activity feed.
This became truly very
This became truly very helpful site. I truly enjoyed what sort of written content had been published. I will be content to help save this web site in to our folder. Many thanks! The way you express yourself is awesome.Hey, your blog is great.. -
asthmahealtharticles.com
Stingray has subscription
Stingray has subscription and pay as you grow strategies both for rush essay and for use in private clouds, enabling you to right size your ADC for the use case at hand.
when what
Comparing the situation to 1931, when what might have been a severe recession was transformed by similar austerity policies Survival Guide into a decade-long crisis which would lead to war, he bemoans the fact that ‘none of this should be happening.
I understand the money
I understand the money issue, I had nice discussion about the topic named pds behandeling last week. And your post reminds me of that. How do you become this good? It's incredible to find out someone place such a lot of interest towards a topic. Great post about this. I'm surprised to see someone so educated in the matter. - Hotel Murah Semarang
I’ve read this put up and
I’ve read this put up and if I could I desire to counsel you some healthcare products you can write subsequent articles regarding this article. I want to learn more things about it!
easy
This certainly makes using the Amazon service a lot easier. I have been playing with various ruby installs on a rackspace account, but have not seen anything like this one. I hope that I can get it installed and find good use on my production machine. Thanks for all your work on this.
The library still seem a bit
The library still seem a bit slow, but it's difficult to track where the bottleneck is.. Thanks for sharing this informative read.
Thanks !
One idea I may like to add is a database list of the buckets with a "synch" option to, well - synch.
The database could also hold header and acl info?
Regards
Peter
(I was using the old pre gem version and did find it loaded a little slowly.)
Sync is something I'm
Sync is something I'm looking at at the moment. I definitely need this myself, as I'd like to do a kind of rsync to S3 eventually. And it would make sense to do some caching, though this would be tricky in a sync situation. The library still seem a bit slow, but it's difficult to track where the bottleneck is: in the Ruby code, the network, or S3 itself. I'm looking into it.
It din't work on window xp
It din't work on window xp
put_text() typo?
Thanks for making this gem elliot!
In the put_text() method, I think the params to put_resource() are transposed. Line 131 of client.rb should be:
put_resource(string, bucket_name, resource_key, headers)
instead of:
put_resource(bucket_name, resource_key, string, headers)
Or I could be completely wrong, I've only been trying it out for a few minutes.
Thanks for the comment
Dear Keaka, you're right, I was being inconsistent with parameter placements. I will sort this out before the next version.
Do you mean the S3 gem
Do you mean the S3 gem throws out an internal server error? Does this happen during connections to S3? Or are you talking about the Rails application?
It works fine on a Mac, but
It works fine on a Mac, but on FreeBSD, it chucks out a Http/1.1 Internal Server Error for any request. Any idea why this could be?
reply
This unique clearly would make using the Amazon online marketplace product a lot easier
suellena