-
Notifications
You must be signed in to change notification settings - Fork 61
/
mfse_split_code_base.thor
36 lines (26 loc) · 1.34 KB
/
mfse_split_code_base.thor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#require 'rails/generators/actions'
# thor mfse_split_code_base:copy_common_files Pages
class MfseSplitCodeBase < Thor
include Thor::Actions
desc "copy_common_files SECTION_NAME", "initialize a section, e.g. TeamCourses "
# This copies files needed for every project
def copy_common_files(section_name)
section_directory = "Team" + section_name + "/"
empty_directory section_directory
project_directory = section_directory + "CMUEducation/"
empty_directory project_directory
empty_directory project_directory + "db"
empty_directory project_directory + "app/models"
empty_directory project_directory + "app/services"
copy_file "Gemfile", project_directory + "Gemfile"
copy_file "db/schema.rb", project_directory + "db/schema.rb"
copy_file "app/controllers/application_controller.rb", project_directory + "app/controllers/application_controller.rb"
copy_file "app/helpers/application_helper.rb", project_directory + "app/helpers/application_helper.rb"
copy_file "app/mailers/generic_mailer.rb", project_directory + "app/mailers/generic_mailer.rb"
directory "app/views/generic_mailer/", project_directory + "app/views/generic_mailer/"
copy_file "app/services/academic_calendar.rb", project_directory + "app/services/academic_calendar.rb"
end
def self.source_root
File.dirname(__FILE__)
end
end