Module: Taeval::CLI

Defined in:
lib/taeval/cli.rb

Class Method Summary collapse

Class Method Details

.parse_options(options = ARGV) ⇒ Object



9
10
11
12
13
14
# File 'lib/taeval/cli.rb', line 9

def parse_options(options = ARGV)
  if options.size != 1 || options.first != 'init'
    raise "Argument must be init! Use `taeval init` to initialize project." 
  end
  options 
end

.start(opts) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/taeval/cli.rb', line 16

def start(opts)
  puts "Initialize configuration ..."
  dest = Dir.pwd
  path = File.join(File.dirname(File.expand_path(__FILE__)), '../../config')
  config_files = Dir.glob("#{path}/*")

  config_files.each do |conf|
    FileUtils.cp(conf, dest)
  end
end