Class: Voicemaker::Commands::NewCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/voicemaker/commands/new_command.rb

Instance Method Summary collapse

Methods inherited from Base

api_environment

Instance Method Details

#config_commandObject



19
20
21
# File 'lib/voicemaker/commands/new_command.rb', line 19

def config_command
  copy_config_template args['PATH']
end

#project_commandObject



23
24
25
26
27
28
29
30
31
# File 'lib/voicemaker/commands/new_command.rb', line 23

def project_command
  base = args['DIR']
  copy_config_template "#{base}/config.yml"
  Dir.mkdir "#{base}/in" unless Dir.exist? "#{base}/in"
  Dir.mkdir "#{base}/out" unless Dir.exist? "#{base}/out"
  File.write "#{base}/in/sample1.txt", "hello"
  File.write "#{base}/in/sample2.txt", "hello"
  say "created in and out folders in #{base}"
end