Module Paperclip
In: lib/paperclip/geometry.rb
lib/paperclip/attachment.rb
lib/paperclip/upfile.rb
lib/paperclip/processor.rb
lib/paperclip/schema.rb
lib/paperclip/railtie.rb
lib/paperclip/interpolations.rb
lib/paperclip/version.rb
lib/paperclip/matchers.rb
lib/paperclip/style.rb
lib/paperclip/storage/fog.rb
lib/paperclip/storage/filesystem.rb
lib/paperclip/storage/s3.rb
lib/paperclip/callback_compatibility.rb
lib/paperclip/matchers/have_attached_file_matcher.rb
lib/paperclip/matchers/validate_attachment_presence_matcher.rb
lib/paperclip/matchers/validate_attachment_size_matcher.rb
lib/paperclip/matchers/validate_attachment_content_type_matcher.rb
lib/paperclip/thumbnail.rb
lib/paperclip/attachment_options.rb
lib/paperclip/missing_attachment_styles.rb
lib/paperclip/url_generator.rb
lib/paperclip.rb

The base module that gets included in ActiveRecord::Base. See the documentation for Paperclip::ClassMethods for more useful information.

Methods

Classes and Modules

Module Paperclip::CallbackCompatability
Module Paperclip::ClassMethods
Module Paperclip::Glue
Module Paperclip::Interpolations
Module Paperclip::Schema
Module Paperclip::Shoulda
Module Paperclip::Storage
Module Paperclip::Upfile
Class Paperclip::Attachment
Class Paperclip::AttachmentOptions
Class Paperclip::CommandNotFoundError
Class Paperclip::Geometry
Class Paperclip::Processor
Class Paperclip::Railtie
Class Paperclip::StorageMethodNotFound
Class Paperclip::Style
Class Paperclip::Tempfile
Class Paperclip::Thumbnail
Class Paperclip::UrlGenerator

Constants

VERSION = "2.8.0" unless defined? Paperclip::VERSION

Attributes

classes_with_attachments  [RW] 
registered_attachments_styles_path  [W] 

Public Class methods

Find all instances of the given Active Record model klass with attachment name. This method is used by the refresh rake tasks.

Log a paperclip-specific line. This will logs to STDOUT by default. Set Paperclip.options[:log] to false to turn off.

Returns hash with styles missing from recent run of rake paperclip:refresh:missing_styles

  {
    :User => {:avatar => [:big]},
    :Book => {
      :cover => [:croppable]},
    }
  }

Provides configurability to Paperclip. The options available are:

  • whiny: Will raise an error if Paperclip cannot process thumbnails of an uploaded image. Defaults to true.
  • log: Logs progress to the Rails log. Uses ActiveRecord‘s logger, so honors log levels, etc. Defaults to true.
  • command_path: Defines the path at which to find the command line programs if they are not visible to Rails the system‘s search path. Defaults to nil, which uses the first executable found in the user‘s search path.
  • image_magick_path: Deprecated alias of command_path.

You can add your own processor via the Paperclip configuration. Normally Paperclip will load all processors from the Rails.root/lib/paperclip_processors directory, but here you can add any existing class using this mechanism.

  Paperclip.configure do |c|
    c.register_processor :watermarker, WatermarkingProcessor.new
  end

The run method takes the name of a binary to run, the arguments to that binary and some options:

  :command_path -> A $PATH-like variable that defines where to look for the binary
                   on the filesystem. Colon-separated, just like $PATH.

  :expected_outcodes -> An array of integers that defines the expected exit codes
                        of the binary. Defaults to [0].

  :log_command -> Log the command being run when set to true (defaults to false).
                  This will only log if logging in general is set to true as well.

  :swallow_stderr -> Set to true if you don't care what happens on STDERR.

[Validate]