Class: ChefCLI::Command::GeneratorCommands::Template

Inherits:
CookbookCodeFile show all
Defined in:
lib/chef-cli/command/generator_commands/template.rb

Overview

chef generate template [path/to/cookbook_root] name --source=source_file

Instance Attribute Summary

Attributes inherited from CookbookCodeFile

#cookbook_path, #errors, #new_file_basename

Attributes inherited from Base

#params

Instance Method Summary collapse

Methods inherited from CookbookCodeFile

#cookbook_name, #cookbook_root, #initialize, #params_valid?, #read_and_validate_params, #run, #validate_cookbook_path

Methods inherited from Base

#chef_runner, #generator_cookbook_name, #generator_cookbook_path, #have_git?, #initialize

Methods included from ChefCLI::Configurable

#chef_config, #chefcli_config, #config_loader, #generator_config, #knife_config, #reset_config!

Constructor Details

This class inherits a constructor from ChefCLI::Command::GeneratorCommands::CookbookCodeFile

Instance Method Details

#recipeObject



36
37
38
# File 'lib/chef-cli/command/generator_commands/template.rb', line 36

def recipe
  "template"
end

#setup_contextObject



40
41
42
43
# File 'lib/chef-cli/command/generator_commands/template.rb', line 40

def setup_context
  super
  Generator.add_attr_to_context(:content_source, config[:source])
end