Class: DeployPin::TaskGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- DeployPin::TaskGenerator
- Defined in:
- lib/generators/deploy_pin/task/task_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_task_file ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/deploy_pin/task/task_generator.rb', line 10 def create_task_file raise "Not allowed 'group' argument! possible values are #{DeployPin.groups}" \ unless DeployPin.groups.include?(group) template_file = if [:parallel] 'parallel_task.rb.erb' else 'task.rb.erb' end @uuid = Time.now.strftime('%Y%m%d%H%M%S') template template_file, "#{DeployPin.tasks_path}/#{@uuid}_task.rb" end |