From 1e55555f8415b886c473cfad55549138eeca4bed Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:36:18 +0800 Subject: [PATCH 01/18] Update personal_projects_controller.rb fix coding style --- .../personal_projects_controller.rb | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/controllers/personal_projects_controller.rb b/app/controllers/personal_projects_controller.rb index 4c4245e..df64c36 100644 --- a/app/controllers/personal_projects_controller.rb +++ b/app/controllers/personal_projects_controller.rb @@ -1,12 +1,8 @@ class PersonalProjectsController < ApplicationController - def search_all_words(target,word) - target=target.upcase - words=word.upcase.split(' ') - return words.select{|value| target.include? value}==words - end def index params = OrbitHelper.params - projects = Project.where(:project_title.ne => nil,:project_title.ne => "").sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) + page_data_count = OrbitHelper.page_data_count + projects = Project.where(:project_title.ne => nil,:project_title.ne => "").sort_for_frontend.page(OrbitHelper.params[:page_no]).per(page_data_count) fields_to_show = Page.where(:page_id => params[:page_id]).first.custom_array_field rescue [] if fields_to_show.blank? fields_to_show = [ @@ -38,8 +34,8 @@ class PersonalProjectsController < ApplicationController else page_to_show = params[:page_no].to_i end - projects = projects_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] - projects_total_pages = (projects_show.length/OrbitHelper.page_data_count.to_f).ceil + projects = projects_show[(page_to_show-1)*page_data_count...page_to_show*page_data_count] + projects_total_pages = (projects_show.length/page_data_count.to_f).ceil else projects_total_pages = projects.total_pages end @@ -78,13 +74,13 @@ class PersonalProjectsController < ApplicationController choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : ""} choice_select=choice_select.map{|value| {"choice_select" => value}} choice_value=choice_value.map{|value| {"choice_value" => value}} - choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" + choice_default = t("personal_project.select_class") choice_show.unshift(choice_default) choice_show=choice_show.map{|value| {"choice_show" => value}} choice=choice_value.zip(choice_show,choice_select) choice=choice.map{|value| value.inject:merge} - select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:" - search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:" + select_text = t("personal_project.search_class") + search_text = t("personal_project.word_to_search") { "projects" => project_list, "headers" => headers, @@ -152,6 +148,11 @@ class PersonalProjectsController < ApplicationController page.save render :json => {"success" => true}.to_json end - +private + def search_all_words(target,word) + target=target.upcase + words=word.upcase.split(' ') + return words.select{|value| target.include? value}==words + end end From 514384c06a70d9a7b94acff76d8a3181af6e05e3 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:37:06 +0800 Subject: [PATCH 02/18] Update zh_tw.yml add translation --- config/locales/zh_tw.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index dc35c66..9266aac 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -2,6 +2,9 @@ zh_tw: module_name: personal_project: 研究計畫 personal_project: + select_class: "——選取分類——" + search_class: "搜尋類別:" + word_to_search: "關鍵字搜尋:" project_title : "計畫名稱" job_title : "職稱/擔任之工作" participator : "參與人" From c480158946db9192eec06ec4db22cf9ae1d310d4 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:37:46 +0800 Subject: [PATCH 03/18] Update en.yml add and fix translation --- config/locales/en.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index f37dd1b..d4bd03b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2,9 +2,12 @@ en: module_name: personal_project: "Project" personal_project: + select_class: "——select class——" + search_class: "search class:" + word_to_search: "word to search:" project_title : "Project Title" job_title : "Job Title" - participator : "Participartor" + participator : "Participator" project_category : "Project Category" project_type: "Project Category" period : "Period" From 781c88df05b8368ed61226a7ca6beca53e022e03 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:51:29 +0800 Subject: [PATCH 04/18] Update project.rb fix error --- app/models/project.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index aadcb5a..bec396e 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -133,8 +133,8 @@ class Project files = [] self.project_files.each do |project_file| url = project_file.file.url - title = (project_file.title.blank? ? File.basename(project_file.file.path) : project_file.title) - files << "
  • #{title}
  • " + title = ((project_file.title.blank? ? File.basename(project_file.file.path) : project_file.title) rescue "") + files << (url.nil? ? "" : "
  • #{title}
  • ") end value = files.join("") else From f15e08fc326a1cc0a7caaef96b41b3064655b87a Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 20 Aug 2019 12:18:47 +0800 Subject: [PATCH 05/18] Update personal_projects_controller.rb fix coding style --- .../personal_projects_controller.rb | 211 +++++++++--------- 1 file changed, 106 insertions(+), 105 deletions(-) diff --git a/app/controllers/personal_projects_controller.rb b/app/controllers/personal_projects_controller.rb index df64c36..d574afd 100644 --- a/app/controllers/personal_projects_controller.rb +++ b/app/controllers/personal_projects_controller.rb @@ -2,157 +2,158 @@ class PersonalProjectsController < ApplicationController def index params = OrbitHelper.params page_data_count = OrbitHelper.page_data_count - projects = Project.where(:project_title.ne => nil,:project_title.ne => "").sort_for_frontend.page(OrbitHelper.params[:page_no]).per(page_data_count) - fields_to_show = Page.where(:page_id => params[:page_id]).first.custom_array_field rescue [] + projects = Project.where(:project_title.ne => nil, :project_title.ne => '').sort_for_frontend.page(OrbitHelper.params[:page_no]).per(page_data_count) + fields_to_show = Page.where(page_id: params[:page_id]).first.custom_array_field rescue [] if fields_to_show.blank? - fields_to_show = [ - "project_type", - "year", - "project_title", - "participator", - "job_title", - "period", - "unit" + fields_to_show = %w[ + project_type + year + project_title + participator + job_title + period + unit ] end - if params[:selectbox] !=nil - projects_temp = Project.where(:is_hidden=>false).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } + if !params[:selectbox].nil? + projects_temp = Project.where(is_hidden: false).sort_by { |tp| [-tp[:year].to_i, -tp[:publication_date].to_i] } case params[:selectbox] - when "project_type" - projects_show = projects_temp.select {|value| search_all_words((value.send("project_type").title rescue ""), params[:keywords])} - when "project_title","default" - projects_show = projects_temp.select {|value| search_all_words(value.send("project_title").to_s, params[:keywords])} - when "period" - projects_show = projects_temp.select {|value| search_all_words(value.send("duration").to_s, params[:keywords])} - when "language" - projects_show = projects_temp.select {|value| search_all_words(t(value.send("language")), params[:keywords])} + when 'project_type' + projects_show = projects_temp.select { |value| search_all_words((value.send('project_type').title rescue ''), params[:keywords]) } + when 'project_title', 'default' + projects_show = projects_temp.select { |value| search_all_words(value.send('project_title').to_s, params[:keywords]) } + when 'period' + projects_show = projects_temp.select { |value| search_all_words(value.send('duration').to_s, params[:keywords]) } + when 'language' + projects_show = projects_temp.select { |value| search_all_words(t(value.send('language')), params[:keywords]) } else - projects_show = projects_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords])} + projects_show = projects_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) } end - if params[:page_no].nil? - page_to_show = 1 - else - page_to_show = params[:page_no].to_i - end - projects = projects_show[(page_to_show-1)*page_data_count...page_to_show*page_data_count] - projects_total_pages = (projects_show.length/page_data_count.to_f).ceil + page_to_show = if params[:page_no].nil? + 1 + else + params[:page_no].to_i + end + projects = projects_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count] + projects_total_pages = (projects_show.length / page_data_count.to_f).ceil else projects_total_pages = projects.total_pages end project_list = [] projects.each do |project| - t = [] + t = [] fields_to_show.each do |fs| case fs - when "project_type" - t << {"value" => (project.send(fs).title rescue "")} - when "project_title" - t << {"value" => "" + (project.send(fs) rescue "") + ""} - when "period" - t << {"value" => (project.send("duration") rescue "")} - when "language" - t << {"value" => (t(project.send("language")) rescue "")} + when 'project_type' + t << { 'value' => (project.send(fs).title rescue '') } + when 'project_title' + t << { 'value' => "" + (project.send(fs) rescue '') + '' } + when 'period' + t << { 'value' => (project.send('duration') rescue '') } + when 'language' + t << { 'value' => (t(project.send('language')) rescue '') } else - t << {"value" => (project.send(fs) rescue "")} + t << { 'value' => (project.send(fs) rescue '') } end end - project_list << {"project" => t} + project_list << { 'project' => t } end choice_show = [] headers = [] fields_to_show.each do |fs| col = 2 - col = 3 if fs == "project_title" + col = 3 if fs == 'project_title' headers << { - "head-title" => t("personal_project.#{fs}"), - "col" => col + 'head-title' => t("personal_project.#{fs}"), + 'col' => col } choice_show << t("personal_project.#{fs}") end choice_value = fields_to_show - choice_value.unshift("default") - choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : ""} - choice_select=choice_select.map{|value| {"choice_select" => value}} - choice_value=choice_value.map{|value| {"choice_value" => value}} - choice_default = t("personal_project.select_class") + choice_value.unshift('default') + choice_select = choice_value.map { |iter| iter == params[:selectbox] ? 'selected' : '' } + choice_select = choice_select.map { |value| { 'choice_select' => value } } + choice_value = choice_value.map { |value| { 'choice_value' => value } } + choice_default = t('personal_project.select_class') choice_show.unshift(choice_default) - choice_show=choice_show.map{|value| {"choice_show" => value}} - choice=choice_value.zip(choice_show,choice_select) - choice=choice.map{|value| value.inject:merge} - select_text = t("personal_project.search_class") - search_text = t("personal_project.word_to_search") + choice_show = choice_show.map { |value| { 'choice_show' => value } } + choice = choice_value.zip(choice_show, choice_select) + choice = choice.map { |value| value.inject :merge } + select_text = t('personal_project.search_class') + search_text = t('personal_project.word_to_search') { - "projects" => project_list, - "headers" => headers, - "extras" => {"widget-title" => t("module_name.personal_project"), - "url" => "/"+params[:locale]+params[:url], - "select_text" => select_text, - "search_text" => search_text, - "search_value" => params[:keywords] }, - "total_pages" => projects_total_pages, - "choice" => choice + 'projects' => project_list, + 'headers' => headers, + 'extras' => { 'widget-title' => t('module_name.personal_project'), + 'url' => '/' + params[:locale] + params[:url], + 'select_text' => select_text, + 'search_text' => search_text, + 'search_value' => params[:keywords] }, + 'total_pages' => projects_total_pages, + 'choice' => choice } end def show params = OrbitHelper.params - plugin = Project.where(:is_hidden=>false).find_by(uid: params[:uid]) - fields_to_show = [ - "year", - "project_type", - "project_title", - "participator", - "job_title", - "period", - "unit", - "abstract", - "url", - "file", - "language", + plugin = Project.where(is_hidden: false).find_by(uid: params[:uid]) + fields_to_show = %w[ + year + project_type + project_title + participator + job_title + period + unit + abstract + url + file + language ] - {"plugin_datas"=>plugin.get_plugin_data(fields_to_show)} + { 'plugin_datas' => plugin.get_plugin_data(fields_to_show) } end def get_fields_for_index @page = Page.find(params[:page_id]) rescue nil - @fields_to_show = [ - "year", - "project_type", - "project_title", - "participator", - "job_title", - "period", - "unit", - "abstract", - "url", - "file", - "language", + @fields_to_show = %w[ + year + project_type + project_title + participator + job_title + period + unit + abstract + url + file + language ] - @fields_to_show = @fields_to_show.map{|fs| [t("personal_project.#{fs}"), fs]} - @default_fields_to_show = [ - "project_type", - "year", - "project_title", - "participator", - "job_title", - "period", - "unit" + @fields_to_show = @fields_to_show.map { |fs| [t("personal_project.#{fs}"), fs] } + @default_fields_to_show = %w[ + project_type + year + project_title + participator + job_title + period + unit ] - render :layout => false + render layout: false end def save_index_fields page = Page.find(params[:page_id]) rescue nil page.custom_array_field = params[:keys] page.save - render :json => {"success" => true}.to_json + render json: { 'success' => true }.to_json end -private - def search_all_words(target,word) - target=target.upcase - words=word.upcase.split(' ') - return words.select{|value| target.include? value}==words - end -end + private + + def search_all_words(target, word) + target = target.upcase + words = word.upcase.split(' ') + words.select { |value| target.include? value } == words + end +end \ No newline at end of file From 2780fbf64614c88db44111fc5b8851ffc6cba7cb Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 20 Aug 2019 14:16:20 +0800 Subject: [PATCH 06/18] Update personal_projects_controller.rb fix style --- app/controllers/personal_projects_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/personal_projects_controller.rb b/app/controllers/personal_projects_controller.rb index d574afd..cfcda10 100644 --- a/app/controllers/personal_projects_controller.rb +++ b/app/controllers/personal_projects_controller.rb @@ -29,11 +29,7 @@ class PersonalProjectsController < ApplicationController else projects_show = projects_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) } end - page_to_show = if params[:page_no].nil? - 1 - else - params[:page_no].to_i - end + page_to_show = params[:page_no].nil? ? 1 : params[:page_no].to_i projects = projects_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count] projects_total_pages = (projects_show.length / page_data_count.to_f).ceil else From 49c9ef0b95823b8aa26a7bdd270c5748ca4c99b6 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:50:27 +0800 Subject: [PATCH 07/18] Add new directory modules --- modules/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/.gitkeep diff --git a/modules/.gitkeep b/modules/.gitkeep new file mode 100644 index 0000000..e69de29 From 507720bc25c921413330c794986251d7de750034 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:50:51 +0800 Subject: [PATCH 08/18] Add new directory personal_project --- modules/personal_project/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/personal_project/.gitkeep diff --git a/modules/personal_project/.gitkeep b/modules/personal_project/.gitkeep new file mode 100644 index 0000000..e69de29 From b4075e8633c21ae9fdd38aff6bad4c3b1cf31551 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:51:10 +0800 Subject: [PATCH 09/18] Upload new file --- modules/personal_project/show.html.erb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 modules/personal_project/show.html.erb diff --git a/modules/personal_project/show.html.erb b/modules/personal_project/show.html.erb new file mode 100644 index 0000000..34b30df --- /dev/null +++ b/modules/personal_project/show.html.erb @@ -0,0 +1,5 @@ + + + + +
    {{title}}{{value}}
    \ No newline at end of file From bace4e1398d37e1d3da580667d9af393e2f7a9a1 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:51:25 +0800 Subject: [PATCH 10/18] Upload new file --- modules/personal_project/info.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 modules/personal_project/info.json diff --git a/modules/personal_project/info.json b/modules/personal_project/info.json new file mode 100644 index 0000000..bdb0c2c --- /dev/null +++ b/modules/personal_project/info.json @@ -0,0 +1,20 @@ +{ + "frontend": [ + { + "filename" : "index", + "name" : { + "zh_tw" : "1. 列表", + "en" : "1. List" + }, + "thumbnail" : "thumb.png" + }, + { + "filename" : "index_search1", + "name" : { + "zh_tw" : "2. 列表(含搜尋)", + "en" : "2. List which includes search" + }, + "thumbnail" : "thumb.png" + } + ] +} \ No newline at end of file From 34a841b777e6c46efb4dff3ce40e532df926072d Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:51:39 +0800 Subject: [PATCH 11/18] Upload new file --- .../personal_project/index_search1.html.erb | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 modules/personal_project/index_search1.html.erb diff --git a/modules/personal_project/index_search1.html.erb b/modules/personal_project/index_search1.html.erb new file mode 100644 index 0000000..6caffe2 --- /dev/null +++ b/modules/personal_project/index_search1.html.erb @@ -0,0 +1,37 @@ + +

    {{widget-title}}

    +
    +
    + {{select_text}} + + {{search_text}} + + + Clear +
    +
    + + + + + + + + + + + +
    {{head-title}}
    {{value}}
    +{{pagination_goes_here}} \ No newline at end of file From abbba1bb72ab3ecdca6474dcbdcb8851ec0d253b Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:51:50 +0800 Subject: [PATCH 12/18] Upload new file --- modules/personal_project/index.html.erb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 modules/personal_project/index.html.erb diff --git a/modules/personal_project/index.html.erb b/modules/personal_project/index.html.erb new file mode 100644 index 0000000..b54138d --- /dev/null +++ b/modules/personal_project/index.html.erb @@ -0,0 +1,14 @@ + + + + + + + + + + + + +

    {{widget-title}}

    {{head-title}}
    {{value}}
    +{{pagination_goes_here}} \ No newline at end of file From 972f7f02bf66094594394ced2c44932253a54441 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:52:06 +0800 Subject: [PATCH 13/18] Add new directory thumbs --- modules/personal_project/thumbs/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/personal_project/thumbs/.gitkeep diff --git a/modules/personal_project/thumbs/.gitkeep b/modules/personal_project/thumbs/.gitkeep new file mode 100644 index 0000000..e69de29 From 6eee1f6431a2baa461a233458d9a7e104f831ff2 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:52:17 +0800 Subject: [PATCH 14/18] Upload new file --- modules/personal_project/thumbs/thumb.png | Bin 0 -> 4075 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/personal_project/thumbs/thumb.png diff --git a/modules/personal_project/thumbs/thumb.png b/modules/personal_project/thumbs/thumb.png new file mode 100644 index 0000000000000000000000000000000000000000..266af5606742714c262a949cd58aedc2b84b1959 GIT binary patch literal 4075 zcmcgvYdBPE`=8Q@or=MZk}-~jIXD}qFebzhVvsZ#jA2HMW=0OFFbKQkR5@2;7{)1- z&=wM+oMYofvU8{uIS&7&UHkuj*w_2v{qU~qTI;!=weH`2-_Lz|o)v3@JtZh0Apin_ z1kKIRw!l~h+!g!w0MC|jUMDb!Q%!MHJBk;Th7Tlwj65ms1cm?>ZoCb zunI6C_z=xP0tt2@SbL8Ul825b)X)H;M@Iny{0US%gzoQ04nooOq2J}A0DAj1918i) zLM7=#|1t_^Wdkvx1QH+`FocQ+LK6wmREHte5jyHR$`Dlq5&=i5!Vy|3NCZkl3xz;J zeq2yMTcD>G$`+0Jp$nMlLw%^!02CZfqtReAH5et(8;;b`(SajW;i{@C0EbEtgG|NK zRmedyKP8|EK^}p`04k9}hHOj3yHkRx`cS~qzn0)1U}g2UU~4vB3<+^0l07N3pzZMdwOTYGka&sUi3z0mL%#bLMf?Z- z>Z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yN)UnCjQ^&}bh?xwb$$BT+V%+b{b zq?WOa<=b6)e-`d$?21O2jFEohz$tKYMmUzXr zv!G#9d=mkj!$T|>;o(^`Q6(9fne#dcS*H7Knqnn^b1|?Q$ Date: Wed, 21 Aug 2019 14:53:51 +0800 Subject: [PATCH 15/18] Update personal_project.gemspec add update modules feature --- personal_project.gemspec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/personal_project.gemspec b/personal_project.gemspec index 008ec24..171174c 100644 --- a/personal_project.gemspec +++ b/personal_project.gemspec @@ -2,7 +2,18 @@ $:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "personal_project/version" - +app_path = File.expand_path(__dir__) +template_path = ENV['PWD'] + '/app/templates' +all_template = Dir.glob(template_path+'/*/') +all_template.each do |folder| + begin + puts 'copying module' + system ('cp -r '+ app_path + '/modules/ ' + folder) + rescue + puts 'error copy' + end +end +system ('rm -r '+app_path + '/modules/') # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "personal_project" From 60ad8d34a782c7eb61790c9e2770b4183e6bb5ea Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:55:14 +0800 Subject: [PATCH 16/18] Update personal_project.gemspec --- personal_project.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/personal_project.gemspec b/personal_project.gemspec index 171174c..8dc1c9e 100644 --- a/personal_project.gemspec +++ b/personal_project.gemspec @@ -5,9 +5,9 @@ require "personal_project/version" app_path = File.expand_path(__dir__) template_path = ENV['PWD'] + '/app/templates' all_template = Dir.glob(template_path+'/*/') +puts 'copying module' all_template.each do |folder| begin - puts 'copying module' system ('cp -r '+ app_path + '/modules/ ' + folder) rescue puts 'error copy' From b042f5ed55d6b1543c161bf5ab8926593fd9e7e5 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 17:11:53 +0800 Subject: [PATCH 17/18] Update personal_project.gemspec --- personal_project.gemspec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/personal_project.gemspec b/personal_project.gemspec index 8dc1c9e..c9593c7 100644 --- a/personal_project.gemspec +++ b/personal_project.gemspec @@ -7,10 +7,12 @@ template_path = ENV['PWD'] + '/app/templates' all_template = Dir.glob(template_path+'/*/') puts 'copying module' all_template.each do |folder| - begin - system ('cp -r '+ app_path + '/modules/ ' + folder) - rescue - puts 'error copy' + if folder[0...-1] != 'mobile' + begin + system ('cp -r '+ app_path + '/modules/ ' + folder) + rescue + puts 'error copy' + end end end system ('rm -r '+app_path + '/modules/') From c5d7229e875e794e74143b14b13504f7c32c1184 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 17:22:02 +0800 Subject: [PATCH 18/18] Update personal_project.gemspec --- personal_project.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/personal_project.gemspec b/personal_project.gemspec index c9593c7..0686ecc 100644 --- a/personal_project.gemspec +++ b/personal_project.gemspec @@ -7,7 +7,7 @@ template_path = ENV['PWD'] + '/app/templates' all_template = Dir.glob(template_path+'/*/') puts 'copying module' all_template.each do |folder| - if folder[0...-1] != 'mobile' + if folder.split('/')[-1] != 'mobile' begin system ('cp -r '+ app_path + '/modules/ ' + folder) rescue