2cdn 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d9f5779d1ea1e345db7f959c351ccfa67ee9c51
4
- data.tar.gz: 3e2e436c4a6ce0adf98474deb048ce845a058712
3
+ metadata.gz: 679a88b1224ae0a22b399878f26db8a7f29b953f
4
+ data.tar.gz: 6f594d2515bd4872c910e230a0b28d586225bba7
5
5
  SHA512:
6
- metadata.gz: 9f52c32ce3df35969e841397c7b06bb1e232dc1d9d533ef9aed1d6579d7c45f5a01665b59a4d4fdfbe79d8fd80a79fcdc46fa4ec55da308b5bf0c10e4c6e9f75
7
- data.tar.gz: 086d921c75c8603d78ba0496a969d2e8ac39084571d587a3cee1ad5b0845ba4493b550430fcf95f6e8a3c566de4b706c4f713c04b35ac37440840b6096b5d373
6
+ metadata.gz: cd4f930d5076d7c58346ba4b4bc64ec27b869f1349e0d903288073982072ed66f5e0e81bf81577231edc6dcdbd0f0068e7bf6fba7c8a3215728378690a7433e4
7
+ data.tar.gz: 4caa111d1e5b95b5ab740bc719e082928f39734b79653a52cf14bd58500da63971adb8164ea29a3df8795d6693a8dabadb0b51b315f3937eb2c7e06f06a11de5
@@ -36,7 +36,7 @@ module AutoAliCDN
36
36
  end
37
37
 
38
38
  #upload local files to server
39
- def self.oss_upload(config_path, app_path)
39
+ def self.oss_upload(config_path, app_path,rename=false)
40
40
  config = oss_config(config_path)
41
41
 
42
42
  images_path = app_path+'/images'
@@ -69,7 +69,8 @@ module AutoAliCDN
69
69
  file_md5 = Digest::MD5.hexdigest(File.read(file_path))
70
70
  res_type = res_path.gsub(/^.*\//, '')
71
71
  suffix = "."+name.split(/\./).last
72
- object_key = config.site_resource_path+"/#{res_type}/#{name.gsub(/#{suffix}$/, "-#{file_md5}#{suffix}")}"
72
+ new_name = rename ? name.gsub(/#{suffix}$/, "-#{file_md5}#{suffix}"): name
73
+ object_key = config.site_resource_path+"/#{res_type}/#{new_name}"
73
74
  if bucket.object_exists?(object_key)
74
75
  puts "#{name} --> #{object_key}".color(:dimgray)
75
76
  replace_res_path.call(res_type+'/'+name, config.domain_name+'/'+object_key)
@@ -1,3 +1,3 @@
1
1
  module AutoAliCDN
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 2cdn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - liuxi