This commit is contained in:
BOHUNG 2020-01-13 19:16:41 +08:00
parent 65b96b9fdc
commit 19b2afcab1
1 changed files with 19 additions and 17 deletions

View File

@ -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|