Class: Nexo::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/nexo/install/install_generator.rb

Overview

Sets up the conventional Nexo layout in a host Rails app:

rails g nexo:install

creates the app/agents, app/workflows and app/skills directories (each with a committable .keep) and a provider-neutral config/initializers/nexo.rb.

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject

Generation step: copy the provider-neutral config/initializers/nexo.rb into the host app.



30
31
32
# File 'lib/generators/nexo/install/install_generator.rb', line 30

def copy_initializer
  copy_file "nexo.rb", "config/initializers/nexo.rb"
end

#create_directoriesObject

Generation step: create the app/agents, app/workflows, and app/skills directories, each with a committable .keep.



21
22
23
24
25
26
# File 'lib/generators/nexo/install/install_generator.rb', line 21

def create_directories
  %w[app/agents app/workflows app/skills].each do |dir|
    empty_directory dir
    create_file "#{dir}/.keep" unless File.exist?("#{dir}/.keep")
  end
end