Class: Arfi::Commands::Project

Inherits:
Thor
  • Object
show all
Defined in:
lib/arfi/commands/project.rb

Overview

Arfi::Commands::Project class is used to create ‘db/functions` directory.

Instance Method Summary collapse

Instance Method Details

#createvoid

This method returns an undefined value.

Arfi::Commands::Project#create -> void

This command is used to create ‘db/functions` directory.

Examples:

bundle exec arfi project create

Raises:



20
21
22
23
24
25
26
# File 'lib/arfi/commands/project.rb', line 20

def create
  raise Arfi::Errors::InvalidSchemaFormat unless ActiveRecord.schema_format == :ruby
  return puts "Directory #{functions_dir} already exists" if Dir.exist?(functions_dir)

  FileUtils.mkdir_p(functions_dir)
  puts "Created: #{functions_dir}"
end