module Shrine::Plugins::DirectUpload

  1. lib/shrine/plugins/direct_upload.rb

Documentation lives in doc/plugins/direct_upload.md on GitHub.

Methods

Public Class

  1. configure
  2. load_dependencies

Public Class methods

configure (uploader, opts = {})
[show source]
   # File lib/shrine/plugins/direct_upload.rb
18 def self.configure(uploader, opts = {})
19   uploader.opts[:direct_upload_allowed_storages] = opts.fetch(:allowed_storages, uploader.opts.fetch(:direct_upload_allowed_storages, [:cache]))
20   uploader.opts[:direct_upload_presign_options] = opts.fetch(:presign_options, uploader.opts.fetch(:direct_upload_presign_options, {}))
21   uploader.opts[:direct_upload_presign_location] = opts.fetch(:presign_location, uploader.opts[:direct_upload_presign_location])
22   uploader.opts[:direct_upload_max_size] = opts.fetch(:max_size, uploader.opts[:direct_upload_max_size])
23 
24   uploader.assign_upload_endpoint(App) unless uploader.const_defined?(:UploadEndpoint)
25 end
load_dependencies (uploader, *)
[show source]
   # File lib/shrine/plugins/direct_upload.rb
14 def self.load_dependencies(uploader, *)
15   uploader.plugin :rack_file
16 end