module Shrine::Plugins::DataUri

  1. lib/shrine/plugins/data_uri.rb

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

Methods

Public Class

  1. configure

Constants

BASE64_REGEXP = /;base64/  
CONTENT_SEPARATOR = /,/  
DATA_REGEXP = /data:/  
DEFAULT_CONTENT_TYPE = "text/plain"  
MEDIA_TYPE_REGEXP = /[-\w.+]+\/[-\w.+]+(;[-\w.+]+=[^;,]+)*/  

Public Class methods

configure (uploader, opts = {})
[show source]
   # File lib/shrine/plugins/data_uri.rb
23 def self.configure(uploader, opts = {})
24   uploader.opts[:data_uri_filename] = opts.fetch(:filename, uploader.opts[:data_uri_filename])
25   uploader.opts[:data_uri_error_message] = opts.fetch(:error_message, uploader.opts[:data_uri_error_message])
26 
27   Shrine.deprecation("The :filename option is deprecated for the data_uri plugin, and will be removed in Shrine 3. Use the infer_extension plugin instead.") if opts[:filename]
28 end