lib/paperclip.rb in kt-paperclip-4.4.0 vs lib/paperclip.rb in kt-paperclip-5.4.0

- old
+ new

@@ -54,11 +54,10 @@ require 'paperclip/helpers' require 'paperclip/has_attached_file' require 'paperclip/attachment_registry' require 'paperclip/filename_cleaner' require 'paperclip/rails_environment' -require "paperclip/deprecations" begin # Use mime/types/columnar if available, for reduced memory usage require "mime/types/columnar" rescue LoadError @@ -66,11 +65,11 @@ end require 'mimemagic' require 'mimemagic/overlay' require 'logger' -require 'cocaine' +require 'terrapin' require 'paperclip/railtie' if defined?(Rails::Railtie) # The base module that gets included in ActiveRecord::Base. See the # documentation for Paperclip::ClassMethods for more useful information. @@ -89,18 +88,18 @@ # nil, which uses the first executable found in the user's search path. # * use_exif_orientation: Whether to inspect EXIF data to determine an # image's orientation. Defaults to true. def self.options @options ||= { - :whiny => true, - :image_magick_path => nil, - :command_path => nil, - :log => true, - :log_command => true, - :swallow_stderr => true, - :content_type_mappings => {}, - :use_exif_orientation => true + command_path: nil, + content_type_mappings: {}, + log: true, + log_command: true, + read_timeout: nil, + swallow_stderr: true, + use_exif_orientation: true, + whiny: true, } end def self.io_adapters=(new_registry) @io_adapters = new_registry @@ -118,19 +117,22 @@ # thumbnails will be created when the new file is assigned, but they will *not* be saved # until +save+ is called on the record. Likewise, if the attribute is set to +nil+ is # called on it, the attachment will *not* be deleted until +save+ is called. See the # Paperclip::Attachment documentation for more specifics. There are a number of options # you can set to change the behavior of a Paperclip attachment: - # * +url+: The full URL of where the attachment is publically accessible. This can just + # * +url+: The full URL of where the attachment is publicly accessible. This can just # as easily point to a directory served directly through Apache as it can to an action # that can control permissions. You can specify the full domain and path, but usually # just an absolute path is sufficient. The leading slash *must* be included manually for # absolute paths. The default value is # "/system/:class/:attachment/:id_partition/:style/:filename". See # Paperclip::Attachment#interpolate for more information on variable interpolaton. # :url => "/:class/:attachment/:id/:style_:filename" # :url => "http://some.other.host/stuff/:class/:id_:extension" + # Note: When using the +s3+ storage option, the +url+ option expects + # particular values. See the Paperclip::Storage::S3#url documentation for + # specifics. # * +default_url+: The URL that will be returned if there is no attachment assigned. # This field is interpolated just as the url is. The default value is # "/:attachment/:style/missing.png" # has_attached_file :avatar, :default_url => "/images/default_:style_avatar.png" # User.new.avatar_url(:small) # => "/images/default_small_avatar.png" @@ -190,10 +192,9 @@ # def default_url_by_gender # "/assets/avatars/default_#{gender}.png" # end # end def has_attached_file(name, options = {}) - Paperclip::Deprecations.check HasAttachedFile.define_on(self, name, options) end end end