Class: Cmdx::WorkflowGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Cmdx::WorkflowGenerator
- Defined in:
- lib/generators/cmdx/workflow_generator.rb
Overview
Generates CMDx workflow files for Rails applications
This generator creates task classes that inherit from either ApplicationTask (if defined) or CMDx::Task. It generates the task file in the standard Rails tasks directory structure.
Instance Method Summary collapse
-
#copy_files ⇒ void
Copies the task template to the Rails application.
Instance Method Details
#copy_files ⇒ void
This method returns an undefined value.
Copies the task template to the Rails application
Creates a new task file at ‘app/tasks//[file_name].rb` using the task template. The file is placed in the standard Rails tasks directory structure, maintaining proper namespacing if the task is nested.
30 31 32 33 |
# File 'lib/generators/cmdx/workflow_generator.rb', line 30 def copy_files path = File.join("app/tasks", class_path, "#{file_name}.rb") template("workflow.rb.tt", path) end |