Class: Cmdx::WorkflowGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Cmdx::WorkflowGenerator
- Defined in:
- lib/generators/cmdx/workflow_generator.rb
Overview
Rails generator that scaffolds a new CMDx::Workflow subclass under
app/tasks, honoring nested module paths supplied through the NAME
argument (e.g. Billing::Checkout writes to
app/tasks/billing/checkout.rb).
Invoked via rails generate cmdx:workflow NAME.
Instance Method Summary collapse
-
#copy_files ⇒ void
Renders
workflow.rb.ttintoapp/tasks/<class_path>/<file_name>.rb.
Instance Method Details
#copy_files ⇒ void
This method returns an undefined value.
Renders workflow.rb.tt into app/tasks/<class_path>/<file_name>.rb.
21 22 23 24 |
# File 'lib/generators/cmdx/workflow_generator.rb', line 21 def copy_files path = File.join("app/tasks", class_path, "#{file_name}.rb") template("workflow.rb.tt", path) end |