Sha256: 677f0ce5435664b76189fa3438196dcc8d9d1164f8b864f8a65c678fd7c75977

Contents?: true

Size: 837 Bytes

Versions: 13

Compression:

Stored size: 837 Bytes

Contents

require 'dragonfly'

# Configure
Dragonfly.app.configure do
  plugin :imagemagick

  secret '<%= generate_secret %>'

  url_format "/media/:job/:name"

  datastore :file,
    root_path: Rails.root.join('public/uploads/dragonfly', Rails.env),
    server_root: Rails.root.join('public')

  fetch_url_whitelist /.+/

  processor :add_watermark do |content, watermark, dissolve, position|
    content.shell_update do |old_path, new_path|
      "composite -dissolve #{dissolve} -gravity #{position} #{watermark} #{old_path} #{new_path}"
    end
  end

end

# Logger
Dragonfly.logger = Rails.logger

# Mount as middleware
Rails.application.middleware.use Dragonfly::Middleware

# Add model functionality
if defined?(ActiveRecord::Base)
  ActiveRecord::Base.extend Dragonfly::Model
  ActiveRecord::Base.extend Dragonfly::Model::Validations
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
kms-1.2.1 lib/generators/kms/install/templates/dragonfly.rb
kms-1.2.0 lib/generators/kms/install/templates/dragonfly.rb
kms-1.1.0 lib/generators/kms/install/templates/dragonfly.rb
kms-1.0.1 lib/generators/kms/install/templates/dragonfly.rb
kms-1.0.0 lib/generators/kms/install/templates/dragonfly.rb
kms-0.9.0 lib/generators/kms/install/templates/dragonfly.rb
kms-0.8.0 lib/generators/kms/install/templates/dragonfly.rb
kms-0.7.0 lib/generators/kms/install/templates/dragonfly.rb
kms-0.6.0 lib/generators/kms/install/templates/dragonfly.rb
kms-0.5.0 lib/generators/kms/install/templates/dragonfly.rb
kms-0.4.2 lib/generators/kms/install/templates/dragonfly.rb
kms-0.4.1 lib/generators/kms/install/templates/dragonfly.rb
kms-0.4.0 lib/generators/kms/install/templates/dragonfly.rb