Skip to content
Browse files

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
  • Loading branch information...
1 parent 43d1298 commit f4d6fbd2d31c9a908f09d0ec48d83ae7dcbf1aa8 technoweenie committed Dec 23, 2006
Showing with 15 additions and 10 deletions.
  1. +4 −0 install.rb
  2. +11 −10 lib/technoweenie/attachment_fu.rb
View
4 install.rb
@@ -1 +1,5 @@
+require 'fileutils'
+
+s3_config = File.dirname(__FILE__) + '/../../../config/amazon_s3.yml'
+FileUtils.cp File.dirname(__FILE__) + '/amazon_s3.yml.tpl', s3config unless File.exist?(s3_config)
puts IO.read(File.join(File.dirname(__FILE__), 'README'))
View
21 lib/technoweenie/attachment_fu.rb
@@ -10,16 +10,16 @@ class AttachmentError < StandardError; end
module ActMethods
# Options:
- # <tt>:content_type</tt> - Allowed content types. Allows all by default. Use :image to allow all standard image types.
- # <tt>:min_size</tt> - Minimum size allowed. 1 byte is the default.
- # <tt>:max_size</tt> - Maximum size allowed. 1.megabyte is the default.
- # <tt>:size</tt> - Range of sizes allowed. (1..1.megabyte) is the default. This overrides the :min_size and :max_size options.
- # <tt>:resize_to</tt> - Used by RMagick to resize images. Pass either an array of width/height, or a geometry string.
- # <tt>:thumbnails</tt> - Specifies a set of thumbnails to generate. This accepts a hash of filename suffixes and RMagick resizing options.
- # <tt>:thumbnail_class</tt> - Set what class to use for thumbnails. This attachment class is used by default.
- # <tt>:file_system_path</tt> - path to store the uploaded files. Uses public/#{table_name} by default.
- # Setting this sets the :storage to :file_system.
- # <tt>:storage</tt> - Use :file_system to specify the attachment data is stored with the file system. Defaults to :db_system.
+ # * <tt>:content_type</tt> - Allowed content types. Allows all by default. Use :image to allow all standard image types.
+ # * <tt>:min_size</tt> - Minimum size allowed. 1 byte is the default.
+ # * <tt>:max_size</tt> - Maximum size allowed. 1.megabyte is the default.
+ # * <tt>:size</tt> - Range of sizes allowed. (1..1.megabyte) is the default. This overrides the :min_size and :max_size options.
+ # * <tt>:resize_to</tt> - Used by RMagick to resize images. Pass either an array of width/height, or a geometry string.
+ # * <tt>:thumbnails</tt> - Specifies a set of thumbnails to generate. This accepts a hash of filename suffixes and RMagick resizing options.
+ # * <tt>:thumbnail_class</tt> - Set what class to use for thumbnails. This attachment class is used by default.
+ # * <tt>:file_system_path</tt> - path to store the uploaded files. Uses public/#{table_name} by default.
+ # Setting this sets the :storage to :file_system.
+ # * <tt>:storage</tt> - Use :file_system to specify the attachment data is stored with the file system. Defaults to :db_system.
#
# Examples:
# has_attachment :max_size => 1.kilobyte
@@ -34,6 +34,7 @@ module ActMethods
# :content_type => :image, :resize_to => [50,50]
# has_attachment :storage => :file_system, :file_system_path => 'public/files',
# :thumbnails => { :thumb => [50, 50], :geometry => 'x50' }
+ # has_attachment :storage => :s3
def has_attachment(options = {})
# this allows you to redefine the acts' options for each subclass, however
options[:min_size] ||= 1

0 comments on commit f4d6fbd

Please sign in to comment.
Something went wrong with that request. Please try again.