module Shrine::Plugins::Versions

  1. lib/shrine/plugins/versions.rb

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

Methods

Public Class

  1. configure
  2. load_dependencies

Public Class methods

configure (uploader, opts = {})
[show source]
   # File lib/shrine/plugins/versions.rb
13 def self.configure(uploader, opts = {})
14   Shrine.deprecation("The versions Shrine plugin doesn't need the :names option anymore, you can safely remove it.") if opts.key?(:names)
15 
16   uploader.opts[:version_names] = opts.fetch(:names, uploader.opts[:version_names])
17   uploader.opts[:version_fallbacks] = opts.fetch(:fallbacks, uploader.opts.fetch(:version_fallbacks, {}))
18   uploader.opts[:versions_fallback_to_original] = opts.fetch(:fallback_to_original, uploader.opts.fetch(:versions_fallback_to_original, true))
19 end
load_dependencies (uploader, *)
[show source]
   # File lib/shrine/plugins/versions.rb
 9 def self.load_dependencies(uploader, *)
10   uploader.plugin :default_url
11 end