Class: Makit::Cli::Generators::BaseGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/makit/cli/generators/base_generator.rb

Overview

Base class for all project generators providing common functionality

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ BaseGenerator

Returns a new instance of BaseGenerator.



12
13
14
15
# File 'lib/makit/cli/generators/base_generator.rb', line 12

def initialize(name, options = {})
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/makit/cli/generators/base_generator.rb', line 10

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/makit/cli/generators/base_generator.rb', line 10

def options
  @options
end

Instance Method Details

#generate(project_dir) ⇒ Object

Main generation method - creates the complete project structure



18
19
20
21
22
# File 'lib/makit/cli/generators/base_generator.rb', line 18

def generate(project_dir)
  create_directory_structure(project_dir)
  create_files(project_dir)
  display_success_message(project_dir)
end