Class: CrawlStation::Command::Create

Inherits:
Thor
  • Object
show all
Defined in:
lib/crawl_station/command/create.rb

Instance Method Summary collapse

Instance Method Details

#create(args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/crawl_station/command/create.rb', line 6

def create(args)
  dir_root = args.first
  logs "create project #{dir_root}"
  template_create_path = "#{utils.templates_path}/create/dirs"
  FileUtils.copy_entry template_create_path, dir_root
  render_database(dir_root)
  logs "cd #{dir_root}"
  path = "#{Dir.pwd}/#{dir_root}"
  Dir.chdir(path)
  logs 'bundle install'
  IO.popen('bundle install').each { |line| logs line.chomp }
  logs 'done'
end