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 +4 -4
- data/lib/auto-ali-cdn/oss.rb +5 -4
- data/lib/auto-ali-cdn/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24648f75d46864f370dd78343df8224d09b0f6ba
|
4
|
+
data.tar.gz: 20d9c341145c671a74f2a5c8a5aa32cf07c5268b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b9e8b09bcad9a8bcae52ff91bd584b126c786d7025a039a44f506622705c83ffe3f386c88ea0175b42263e3f60ab28b9a94ea436609afab6ee3f629c7df2cb1
|
7
|
+
data.tar.gz: 8241f4152a543646d8afab76fb4d987a163e61efd1d353a87a41e7590835d537ebf62c8a449af9bb8b3f511ddf3f035815d6795d41b3f9f5f882fb7de2230e08
|
data/lib/auto-ali-cdn/oss.rb
CHANGED
@@ -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
|
-
|
71
|
-
object_key = config.site_resource_path+"/#{res_type}/#{name.gsub(
|
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
|
-
|
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
|
data/lib/auto-ali-cdn/version.rb
CHANGED
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.
|
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:
|
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.
|
131
|
+
rubygems_version: 2.4.3
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: "自动部署网站到服务器"
|