Class: ActiveAgent::Dashboard::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActiveAgent::Dashboard::Generators::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/active_agent/dashboard/install/install_generator.rb
Overview
Generator for installing the ActiveAgent Dashboard engine.
Usage:
rails generate active_agent:dashboard:install
This will:
-
Copy migration files for all dashboard models
-
Create an initializer for configuration
-
Add the engine mount to routes.rb
-
Seed default agent templates
Instance Method Summary collapse
- #copy_migrations ⇒ Object
- #create_initializer ⇒ Object
- #mount_engine ⇒ Object
- #show_post_install ⇒ Object
Instance Method Details
#copy_migrations ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/generators/active_agent/dashboard/install/install_generator.rb', line 34 def copy_migrations return if [:skip_migrations] migration_template "migrations/create_active_agent_agents.rb", "db/migrate/create_active_agent_agents.rb" migration_template "migrations/create_active_agent_agent_versions.rb", "db/migrate/create_active_agent_agent_versions.rb" migration_template "migrations/create_active_agent_agent_runs.rb", "db/migrate/create_active_agent_agent_runs.rb" migration_template "migrations/create_active_agent_agent_templates.rb", "db/migrate/create_active_agent_agent_templates.rb" migration_template "migrations/create_active_agent_sandbox_sessions.rb", "db/migrate/create_active_agent_sandbox_sessions.rb" migration_template "migrations/create_active_agent_sandbox_runs.rb", "db/migrate/create_active_agent_sandbox_runs.rb" migration_template "migrations/create_active_agent_session_recordings.rb", "db/migrate/create_active_agent_session_recordings.rb" migration_template "migrations/create_active_agent_telemetry_traces.rb", "db/migrate/create_active_agent_telemetry_traces.rb" end |
#create_initializer ⇒ Object
62 63 64 |
# File 'lib/generators/active_agent/dashboard/install/install_generator.rb', line 62 def create_initializer template "initializer.rb", "config/initializers/active_agent_dashboard.rb" end |
#mount_engine ⇒ Object
66 67 68 69 70 |
# File 'lib/generators/active_agent/dashboard/install/install_generator.rb', line 66 def mount_engine return if [:skip_routes] route 'mount ActiveAgent::Dashboard::Engine => "/active_agent"' end |
#show_post_install ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/generators/active_agent/dashboard/install/install_generator.rb', line 72 def show_post_install say "" say "ActiveAgent Dashboard installed!", :green say "" say "Next steps:" say " 1. Run migrations: rails db:migrate" say " 2. Seed templates: rails active_agent:dashboard:seed" say " 3. Configure authentication in config/initializers/active_agent_dashboard.rb" say " 4. Visit /active_agent to access the dashboard" say "" end |