qoobaa/s3 — pull request #77 by andresf (2013-06-05 18:23:43+00:00)
Title: Support for virtual-host style 

The current private methods that generate signatures (e.g. `canonicalized_resource`) allow for virtual-host style, but the public methods that get called don't actually have a way to signal virtual-host style.

This PR adds the `add_bucket_to_host` flag to signal that a virtual-host signature should be created.

Example (spec):

```
+ test "temporary url for object get with bucket in the hostname" do
+ actual = S3::Signature.generate_temporary_url(
+ :bucket => "johnsmith",
+ :resource => "photos/puppy.jpg",
+ :secret_access_key => "uV3F3YluFJax1cknvbcGwgjvx4QpvB+leU8dUj2o",
+ :expires_at => 1175046589,
+ :add_bucket_to_host => true
+ )
+ expected = "http://johnsmith.s3.amazonaws.com/photos/puppy.jpg?AWSAccessKeyId=&Expires=1175046589&Signature=gs6xNznrLJ4Bd%2B1y9pcy2HOSVeg%3D"
+ assert_equal expected, actual
+ end
```