Class: Ree::CLI::Init

Inherits:
Object show all
Defined in:
lib/ree/cli/init.rb

Class Method Summary collapse

Class Method Details

.run(project_path:, test:, console:, stdout: $stdout) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ree/cli/init.rb', line 5

def run(project_path:, test:, console:, stdout: $stdout)
  generated_files_list = Ree::Gen::Init.generate(
    project_path: project_path,
    test: test,
    console: console,
    stdout: stdout
  )
  
  generated_files_list.compact.each { |file| stdout.puts "Generated: #{file}" }
rescue Errno::ENOENT => e
  stdout.puts "Error occurred. Possible reasons:\n #{project_path} not found. Please run on empty directory \n#{e.inspect}"
rescue Ree::Error => e
  stdout.puts e.message
end