module Shrine::Plugins::RemoteUrl
Documentation can be found on shrinerb.com/docs/plugins/remote_url
Constants
- DOWNLOADER
- LOG_SUBSCRIBER
Public Class Methods
# File lib/shrine/plugins/remote_url.rb 25 def self.configure(uploader, log_subscriber: LOG_SUBSCRIBER, **opts) 26 uploader.opts[:remote_url] ||= { downloader: DOWNLOADER } 27 uploader.opts[:remote_url].merge!(opts) 28 29 unless uploader.opts[:remote_url].key?(:max_size) 30 fail Error, "The :max_size option is required for remote_url plugin" 31 end 32 33 # instrumentation plugin integration 34 uploader.subscribe(:remote_url, &log_subscriber) if uploader.respond_to?(:subscribe) 35 end
# File lib/shrine/plugins/remote_url.rb 21 def self.load_dependencies(uploader, **) 22 uploader.plugin :validation 23 end