Class: CleanArch::CLI

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

Instance Method Summary collapse

Instance Method Details

#generate(project_name) ⇒ Object

Raises:



11
12
13
14
15
16
17
18
# File 'lib/clean_arch/cli.rb', line 11

def generate(project_name)
  project_path = File.join(Dir.pwd, project_name)

  raise Error, "Error: Directory #{project_name} already exists!" if Dir.exist?(project_path)

  create_structure(project_name)
  puts "Project #{project_name} has been successfully created!"
end