public
Description: Treat an ActiveRecord model as a file attachment, storing its patch, size, content type, etc.
Homepage: http://weblog.techno-weenie.net
Clone URL: git://github.com/technoweenie/attachment_fu.git
Search Repo:
Click here to lend your support to: attachment_fu and make a donation at www.pledgie.com !
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.
francois (author)
Thu Apr 17 17:57:20 -0700 2008
commit  0598b0b33a3ab0e62f27bc261c8d4f4360282166
tree    b9af22535b0b37e00d41892c5a7f935729dcc261
parent  9610d9cc764026727f02cb623751e497898e35f9
...
 
 
 
1
2
3
...
29
30
31
32
33
 
...
1
2
3
4
5
6
...
32
33
34
 
35
36
0
@@ -1,3 +1,6 @@
0
+* Apr 17 2008 *
0
+* amazon_s3.yml is now passed through ERB before being passed to AWS::S3 [François Beausoleil]
0
+
0
 * Mar 22 2008 *
0
 * Some tweaks to support Rails 2.0 and Rails 2.1 due to ActiveSupport::Callback changes.
0
   Thanks to http://blog.methodmissing.com/2008/1/19/edge-callback-refactorings-attachment_fu/
0
@@ -29,4 +32,4 @@
0
 * make #current_data public with db_file and s3 backends [ebryn]
0
 * oops, actually svn add the files for s3 backend. [Jeffrey Hardy]
0
 * experimental s3 support, egad, no tests.... [Jeffrey Hardy]
0
-* doh, fix a few bad references to ActsAsAttachment [sixty4bit]
0
\ No newline at end of file
0
+* doh, fix a few bad references to ActsAsAttachment [sixty4bit]
...
133
134
135
136
 
137
138
139
...
133
134
135
 
136
137
138
139
0
@@ -133,7 +133,7 @@ module Technoweenie # :nodoc:
0
 
0
           begin
0
             @@s3_config_path = base.attachment_options[:s3_config_path] || (RAILS_ROOT + '/config/amazon_s3.yml')
0
- @@s3_config = @@s3_config = YAML.load_file(@@s3_config_path)[RAILS_ENV].symbolize_keys
0
+ @@s3_config = @@s3_config = YAML.load(ERB.new(File.read(@@s3_config_path)).result)[RAILS_ENV].symbolize_keys
0
           #rescue
0
           # raise ConfigFileNotFoundError.new('File %s not found' % @@s3_config_path)
0
           end

Comments

    No one has commented yet.