Sha256: d00d70b40ac55b6fba4934995eb68c273b5183c424166e01f055b6d07ad87721
Contents?: true
Size: 740 Bytes
Versions: 53
Compression:
Stored size: 740 Bytes
Contents
module Cloudinary::CarrierWave def download!(uri) return super if !self.cloudinary_should_handle_remote? if respond_to?(:process_uri) uri = process_uri(uri) else # Backward compatibility with old CarrierWave uri = URI.parse(URI.escape(URI.unescape(uri))) end return if uri.to_s.blank? self.original_filename = @cache_id = @filename = File.basename(uri.path).gsub(/[^a-zA-Z0-9\.\-\+_]/, '') @file = RemoteFile.new(uri, @filename) end class RemoteFile attr_reader :uri, :original_filename def initialize(uri, filename) @uri = uri @original_filename = filename end def delete # Do nothing. This is a virtual file. end end end
Version data entries
53 entries across 53 versions & 1 rubygems