Class: Shrine::Plugins::KitheDerivatives

Inherits:
Object
  • Object
show all
Defined in:
lib/shrine/plugins/kithe_derivatives.rb

Overview

Includes the Shrine ‘derivatives` plugin with some configuration, and extra features. The metadata for shrine derivatives is stored in the same JSON as the main file.

  • default kithe storage location of :kithe_derivatives

  • nice metadata for derivatives, instead of default shrine fairly random (filename ends up used by default in content-disposition headers when delivered)

  • Includes kithe_persisted_derivatives with #add_persisted_derivatives and #create_persisted_derivatives methods for concurrency-safe derivative persisting.

## Shrine derivatives references

shrinerb.com/docs/plugins/derivatives shrinerb.com/docs/processing

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.load_dependencies(uploader) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/shrine/plugins/kithe_derivatives.rb', line 23

def self.load_dependencies(uploader, *)
  uploader.plugin :derivatives, storage: -> (derivative) do
    # default derivatives storage to
    :kithe_derivatives
  end

  uploader.plugin :kithe_persisted_derivatives
  uploader.plugin :kithe_derivative_definitions
end