module Shrine::Plugins::DetermineMimeType

  1. lib/shrine/plugins/determine_mime_type.rb

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

Methods

Public Class

  1. configure

Public Class methods

configure (uploader, opts = {})
[show source]
   # File lib/shrine/plugins/determine_mime_type.rb
 9 def self.configure(uploader, opts = {})
10   if opts[:analyzer] == :default
11     Shrine.deprecation("The :default analyzer of the determine_mime_type plugin has been renamed to :content_type. The :default alias will not be supported in Shrine 3.")
12     opts = opts.merge(analyzer: :content_type)
13   end
14 
15   uploader.opts[:mime_type_analyzer] = opts.fetch(:analyzer, uploader.opts.fetch(:mime_type_analyzer, :file))
16   uploader.opts[:mime_type_analyzer_options] = opts.fetch(:analyzer_options, uploader.opts.fetch(:mime_type_analyzer_options, {}))
17 end