Sha256: 325fb9292766532b4c4fafb57c841ca9ad533fe397dc616034035e82bf4369bc

Contents?: true

Size: 649 Bytes

Versions: 29

Compression:

Stored size: 649 Bytes

Contents

module Cloudinary::CarrierWave
  def download!(uri)
    if respond_to?(:process_uri)
      uri = process_uri(uri)
    else # Backward compatibility with old CarrierWave
      uri = URI.parse(URI.escape(URI.unescape(uri)))
    end
    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

29 entries across 29 versions & 1 rubygems

Version Path
cloudinary-1.0.44 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.43 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.42 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.41 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.40 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.39 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.38 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.37 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.36 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.35 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.34 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.33 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.32 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.31 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.30 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.29 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.28 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.27 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.26 lib/cloudinary/carrier_wave/remote.rb
cloudinary-1.0.25 lib/cloudinary/carrier_wave/remote.rb