From 19b2afcab18e9ee212ece3d0eb33e602091c90bf Mon Sep 17 00:00:00 2001 From: BOHUNG Date: Mon, 13 Jan 2020 19:16:41 +0800 Subject: [PATCH] fix --- cancerpredict.gemspec | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/cancerpredict.gemspec b/cancerpredict.gemspec index 972e7d8..4273662 100644 --- a/cancerpredict.gemspec +++ b/cancerpredict.gemspec @@ -22,23 +22,25 @@ puts 'copying module' check_texts = '<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"%>' edit_texts = '<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"%>' all_template.each do |folder| - if folder.split('/')[-1] != 'mobile' - begin - system ('cp -r '+ app_path + '/modules/. ' + folder+'/modules/.') - rescue - puts 'error copy' - end - end - texts = File.read(folder+'partial/_head.html.erb') - insert_flag = 0 - if texts.include?(check_texts) - texts.gsub(check_texts,edit_texts) - insert_flag = 1 - end - if insert_flag == 1 - f = File.open(folder+'partial/_head.html.erb','w') - f.write(texts) - f.close + if !folder.include?('mobile') + if folder.split('/')[-1] != 'mobile' + begin + system ('cp -r '+ app_path + '/modules/. ' + folder+'/modules/.') + rescue + puts 'error copy' + end + end + texts = File.read(folder+'partial/_head.html.erb') + insert_flag = 0 + if texts.include?(check_texts) + texts.gsub(check_texts,edit_texts) + insert_flag = 1 + end + if insert_flag == 1 + f = File.open(folder+'partial/_head.html.erb','w') + f.write(texts) + f.close + end end end Gem::Specification.new do |s|