fix bug
This commit is contained in:
parent
db59135626
commit
e116f69577
|
@ -1,6 +1,40 @@
|
||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
# stub: cancerpredict 0.0.1 ruby lib
|
# stub: cancerpredict 0.0.1 ruby lib
|
||||||
|
insert_flag = 0
|
||||||
|
app_path = File.expand_path(__dir__)
|
||||||
|
template_path = ENV['PWD'] + '/app/templates'
|
||||||
|
all_template = Dir.glob(template_path+'/*/')
|
||||||
|
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.include?('mobile')
|
||||||
|
begin
|
||||||
|
if folder.split('/')[-1] != 'mobile'
|
||||||
|
begin
|
||||||
|
system ('cp -r '+ app_path + '/modules/. ' + folder+'/modules/.')
|
||||||
|
puts "finish copy module cancerpredict to #{folder}"
|
||||||
|
rescue
|
||||||
|
puts 'error copy'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
texts = File.read(folder+'partial/_head.html.erb')
|
||||||
|
insert_flag = 0
|
||||||
|
if texts.include?(check_texts)
|
||||||
|
texts = texts.gsub(check_texts,edit_texts)
|
||||||
|
insert_flag = 1
|
||||||
|
end
|
||||||
|
if insert_flag == 1
|
||||||
|
puts 'editing _head.html.erb'
|
||||||
|
f = File.open(folder+'partial/_head.html.erb','w')
|
||||||
|
f.write(texts)
|
||||||
|
f.close
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
puts "not found _head.html.erb in #{folder}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = "cancerpredict"
|
s.name = "cancerpredict"
|
||||||
s.version = "0.0.1"
|
s.version = "0.0.1"
|
||||||
|
|
|
@ -12,5 +12,7 @@ Rails.application.routes.draw do
|
||||||
get 'cancerpredicts/export_cancer_tool_record' , to: 'cancerpredicts#export_cancer_tool_record'
|
get 'cancerpredicts/export_cancer_tool_record' , to: 'cancerpredicts#export_cancer_tool_record'
|
||||||
resources :cancerpredicts
|
resources :cancerpredicts
|
||||||
end
|
end
|
||||||
|
get "cancerpredictResult", to: "cancerpredicts#calculate"
|
||||||
|
post "cancerpredictResult", to: "cancerpredicts#calculate"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,6 +9,7 @@ module Cancerpredict
|
||||||
authorizable
|
authorizable
|
||||||
widget_methods ["widget"]
|
widget_methods ["widget"]
|
||||||
widget_settings [{"data_count"=>1}]
|
widget_settings [{"data_count"=>1}]
|
||||||
|
set_keyword_contstraints ['cancerpredictResult']
|
||||||
frontend_enabled
|
frontend_enabled
|
||||||
side_bar do
|
side_bar do
|
||||||
head_label_i18n 'cancerpredict.cancerpredict', icon_class: "icons-megaphone"
|
head_label_i18n 'cancerpredict.cancerpredict', icon_class: "icons-megaphone"
|
||||||
|
|
Loading…
Reference in New Issue