tcms 1.0.8 → 1.0.9
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/Gemfile +3 -2
- data/lib/tcms/helper.rb +13 -7
- 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: b4485806cb9221a9fa5ea9271a774836f311307b
|
4
|
+
data.tar.gz: d14a18dd485594543b89edb0b7f5913e04e27e3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65eaf7a0be9de508168e8d069225742b8ef211d6df9811193f31bff903de0e3e73a5378b2a85353ada817a155eb2d7bf8fa7b6710b625a6cb16e27688d8421ea
|
7
|
+
data.tar.gz: 73762dc00ee8c96b59b65ad4da836531bb0d91d1c4a5d77937b5ea073dbd2799f96105382fbe6a9867868a454b844bd3a33cc2a66b5f9c9f5e78ddb221c69a59
|
data/Gemfile
CHANGED
data/lib/tcms/helper.rb
CHANGED
@@ -10,14 +10,20 @@ module Tcms
|
|
10
10
|
|
11
11
|
def _script_for_local name
|
12
12
|
file_path = @_project["scripts"]["folder"]
|
13
|
-
|
13
|
+
target_file = file_path+"/#{name}.js"
|
14
14
|
script_output = ''
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
|
16
|
+
if File.exist? target_file
|
17
|
+
file_content = File.read(target_file,:encoding=>"utf-8")
|
18
|
+
file_output = file_content.gsub(/\/\/=include\s([^\s]+)/){|include_str|
|
19
|
+
matches = /\/\/=include\s([^\s]+)/.match(include_str)
|
20
|
+
file_url = file_path+"/#{matches[1]}.js"
|
21
|
+
script_output+= '<script type="text/javascript" charset="utf-8" src="/'+file_url+'"></script>';
|
22
|
+
script_output+="\n"
|
23
|
+
}
|
24
|
+
else
|
25
|
+
puts "文件不存在:#{target_file}"
|
26
|
+
end
|
21
27
|
|
22
28
|
script_output += '<script type="text/javascript" charset="utf-8" src="/'+file_path+"/"+name+'.js"></script>'
|
23
29
|
return script_output
|
data/lib/tcms/version.rb
CHANGED