thoughtbot/paperclip — pull request #837 by michiels (2012-04-21 23:47:29+00:00)
Title: Add expiring_url next to public_url to Fog Storage for S3

This pull request adds expiring_url to the Fog Storage module in the same way that it is used in the original aws-sdk S3 model.

It adds the expiring_url method with tests and it refactors a bit of code for the dynamic hostname and subdomain recognition.

IMPORTANT: There is a bug in Fog where subdomains are not generated correctly for bucket names that are valid subdomain names. This is fixed in https://github.com/fog/fog/pull/857. This pull request contains failing tests that should pass as soon as that new gem version is released.

Please let me know wether I can change these tests to make them work with the current bugged Fog gem or to leave them as they are: failing for now but passing when a new Fog gem gets released.

Also: I had a bit of trouble of finding out the structure of fog_test.rb so please let me know if I modified and added my tests accordingly.

Of course: any feedback on coding style, method names or other stuff much appreciated!