Class: ActiveHarness::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActiveHarness::Generators::InstallGenerator
- Defined in:
- lib/generators/active_harness/install/install_generator.rb
Constant Summary collapse
- APP_AI_DIRS =
%w[agents prompts tribunals pipelines memory].freeze
Instance Method Summary collapse
Instance Method Details
#copy_controller ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/generators/active_harness/install/install_generator.rb', line 19 def copy_controller target = File.join(destination_root, "app", "controllers", "ai_test_support_controller.rb") return if File.exist?(target) copy_file "controllers/ai_controller.rb", "app/controllers/ai_test_support_controller.rb" end |
#create_structure ⇒ Object
12 13 14 15 16 17 |
# File 'lib/generators/active_harness/install/install_generator.rb', line 12 def create_structure APP_AI_DIRS.each do |dir| empty_directory "app/ai/#{dir}" copy_templates_if_empty(dir) end end |
#inject_routes ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/generators/active_harness/install/install_generator.rb', line 27 def inject_routes route <<~ROUTES.strip # ActiveHarness — AI test support endpoints post "ai/agent", to: "ai_test_support#agent" post "ai/agent_memory", to: "ai_test_support#agent_memory" post "ai/tribunal", to: "ai_test_support#tribunal" post "ai/pipeline", to: "ai_test_support#pipeline" get "ai/agent_stream", to: "ai_test_support#agent_stream" ROUTES end |