Class: RosettAi::Thor::Tasks::Init

Inherits:
Thor
  • Object
show all
Defined in:
lib/rosett_ai/thor/tasks/init.rb

Overview

Thor task for initializing rai project structure

Constant Summary collapse

PROJECT_DIRS =
['conf', 'conf/behaviour', 'conf/design'].freeze

Instance Method Summary collapse

Instance Method Details

#setupObject

Raises:

  • (::Thor::Error)


58
59
60
61
62
63
64
65
66
67
# File 'lib/rosett_ai/thor/tasks/init.rb', line 58

def setup
  raise ::Thor::Error, t('no_scope') unless options[:global] || options[:local] || options[:project]

  results = { created: 0, ok: 0, skipped: 0 }
  setup_global(results)  if options[:global]
  setup_project(results) if options[:project]
  setup_local(results)   if options[:local]
  run_compile unless options[:no_compile]
  print_summary(results)
end