lib/chef-cli/skeletons/code_generator/recipes/template.rb
context = ChefCLI::Generator.context cookbook_dir = File.join(context.cookbook_root, context.cookbook_name) template_dir = File.join(cookbook_dir, 'templates') template_filename = context.new_file_basename unless File.extname(template_filename) == '.erb' # new_file_basename is a frozen string, so we have to create an entirely # new string here instead of using concat. template_filename = "#{template_filename}.erb" end template_path = File.join(cookbook_dir, 'templates', template_filename) directory template_dir do recursive true end if context.content_source file template_path do content(IO.read(context.content_source)) end else template template_path do source 'template.erb' helpers(ChefCLI::Generator::TemplateHelper) end end
Source Files
- lib/chef-cli.rb
- lib/chef-cli/authenticated_http.rb
- lib/chef-cli/builtin_commands.rb
- lib/chef-cli/chef_runner.rb
- lib/chef-cli/chef_server_api_multi.rb
- lib/chef-cli/cli.rb
- lib/chef-cli/command/base.rb
- lib/chef-cli/command/clean_policy_cookbooks.rb
- lib/chef-cli/command/clean_policy_revisions.rb
- lib/chef-cli/command/delete_policy.rb
- lib/chef-cli/command/delete_policy_group.rb
- lib/chef-cli/command/describe_cookbook.rb
- lib/chef-cli/command/diff.rb
- lib/chef-cli/command/env.rb
- lib/chef-cli/command/exec.rb
- lib/chef-cli/command/export.rb
- lib/chef-cli/command/gem.rb
- lib/chef-cli/command/generate.rb
- lib/chef-cli/command/generator_commands.rb
- lib/chef-cli/command/generator_commands/attribute.rb
- lib/chef-cli/command/generator_commands/base.rb
- lib/chef-cli/command/generator_commands/chef_exts/generator_desc_resource.rb
- lib/chef-cli/command/generator_commands/chef_exts/quieter_doc_formatter.rb
- lib/chef-cli/command/generator_commands/chef_exts/recipe_dsl_ext.rb
- lib/chef-cli/command/generator_commands/cookbook.rb
- lib/chef-cli/command/generator_commands/cookbook_code_file.rb
- lib/chef-cli/command/generator_commands/cookbook_file.rb
- lib/chef-cli/command/generator_commands/generator_generator.rb
- lib/chef-cli/command/generator_commands/helpers.rb
- lib/chef-cli/command/generator_commands/input.rb
- lib/chef-cli/command/generator_commands/policyfile.rb
- lib/chef-cli/command/generator_commands/profile.rb
- lib/chef-cli/command/generator_commands/recipe.rb
- lib/chef-cli/command/generator_commands/repo.rb
- lib/chef-cli/command/generator_commands/resource.rb
- lib/chef-cli/command/generator_commands/template.rb
- lib/chef-cli/command/generator_commands/waiver.rb
- lib/chef-cli/command/install.rb
- lib/chef-cli/command/push.rb
- lib/chef-cli/command/push_archive.rb
- lib/chef-cli/command/shell_init.rb
- lib/chef-cli/command/show_policy.rb
- lib/chef-cli/command/undelete.rb
- lib/chef-cli/command/update.rb
- lib/chef-cli/commands_map.rb
- lib/chef-cli/configurable.rb
- lib/chef-cli/cookbook_metadata.rb
- lib/chef-cli/cookbook_omnifetch.rb
- lib/chef-cli/cookbook_profiler/git.rb
- lib/chef-cli/cookbook_profiler/identifiers.rb
- lib/chef-cli/cookbook_profiler/null_scm.rb
- lib/chef-cli/dist.rb
- lib/chef-cli/exceptions.rb
- lib/chef-cli/generator.rb
- lib/chef-cli/helpers.rb
- lib/chef-cli/pager.rb
- lib/chef-cli/policyfile/artifactory_cookbook_source.rb
- lib/chef-cli/policyfile/attribute_merge_checker.rb
- lib/chef-cli/policyfile/chef_repo_cookbook_source.rb
- lib/chef-cli/policyfile/chef_server_cookbook_source.rb
- lib/chef-cli/policyfile/chef_server_lock_fetcher.rb
- lib/chef-cli/policyfile/community_cookbook_source.rb
- lib/chef-cli/policyfile/comparison_base.rb
- lib/chef-cli/policyfile/cookbook_location_specification.rb
- lib/chef-cli/policyfile/cookbook_locks.rb
- lib/chef-cli/policyfile/cookbook_sources.rb
- lib/chef-cli/policyfile/delivery_supermarket_source.rb
- lib/chef-cli/policyfile/differ.rb
- lib/chef-cli/policyfile/dsl.rb
- lib/chef-cli/policyfile/git_lock_fetcher.rb
- lib/chef-cli/policyfile/included_policies_cookbook_source.rb
- lib/chef-cli/policyfile/lister.rb
- lib/chef-cli/policyfile/local_lock_fetcher.rb
- lib/chef-cli/policyfile/lock_applier.rb
- lib/chef-cli/policyfile/lock_fetcher_mixin.rb
- lib/chef-cli/policyfile/null_cookbook_source.rb
- lib/chef-cli/policyfile/policyfile_location_specification.rb
- lib/chef-cli/policyfile/read_cookbook_for_compat_mode_upload.rb
- lib/chef-cli/policyfile/remote_lock_fetcher.rb
- lib/chef-cli/policyfile/reports/install.rb
- lib/chef-cli/policyfile/reports/table_printer.rb
- lib/chef-cli/policyfile/reports/upload.rb
- lib/chef-cli/policyfile/solution_dependencies.rb
- lib/chef-cli/policyfile/source_uri.rb
- lib/chef-cli/policyfile/storage_config.rb
- lib/chef-cli/policyfile/undo_record.rb
- lib/chef-cli/policyfile/undo_stack.rb
- lib/chef-cli/policyfile/uploader.rb
- lib/chef-cli/policyfile_compiler.rb
- lib/chef-cli/policyfile_lock.rb
- lib/chef-cli/policyfile_services/clean_policies.rb
- lib/chef-cli/policyfile_services/clean_policy_cookbooks.rb
- lib/chef-cli/policyfile_services/export_repo.rb
- lib/chef-cli/policyfile_services/install.rb
- lib/chef-cli/policyfile_services/push.rb
- lib/chef-cli/policyfile_services/push_archive.rb
- lib/chef-cli/policyfile_services/rm_policy.rb
- lib/chef-cli/policyfile_services/rm_policy_group.rb
- lib/chef-cli/policyfile_services/show_policy.rb
- lib/chef-cli/policyfile_services/undelete.rb
- lib/chef-cli/policyfile_services/update_attributes.rb
- lib/chef-cli/service_exception_inspectors.rb
- lib/chef-cli/service_exception_inspectors/base.rb
- lib/chef-cli/service_exception_inspectors/http.rb
- lib/chef-cli/service_exceptions.rb
- lib/chef-cli/shell_out.rb
- lib/chef-cli/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb
- lib/chef-cli/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb
- lib/chef-cli/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb
- lib/chef-cli/skeletons/code_generator/files/default/spec_helper.rb
- lib/chef-cli/skeletons/code_generator/files/default/spec_helper_policyfile.rb
- lib/chef-cli/skeletons/code_generator/metadata.rb
- lib/chef-cli/skeletons/code_generator/recipes/attribute.rb
- lib/chef-cli/skeletons/code_generator/recipes/cookbook.rb
- lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
- lib/chef-cli/skeletons/code_generator/recipes/helpers.rb
- lib/chef-cli/skeletons/code_generator/recipes/input.rb
- lib/chef-cli/skeletons/code_generator/recipes/policyfile.rb
- lib/chef-cli/skeletons/code_generator/recipes/profile.rb
- lib/chef-cli/skeletons/code_generator/recipes/recipe.rb
- lib/chef-cli/skeletons/code_generator/recipes/repo.rb
- lib/chef-cli/skeletons/code_generator/recipes/resource.rb
- lib/chef-cli/skeletons/code_generator/recipes/template.rb
- lib/chef-cli/skeletons/code_generator/recipes/waiver.rb
- lib/chef-cli/ui.rb
- lib/chef-cli/version.rb
- lib/kitchen/provisioner/chef_zero_capture.rb
- lib/kitchen/provisioner/policyfile_zero.rb