tcms 0.9.5 → 0.9.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: 83d95c0863ec6d93a84c6a91cd48300de7ee3062
4
- data.tar.gz: 38b02c56417d66cc750df59103fb50c79900d403
3
+ metadata.gz: 0b32b4cfc7b937636fccac3b1e124d9ede5b676f
4
+ data.tar.gz: 8196f65e3643457d7dfc7b925663914dfc1b2e6d
5
5
  SHA512:
6
- metadata.gz: 195000128ea1dcabed970cf7a47177721ecdcb4e66f5a5786e99f75342ab1771cd0da530a8fd35b54f466b2682f292d9930df7940cb115d20d30253ac1e55851
7
- data.tar.gz: 5110cd1acee97033755d88da965d962a6b2e92a93b36a025dfaa3ebae81f44c84e5149cce05d5ee19620aef3d6da4ce4ee8abc23358ad5a009142c994648f0df
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 =file_path+'/'+publish_name+'.js';
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
@@ -1,3 +1,3 @@
1
1
  module Tcms
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'bertwang'"