Class: Confire::ProjectCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/confire/project_creator.rb

Instance Method Summary collapse

Instance Method Details

#create(project_name) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/confire/project_creator.rb', line 3

def create(project_name)
  # make dir with that project_name
  Dir.mkdir project_name

  # copy files in
  FileUtils.cp(filename_with_path('lib/confire/templates/config.yml'), project_name)
  FileUtils.cp(filename_with_path('lib/confire/templates/Gemfile'), project_name)
  FileUtils.cp(filename_with_path('lib/confire/templates/Rakefile'), project_name)
  FileUtils.cp(filename_with_path('lib/confire/templates/driver.rb'), project_name)
  FileUtils.cp(filename_with_path('lib/confire/templates/custom_processor.rb'), project_name)
  FileUtils.cp_r(filename_with_path('lib/confire/templates/spec'), project_name)
  FileUtils.cp(filename_with_path('lib/confire/templates/run.sh'), project_name)
  FileUtils.cp(filename_with_path('lib/confire/templates/input_sample.txt'), project_name)
  FileUtils.cp(filename_with_path('lib/confire/templates/README.txt'), project_name)

  #copy_and_rename project_name, 'lib/confire/templates/config_sample.yml', 'config_sample.yml', 'config.yml'
  #copy_and_rename project_name, 'lib/confire/templates/processor.rb', 'config_sample.yml', 'config.yml'
end