@@ -51,12 +51,12 @@ module Paperclip
51
51
52
52
class << self
53
53
# Provides configurability to Paperclip. There are a number of options available, such as:
54
- # * whiny: Will raise an error if Paperclip cannot process thumbnails of
54
+ # * whiny: Will raise an error if Paperclip cannot process thumbnails of
55
55
# an uploaded image. Defaults to true.
56
56
# * log: Logs progress to the Rails log. Uses ActiveRecord's logger, so honors
57
57
# log levels, etc. Defaults to true.
58
58
# * command_path: Defines the path at which to find the command line
59
- # programs if they are not visible to Rails the system's search path. Defaults to
59
+ # programs if they are not visible to Rails the system's search path. Defaults to
60
60
# nil, which uses the first executable found in the user's search path.
61
61
# * image_magick_path: Deprecated alias of command_path.
62
62
def options
@@ -99,7 +99,7 @@ def interpolates key, &block
99
99
#
100
100
# Paperclip.run("echo", "something", :expected_outcodes => [0,1,2,3])
101
101
#
102
- # This method can log the command being run when
102
+ # This method can log the command being run when
103
103
# Paperclip.options[:log_command] is set to true (defaults to false). This
104
104
# will only log if logging in general is set to true as well.
105
105
def run cmd , *params
@@ -151,7 +151,7 @@ def processor name #:nodoc:
151
151
name = name . to_s . camelize
152
152
processor = Paperclip . const_get ( name )
153
153
unless processor . ancestors . include? ( Paperclip ::Processor )
154
- raise PaperclipError . new ( "Processor #{ name } was not found" )
154
+ raise PaperclipError . new ( "Processor #{ name } was not found" )
155
155
end
156
156
processor
157
157
end
@@ -193,41 +193,41 @@ class InfiniteInterpolationError < PaperclipError #:nodoc:
193
193
194
194
module ClassMethods
195
195
# +has_attached_file+ gives the class it is called on an attribute that maps to a file. This
196
- # is typically a file stored somewhere on the filesystem and has been uploaded by a user.
196
+ # is typically a file stored somewhere on the filesystem and has been uploaded by a user.
197
197
# The attribute returns a Paperclip::Attachment object which handles the management of
198
- # that file. The intent is to make the attachment as much like a normal attribute. The
199
- # thumbnails will be created when the new file is assigned, but they will *not* be saved
200
- # until +save+ is called on the record. Likewise, if the attribute is set to +nil+ is
201
- # called on it, the attachment will *not* be deleted until +save+ is called. See the
202
- # Paperclip::Attachment documentation for more specifics. There are a number of options
198
+ # that file. The intent is to make the attachment as much like a normal attribute. The
199
+ # thumbnails will be created when the new file is assigned, but they will *not* be saved
200
+ # until +save+ is called on the record. Likewise, if the attribute is set to +nil+ is
201
+ # called on it, the attachment will *not* be deleted until +save+ is called. See the
202
+ # Paperclip::Attachment documentation for more specifics. There are a number of options
203
203
# you can set to change the behavior of a Paperclip attachment:
204
204
# * +url+: The full URL of where the attachment is publically accessible. This can just
205
205
# as easily point to a directory served directly through Apache as it can to an action
206
206
# that can control permissions. You can specify the full domain and path, but usually
207
- # just an absolute path is sufficient. The leading slash *must* be included manually for
208
- # absolute paths. The default value is
207
+ # just an absolute path is sufficient. The leading slash *must* be included manually for
208
+ # absolute paths. The default value is
209
209
# "/system/:attachment/:id/:style/:filename". See
210
210
# Paperclip::Attachment#interpolate for more information on variable interpolaton.
211
211
# :url => "/:class/:attachment/:id/:style_:filename"
212
212
# :url => "http://some.other.host/stuff/:class/:id_:extension"
213
- # * +default_url+: The URL that will be returned if there is no attachment assigned.
214
- # This field is interpolated just as the url is. The default value is
213
+ # * +default_url+: The URL that will be returned if there is no attachment assigned.
214
+ # This field is interpolated just as the url is. The default value is
215
215
# "/:attachment/:style/missing.png"
216
216
# has_attached_file :avatar, :default_url => "/images/default_:style_avatar.png"
217
217
# User.new.avatar_url(:small) # => "/images/default_small_avatar.png"
218
- # * +styles+: A hash of thumbnail styles and their geometries. You can find more about
219
- # geometry strings at the ImageMagick website
218
+ # * +styles+: A hash of thumbnail styles and their geometries. You can find more about
219
+ # geometry strings at the ImageMagick website
220
220
# (http://www.imagemagick.org/script/command-line-options.php#resize). Paperclip
221
- # also adds the "#" option (e.g. "50x50#"), which will resize the image to fit maximally
222
- # inside the dimensions and then crop the rest off (weighted at the center). The
221
+ # also adds the "#" option (e.g. "50x50#"), which will resize the image to fit maximally
222
+ # inside the dimensions and then crop the rest off (weighted at the center). The
223
223
# default value is to generate no thumbnails.
224
- # * +default_style+: The thumbnail style that will be used by default URLs.
224
+ # * +default_style+: The thumbnail style that will be used by default URLs.
225
225
# Defaults to +original+.
226
226
# has_attached_file :avatar, :styles => { :normal => "100x100#" },
227
227
# :default_style => :normal
228
228
# user.avatar.url # => "/avatars/23/normal_me.png"
229
229
# * +whiny+: Will raise an error if Paperclip cannot post_process an uploaded file due
230
- # to a command line error. This will override the global setting for this attachment.
230
+ # to a command line error. This will override the global setting for this attachment.
231
231
# Defaults to true. This option used to be called :whiny_thumbanils, but this is
232
232
# deprecated.
233
233
# * +convert_options+: When creating thumbnails, use this free-form options
@@ -323,19 +323,19 @@ def validates_attachment_thumbnails name, options = {}
323
323
# * +unless+: Same as +if+ but validates if lambda or method returns false.
324
324
def validates_attachment_presence name , options = { }
325
325
message = options [ :message ] || "must be set."
326
- validates_presence_of :"#{ name } _file_name" ,
326
+ validates_presence_of :"#{ name } _file_name" ,
327
327
:message => message ,
328
328
:if => options [ :if ] ,
329
329
:unless => options [ :unless ]
330
330
end
331
-
331
+
332
332
# Places ActiveRecord-style validations on the content type of the file
333
- # assigned. The possible options are:
334
- # * +content_type+: Allowed content types. Can be a single content type
335
- # or an array. Each type can be a String or a Regexp. It should be
336
- # noted that Internet Explorer upload files with content_types that you
337
- # may not expect. For example, JPEG images are given image/pjpeg and
338
- # PNGs are image/x-png, so keep that in mind when determining how you
333
+ # assigned. The possible options are:
334
+ # * +content_type+: Allowed content types. Can be a single content type
335
+ # or an array. Each type can be a String or a Regexp. It should be
336
+ # noted that Internet Explorer upload files with content_types that you
337
+ # may not expect. For example, JPEG images are given image/pjpeg and
338
+ # PNGs are image/x-png, so keep that in mind when determining how you
339
339
# match. Allows all by default.
340
340
# * +message+: The message to display when the uploaded file has an invalid
341
341
# content type.
0 commit comments