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