Amazon S3 Library for REST in Ruby

Sample Code & Libraries>Amazon S3 Library for REST in Ruby
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

A library in Ruby for working with the Amazon S3 REST interface.

Details

Submitted By: EricW@AWS
AWS Products Used: Amazon S3
Language(s): Ruby
License: New BSD
Created On: March 13, 2006 8:26 PM GMT
Last Updated: September 21, 2008 9:17 PM GMT
Download

About This Sample

  • A library in Ruby for working with the Amazon S3 REST interface.
  • Part of a collection of interface libraries, each in a different language.
  • Updated on 2006-06-16 to use the list delimiter.
  • See the README file in the download for more information about the sample.

What's New?

  • 2007-11-05: Updates to support EU
  • 2007-05-18: Updates to support signed HTTP requests to virtual hosted buckets.
  • 2006-10-02: Updates for server access logging.
  • 2006-06-28:  Fixed query string authentication tests.

Prerequisites

Running the Sample

  • See the README file in the attached download for information on running the sample.

Comments

Problems with tests
The first time you run the test suite you get two errors: 1) Failure: test_operations(TC_AWSAuthConnectionTest) [s3-test.rb:196:in `verify_list_bucket_response' s3-test.rb:213:in `do_delimited_list' s3-test.rb:62:in `test_operations' s3-test.rb:35:in `each' s3-test.rb:35:in `test_operations']: bucket name should match. expected but was . 2) Failure: test_operations(TC_QueryStringAuthGeneratorTest) [s3-test.rb:254:in `check_url' C:/ruby/lib/ruby/1.8/net/http.rb:543:in `start' s3-test.rb:242:in `check_url' s3-test.rb:298:in `test_operations' s3-test.rb:265:in `each' s3-test.rb:265:in `test_operations']: delete bucket. > expected to be an instance of but was . From the second time and going on you get a different error in place of the first one (you keep getting the second): 1) Failure: test_operations(TC_AWSAuthConnectionTest) method test_operations in s3-test.rb at line 45 method each in s3-test.rb at line 37 method test_operations in s3-test.rb at line 37 bucket is empty. expected but was . That's no good.
Giovanni Intini on June 21, 2007 9:25 AM GMT
Make me a gem
I agree. You guys did a great job but it would be nice if all I had to type was script/plugin install ... or gem install.
jumb0 on May 21, 2007 6:26 PM GMT
Not impressed with the ruby on rails support
First of all, I think it's a little confusing to distribute the library files for using the Amazon S3 in Ruby on Rails through the "Code Samples" folder. Package it up in a gem and get it listed in one of the primary Gem repositories. I couldn't get the included tests to run: Loaded suite s3-test Started EF Finished in 75.264583 seconds. 1) Error: test_operations(TC_AWSAuthConnectionTest): Errno::ETIMEDOUT: Operation timed out - connect(2) /usr/local/lib/ruby/1.8/net/http.rb:560:in `initialize' /usr/local/lib/ruby/1.8/net/http.rb:560:in `open' /usr/local/lib/ruby/1.8/net/http.rb:560:in `connect' /usr/local/lib/ruby/1.8/timeout.rb:48:in `timeout' /usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout' /usr/local/lib/ruby/1.8/net/http.rb:560:in `connect' /usr/local/lib/ruby/1.8/net/http.rb:553:in `do_start' /usr/local/lib/ruby/1.8/net/http.rb:542:in `start' ./S3.rb:194:in `make_request' ./S3.rb:125:in `create_bucket' s3-test.rb:27:in `test_operations' 2) Failure: test_operations(TC_QueryStringAuthGeneratorTest) [s3-test.rb:243:in `check_url' /usr/local/lib/ruby/1.8/net/http.rb:543:in `start' s3-test.rb:231:in `check_url' s3-test.rb:250:in `test_operations']: create_bucket. > expected to be an instance of but was . 2 tests, 1 assertions, 1 failures, 1 errors
Ryan Hanks on May 6, 2007 10:05 PM GMT
We are temporarily not accepting new comments.
©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.