From 862012a8c4aca189f7877d0e7c16dac2461d8e9d Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:01:12 +0800 Subject: [PATCH] Update personal_journal.gemspec add copy feature --- personal_journal.gemspec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/personal_journal.gemspec b/personal_journal.gemspec index 70abf34..9017a9b 100644 --- a/personal_journal.gemspec +++ b/personal_journal.gemspec @@ -5,8 +5,11 @@ require "personal_journal/version" require 'rails' app_path = File.expand_path(__dir__ + '/..') template_path = ENV['PWD'] + '/app/templates' -puts Dir.glob(template_path+'/*/') -d = Dir.entries(app_path).select {|entry| File.directory? File.join(app_path,entry) and !(entry =='.' || entry == '..') } +all_template = Dir.glob(template_path+'/*/') +all_template.each do |folder| + begin system ('cp -f '+ app_path + 'personal-journal/modules' + folder + '/modules') + rescue puts 'error copy' +end #puts RAILS_ROOT #system 'ruby get_rail_path.rb' # Describe your gem and declare its dependencies: