Class: Infrataster::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/infrataster/cli.rb

Instance Method Summary collapse

Instance Method Details

#initObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/infrataster/cli.rb', line 9

def init
  path = File.expand_path(options[:path])
  FileUtils.mkdir_p(path)
  create_file_from_template(File.expand_path("Gemfile", path))
  create_file_from_template(File.expand_path("Rakefile", path))
  FileUtils.mkdir(File.expand_path("spec", path))
  if ask_yes_or_no("Use Vagrant?")
    create_file_from_template(File.expand_path("spec/Vagrantfile", path))
  end
  create_file_from_template(File.expand_path("spec/spec_helper.rb", path))
  create_file_from_template(File.expand_path("spec/app_spec.rb", path))
end