Class: Nexo::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Nexo::Generators::InstallGenerator
- 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
-
#copy_initializer ⇒ Object
Generation step: copy the provider-neutral
config/initializers/nexo.rbinto the host app. -
#create_directories ⇒ Object
Generation step: create the app/agents, app/workflows, and app/skills directories, each with a committable
.keep.
Instance Method Details
#copy_initializer ⇒ Object
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_directories ⇒ Object
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 |