Sha256: 6c513c367d9b0745279b432365be117370adb126cb56f5c33dac2bb7a09ac25c

Contents?: true

Size: 505 Bytes

Versions: 23

Compression:

Stored size: 505 Bytes

Contents

context = ChefCLI::Generator.context
cookbook_dir = File.join(context.cookbook_root, context.cookbook_name)
files_dir = File.join(cookbook_dir, 'files')
cookbook_file_path = File.join(files_dir, context.new_file_basename)

directory files_dir do
  recursive true
end

if context.content_source

  file cookbook_file_path do
    content(IO.read(context.content_source))
  end

else

  template cookbook_file_path do
    source 'cookbook_file.erb'
    helpers(ChefCLI::Generator::TemplateHelper)
  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
chef-cli-3.0.35 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.33 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.32 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.31 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.30 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.27 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.24 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.23 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.22 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.16 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.14 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.11 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.10 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.9 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.7 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.4 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-3.0.1 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-2.0.10 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-2.0.0 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb
chef-cli-1.0.16 lib/chef-cli/skeletons/code_generator/recipes/cookbook_file.rb