Method: Retrospec::Puppet::Generators::TaskGenerator#generate_task_files

Defined in:
lib/retrospec/plugins/v1/plugin/generators/task_generator.rb

#generate_task_filesObject



65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/retrospec/plugins/v1/plugin/generators/task_generator.rb', line 65

def generate_task_files
  context.task_type = task_type
  context.shebang = shebang
  context.task_params_output = task_params_output
  context.task_params = task_params
  parameter_template = File.join(template_dir, 'task_parameters.json.retrospec.erb')
  task_template = Dir.glob(File.join(template_dir, 'types', task_type, '*')).first
  unless task_template
    task_template = Dir.glob(File.join(template_dir, 'types', 'task.retrospec.erb')).first
  end
  safe_create_template_file(task_filepath, task_template, context)
  safe_create_template_file(task_params_filepath, parameter_template, context)
  [task_filepath, task_params_filepath]
end