tcms 0.9.5 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tcms/helper.rb +19 -10
- data/lib/tcms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b32b4cfc7b937636fccac3b1e124d9ede5b676f
|
4
|
+
data.tar.gz: 8196f65e3643457d7dfc7b925663914dfc1b2e6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e0961f5a84d92e9d9c82aaace18160b9f8196dc8cdc5337dd6b6fe83ed9b64f309e6738cfd07727a440df458bf458d36c90b4007605b84cc775eb5e34028ad6
|
7
|
+
data.tar.gz: 60b085cbc245f5f3809a968ea6052de4579286101ec864813297c42e06bb81a8830e2a177da5814787710bec33c17855ee919c56f9000cbbb18448100501d0d1
|
data/lib/tcms/helper.rb
CHANGED
@@ -2,9 +2,9 @@ module Tcms
|
|
2
2
|
module Helper
|
3
3
|
def script_for name
|
4
4
|
if @_build_type == "dev"
|
5
|
-
return _script_for_local name
|
5
|
+
return self._script_for_local name
|
6
6
|
else
|
7
|
-
return _script_for_publish name
|
7
|
+
return self._script_for_publish name
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -39,8 +39,10 @@ module Tcms
|
|
39
39
|
File.read(file_url,:encoding=>"utf-8")
|
40
40
|
}
|
41
41
|
publish_name = name+'.'+ @_project["version"].to_s
|
42
|
+
|
43
|
+
assets_path = @_project['assets']["folder"]
|
42
44
|
#写文件
|
43
|
-
write_file =
|
45
|
+
write_file =assets_path+'/'+publish_name+'.js';
|
44
46
|
|
45
47
|
if File.exist? write_file
|
46
48
|
File.delete write_file
|
@@ -50,17 +52,24 @@ module Tcms
|
|
50
52
|
concat_file.puts file_output
|
51
53
|
concat_file.close
|
52
54
|
|
55
|
+
puts write_file
|
53
56
|
puts '-生成素材'+publish_name+'.js'
|
54
57
|
|
55
58
|
assets = @_project["assets"]
|
56
|
-
site = assets["site"]
|
57
|
-
domain = 'qq.com'
|
58
|
-
remote_path = assets["remotepath"]
|
59
|
-
if site.match 'mat1' then domain = "gtimg.cn/#{assets["channel"]}" end
|
60
|
-
if site.match 'pingjs' then site = 'rss' end
|
61
|
-
url = "http://#{site}.#{domain}/#{remote_path}"
|
62
|
-
return '<script type="text/javascript" charset="utf-8" src="'+url+"/"+publish_name+'.js?v='+Digest::MD5.hexdigest(file_output)+'"></script>'
|
63
59
|
|
60
|
+
if @_build_type == "test"
|
61
|
+
url = "/"+@_project["assets"]["folder"]
|
62
|
+
return '<script type="text/javascript" charset="utf-8" src="'+url+"/"+publish_name+'.js?v='+Digest::MD5.hexdigest(file_output)+'"></script>'
|
63
|
+
else
|
64
|
+
site = assets["site"]
|
65
|
+
domain = 'qq.com'
|
66
|
+
remote_path = assets["remotepath"]
|
67
|
+
if site.match 'mat1' then domain = "gtimg.cn/#{assets["channel"]}" end
|
68
|
+
if site.match 'pingjs' then site = 'rss' end
|
69
|
+
url = "http://#{site}.#{domain}/#{remote_path}"
|
70
|
+
|
71
|
+
return '<script type="text/javascript" charset="utf-8" src="'+url+"/"+publish_name+'.js?v='+Digest::MD5.hexdigest(file_output)+'"></script>'
|
72
|
+
end
|
64
73
|
end
|
65
74
|
end
|
66
75
|
end
|
data/lib/tcms/version.rb
CHANGED