Skip to content

Commit

Permalink
Made the amazon_s3.yml file go through ERB before being read by YAML.…
Browse files Browse the repository at this point in the history
…load.

This allows us to set the Amazon keys through the environment, and not put them under version control.
  • Loading branch information
francois committed Apr 18, 2008
1 parent 9610d9c commit 0598b0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG
@@ -1,3 +1,6 @@
* Apr 17 2008 *
* amazon_s3.yml is now passed through ERB before being passed to AWS::S3 [François Beausoleil]

* Mar 22 2008 *
* Some tweaks to support Rails 2.0 and Rails 2.1 due to ActiveSupport::Callback changes.
Thanks to http://blog.methodmissing.com/2008/1/19/edge-callback-refactorings-attachment_fu/
Expand Down Expand Up @@ -29,4 +32,4 @@
* make #current_data public with db_file and s3 backends [ebryn]
* oops, actually svn add the files for s3 backend. [Jeffrey Hardy]
* experimental s3 support, egad, no tests.... [Jeffrey Hardy]
* doh, fix a few bad references to ActsAsAttachment [sixty4bit]
* doh, fix a few bad references to ActsAsAttachment [sixty4bit]
2 changes: 1 addition & 1 deletion lib/technoweenie/attachment_fu/backends/s3_backend.rb
Expand Up @@ -133,7 +133,7 @@ def self.included(base) #:nodoc:

begin
@@s3_config_path = base.attachment_options[:s3_config_path] || (RAILS_ROOT + '/config/amazon_s3.yml')
@@s3_config = @@s3_config = YAML.load_file(@@s3_config_path)[RAILS_ENV].symbolize_keys
@@s3_config = @@s3_config = YAML.load(ERB.new(File.read(@@s3_config_path)).result)[RAILS_ENV].symbolize_keys
#rescue
# raise ConfigFileNotFoundError.new('File %s not found' % @@s3_config_path)
end
Expand Down

0 comments on commit 0598b0b

Please sign in to comment.