Permalink
Browse files

Made the amazon_s3.yml file go through ERB before being read by YAML.…

…load.

This allows us to set the Amazon keys through the environment, and not put them under version control.
  • Loading branch information...
1 parent 9610d9c commit 0598b0b33a3ab0e62f27bc261c8d4f4360282166 @francois francois committed Apr 18, 2008
Showing with 5 additions and 2 deletions.
  1. +4 −1 CHANGELOG
  2. +1 −1 lib/technoweenie/attachment_fu/backends/s3_backend.rb
View
@@ -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/
@@ -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]
@@ -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

0 comments on commit 0598b0b

Please sign in to comment.