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