Sha256: 9c24eaac9ea140a9d6db61c7354c80b3a1733303896376c18561ba3fedbbb62b
Contents?: true
Size: 399 Bytes
Versions: 30
Compression:
Stored size: 399 Bytes
Contents
module Alula class Edgecast < CDN THRESHOLD = 300 * 1024 # 300kB def url_for(name, opts) file = opts.delete(:file) hosts = File.size(file) < THRESHOLD ? self.options.small : self.options.large host = hosts[Digest::MD5.hexdigest(name).to_i(16) % hosts.count] File.join(host, name) end end end Alula::CDN.register :edgecast, Alula::Edgecast
Version data entries
30 entries across 30 versions & 1 rubygems