lib/berkshelf/cookbook_generator.rb in berkshelf-3.0.0.beta9 vs lib/berkshelf/cookbook_generator.rb in berkshelf-3.0.0.rc1

- old
+ new

@@ -46,18 +46,29 @@ class_option :maintainer_email, type: :string, default: Berkshelf.config.cookbook.email def generate - empty_directory target.join('files/default') - empty_directory target.join('templates/default') - empty_directory target.join('attributes') - empty_directory target.join('libraries') - empty_directory target.join('providers') - empty_directory target.join('recipes') - empty_directory target.join('resources') + case options[:pattern] + when "library" + empty_directory target.join("libraries") + empty_directory target.join("providers") + empty_directory target.join("resources") + when "wrapper" + empty_directory target.join("attributes") + empty_directory target.join("recipes") + template "default_recipe.erb", target.join("recipes/default.rb") + when "environment", "application" + empty_directory target.join("files/default") + empty_directory target.join("templates/default") + empty_directory target.join("attributes") + empty_directory target.join("libraries") + empty_directory target.join("providers") + empty_directory target.join("recipes") + empty_directory target.join("resources") + template "default_recipe.erb", target.join("recipes/default.rb") + end - template 'default_recipe.erb', target.join('recipes/default.rb') template 'metadata.rb.erb', target.join('metadata.rb') template license_file, target.join('LICENSE') template 'README.md.erb', target.join('README.md') template 'CHANGELOG.md.erb', target.join('CHANGELOG.md')