daemonsy/spree_showcase — pull request #9 by clemens (2012-09-14 22:11:29+00:00)
Title: Fix and improve S3/Heroku integration

This pull request fixes the problems that were introduced in commits a01c15a51dce478e8ac719f520e18603ee1fd706 and 31381bb4019882e5564b92c02c8cdfdacb812fca which were apparently work in progress (according to this branch: https://github.com/daemonsy/spree_showcase/commits/work-in-progress).

Here's the reasoning in detail:

- The existing code caused exceptions in all environments but production. This is now fixed.
- No need to use a constant – a regular variable will do just fine.
- Use Pathname's own #exist? method rather than FileTest.
- There should be no behavior that depends on the Rails environment. It is perfectly acceptable to
use Heroku-like behavior if the user decides to set the according environment variables or use the
config file if the user decides that this makes sense.

If anything's unclear, let me know. :)