Sha256: 9509334bb646890846d081f4a368f1b1422298e2212d223379ce325cb45a5c6e

Contents?: true

Size: 573 Bytes

Versions: 38

Compression:

Stored size: 573 Bytes

Contents

# Copyright Cloudinary
class Cloudinary::Downloader
  
  def self.download(source, options={})
    options = options.clone
    if !source.match(/^https?:\/\//i)
      source = Cloudinary::Utils.cloudinary_url(source, options)
    end
    
    url = URI.parse(source) 
    http = Net::HTTP.new(url.host, url.port)
    req = Net::HTTP::Get.new(url.path)
    if url.port == 443
      http.use_ssl=true
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    end  
    res = http.start{|agent| agent.request(req)}
    return res.body        
  end
    
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
cloudinary-1.0.37 lib/cloudinary/downloader.rb
cloudinary-1.0.36 lib/cloudinary/downloader.rb
cloudinary-1.0.35 lib/cloudinary/downloader.rb
cloudinary-1.0.34 lib/cloudinary/downloader.rb
cloudinary-1.0.33 lib/cloudinary/downloader.rb
cloudinary-1.0.32 lib/cloudinary/downloader.rb
cloudinary-1.0.31 lib/cloudinary/downloader.rb
cloudinary-1.0.30 lib/cloudinary/downloader.rb
cloudinary-1.0.29 lib/cloudinary/downloader.rb
cloudinary-1.0.28 lib/cloudinary/downloader.rb
cloudinary-1.0.27 lib/cloudinary/downloader.rb
cloudinary-1.0.26 lib/cloudinary/downloader.rb
cloudinary-1.0.25 lib/cloudinary/downloader.rb
cloudinary-1.0.24 lib/cloudinary/downloader.rb
cloudinary-1.0.23 lib/cloudinary/downloader.rb
cloudinary-1.0.22 lib/cloudinary/downloader.rb
cloudinary-1.0.21 lib/cloudinary/downloader.rb
cloudinary-1.0.20 lib/cloudinary/downloader.rb
cloudinary-1.0.19 lib/cloudinary/downloader.rb
cloudinary-1.0.18 lib/cloudinary/downloader.rb