tcms 1.0.8 → 1.0.9

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: f67c97b9835bb5e4981d77937b2a999f34cbefb4
4
- data.tar.gz: f30b251477391984df1e514d689bed2994f4d526
3
+ metadata.gz: b4485806cb9221a9fa5ea9271a774836f311307b
4
+ data.tar.gz: d14a18dd485594543b89edb0b7f5913e04e27e3a
5
5
  SHA512:
6
- metadata.gz: 89416776ee6fe6336c1b0c9a0260ae10274d701c7f2610026457df86b427c9ed9549fb7c22cf871ef9aa27951b46f8ef686a734d99122318260d446272b39fe2
7
- data.tar.gz: 26035450f604bce6be45620c66fe2c778bdf3513fcebec8b2621489249690ef61ce0db105ce81930604dd80f2255aa7843ad495e29d6fa109c93b9f66eb84749
6
+ metadata.gz: 65eaf7a0be9de508168e8d069225742b8ef211d6df9811193f31bff903de0e3e73a5378b2a85353ada817a155eb2d7bf8fa7b6710b625a6cb16e27688d8421ea
7
+ data.tar.gz: 73762dc00ee8c96b59b65ad4da836531bb0d91d1c4a5d77937b5ea073dbd2799f96105382fbe6a9867868a454b844bd3a33cc2a66b5f9c9f5e78ddb221c69a59
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
-
2
+ gemspec
3
3
  # Specify your gem's dependencies in tcms.gemspec
4
- gem 'rest_client'
4
+ gem 'rest-client'
5
5
  gem 'sinatra'
6
+ gem 'rake'
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
- file_content = File.read(file_path+"/#{name}.js",:encoding=>"utf-8")
13
+ target_file = file_path+"/#{name}.js"
14
14
  script_output = ''
15
- file_output = file_content.gsub(/\/\/=include\s([^\s]+)/){|include_str|
16
- matches = /\/\/=include\s([^\s]+)/.match(include_str)
17
- file_url = file_path+"/#{matches[1]}.js"
18
- script_output+= '<script type="text/javascript" charset="utf-8" src="/'+file_url+'"></script>';
19
- script_output+="\n"
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
@@ -1,3 +1,3 @@
1
1
  module Tcms
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
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: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'bertwang'"