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
Click here to lend your support to: attachment_fu and make a donation at www.pledgie.com !
experimental s3 support, egad, no tests.... [Jeffrey Hardy]

git-svn-id: 
http://svn.techno-weenie.net/projects/plugins/attachment_fu@2574 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sat Dec 23 01:39:34 -0800 2006
commit  f4d6fbd2d31c9a908f09d0ec48d83ae7dcbf1aa8
tree    83a70153e58f34b0beca8c32ab79df88c1a14350
parent  43d1298a0cbba0205b0cc7ab9c657f8f5be0873a
...
 
 
 
 
1
2
...
1
2
3
4
5
6
0
@@ -1 +1,5 @@
0
+require 'fileutils'
0
+
0
+s3_config = File.dirname(__FILE__) + '/../../../config/amazon_s3.yml'
0
+FileUtils.cp File.dirname(__FILE__) + '/amazon_s3.yml.tpl', s3config unless File.exist?(s3_config)
0
 puts IO.read(File.join(File.dirname(__FILE__), 'README'))
0
\ No newline at end of file
...
10
11
12
13
14
15
16
17
18
19
20
21
22
 
 
 
 
 
 
 
 
 
 
23
24
25
...
34
35
36
 
37
38
39
...
10
11
12
 
 
 
 
 
 
 
 
 
 
13
14
15
16
17
18
19
20
21
22
23
24
25
...
34
35
36
37
38
39
40
0
@@ -10,16 +10,16 @@ module Technoweenie # :nodoc:
0
 
0
     module ActMethods
0
       # Options:
0
- # <tt>:content_type</tt> - Allowed content types. Allows all by default. Use :image to allow all standard image types.
0
- # <tt>:min_size</tt> - Minimum size allowed. 1 byte is the default.
0
- # <tt>:max_size</tt> - Maximum size allowed. 1.megabyte is the default.
0
- # <tt>:size</tt> - Range of sizes allowed. (1..1.megabyte) is the default. This overrides the :min_size and :max_size options.
0
- # <tt>:resize_to</tt> - Used by RMagick to resize images. Pass either an array of width/height, or a geometry string.
0
- # <tt>:thumbnails</tt> - Specifies a set of thumbnails to generate. This accepts a hash of filename suffixes and RMagick resizing options.
0
- # <tt>:thumbnail_class</tt> - Set what class to use for thumbnails. This attachment class is used by default.
0
- # <tt>:file_system_path</tt> - path to store the uploaded files. Uses public/#{table_name} by default.
0
- # Setting this sets the :storage to :file_system.
0
- # <tt>:storage</tt> - Use :file_system to specify the attachment data is stored with the file system. Defaults to :db_system.
0
+ # * <tt>:content_type</tt> - Allowed content types. Allows all by default. Use :image to allow all standard image types.
0
+ # * <tt>:min_size</tt> - Minimum size allowed. 1 byte is the default.
0
+ # * <tt>:max_size</tt> - Maximum size allowed. 1.megabyte is the default.
0
+ # * <tt>:size</tt> - Range of sizes allowed. (1..1.megabyte) is the default. This overrides the :min_size and :max_size options.
0
+ # * <tt>:resize_to</tt> - Used by RMagick to resize images. Pass either an array of width/height, or a geometry string.
0
+ # * <tt>:thumbnails</tt> - Specifies a set of thumbnails to generate. This accepts a hash of filename suffixes and RMagick resizing options.
0
+ # * <tt>:thumbnail_class</tt> - Set what class to use for thumbnails. This attachment class is used by default.
0
+ # * <tt>:file_system_path</tt> - path to store the uploaded files. Uses public/#{table_name} by default.
0
+ # Setting this sets the :storage to :file_system.
0
+ # * <tt>:storage</tt> - Use :file_system to specify the attachment data is stored with the file system. Defaults to :db_system.
0
       #
0
       # Examples:
0
       # has_attachment :max_size => 1.kilobyte
0
@@ -34,6 +34,7 @@ module Technoweenie # :nodoc:
0
       # :content_type => :image, :resize_to => [50,50]
0
       # has_attachment :storage => :file_system, :file_system_path => 'public/files',
0
       # :thumbnails => { :thumb => [50, 50], :geometry => 'x50' }
0
+ # has_attachment :storage => :s3
0
       def has_attachment(options = {})
0
         # this allows you to redefine the acts' options for each subclass, however
0
         options[:min_size] ||= 1

Comments

    No one has commented yet.