Sha256: 324c5830c5089ff706b414b93d60b17eea112d95fa121fa314e05299bcbde60e

Contents?: true

Size: 521 Bytes

Versions: 1

Compression:

Stored size: 521 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/upyun/version")
require File.expand_path(File.dirname(__FILE__) + "/upyun/bucket")


module Upyun
  def self.get_config_for_bucket(bucket)
    UP_BUCKETS.find {|k, v| v.bucket_name.to_s == bucket.to_s}.try(:last)
  end
  
  # 为给定的路径与文件名生成保存后的远程路径
  def self.rand_save_path(filename)
    "/#{Date.today.year}/#{'%2s' % Date.today.month.to_s.rjust(2, "0")}/#{RandomCode.mix_string(16).downcase}#{File.basename(filename)}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
upyun-0.7.1 lib/upyun.rb