2cdn 0.1.2 → 0.1.3

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: 181f5f37ebe5dd3e2191fb65be61fe2c4681544c
4
- data.tar.gz: e88879fcd701f816e42679c63a498aaf9eae18b0
3
+ metadata.gz: 24648f75d46864f370dd78343df8224d09b0f6ba
4
+ data.tar.gz: 20d9c341145c671a74f2a5c8a5aa32cf07c5268b
5
5
  SHA512:
6
- metadata.gz: b0e5dee85525736021cd9028d0fed7270a7714c824f8e3a9ad51667ac5e736f72665b0943d5573989db3e012df2c050b5e6dacd63afff3837fa81d6ce485b1d4
7
- data.tar.gz: 3a1f44836455e5fad807c49839918d594b635df26385d70758b7224327384c338e51de14094950179f1f011a4981c7eb7322c900230feb7bb606c697a9adf6d3
6
+ metadata.gz: 4b9e8b09bcad9a8bcae52ff91bd584b126c786d7025a039a44f506622705c83ffe3f386c88ea0175b42263e3f60ab28b9a94ea436609afab6ee3f629c7df2cb1
7
+ data.tar.gz: 8241f4152a543646d8afab76fb4d987a163e61efd1d353a87a41e7590835d537ebf62c8a449af9bb8b3f511ddf3f035815d6795d41b3f9f5f882fb7de2230e08
@@ -67,8 +67,8 @@ module AutoAliCDN
67
67
  next if name =~ /^(\.)|(\.\.)$/
68
68
  file_path = res_path+"/#{name}"
69
69
  file_md5 = Digest::MD5.hexdigest(File.read(file_path))
70
- res_type = res_path.gsub(/^.*\//, '')
71
- object_key = config.site_resource_path+"/#{res_type}/#{name.gsub(/\./, "-#{file_md5}.")}"
70
+ suffix = name.split(/\./).last
71
+ object_key = config.site_resource_path+"/#{res_type}/#{name.gsub(/#{suffix}$/, "-#{file_md5}#{suffix}")}"
72
72
  if bucket.object_exists?(object_key)
73
73
  puts "#{name} --> #{object_key}".color(:dimgray)
74
74
  replace_res_path.call(res_type+'/'+name, config.domain_name+'/'+object_key)
@@ -113,7 +113,8 @@ module AutoAliCDN
113
113
  file_path = res_path+"/#{name}"
114
114
  file_md5 = Digest::MD5.hexdigest(File.read(file_path))
115
115
  res_type = res_path.gsub(/^.*\//, '')
116
- object_key = config.site_resource_path+"/#{res_type}/#{name.gsub(/\./, "-#{file_md5}.")}"
116
+ suffix = name.split(/\./).last
117
+ object_key = config.site_resource_path+"/#{res_type}/#{name.gsub(/#{suffix}$/, "-#{file_md5}#{suffix}")}"
117
118
  if bucket.object_exists?(object_key)
118
119
  replace_res_path.call(config.domain_name+'/'+object_key, res_type+'/'+name)
119
120
  puts "#{object_key.color(:red)} --> #{"#{res_type}/#{name}".color(:cyan)}"
@@ -127,4 +128,4 @@ module AutoAliCDN
127
128
  end
128
129
 
129
130
  end
130
- end
131
+ end
@@ -1,3 +1,3 @@
1
1
  module AutoAliCDN
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 2cdn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - liuxi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-24 00:00:00.000000000 Z
11
+ date: 2018-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.4.8
131
+ rubygems_version: 2.4.3
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: "自动部署网站到服务器"