63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
# File 'lib/berkshelf/init_generator.rb', line 63
def generate
validate_cookbook
validate_configuration
check_option_support
template 'Berksfile.erb', target.join('Berksfile')
template 'Thorfile.erb', target.join('Thorfile')
if options[:chefignore]
copy_file 'chefignore', target.join(Ridley::Chef::Chefignore::FILENAME)
end
unless options[:skip_git]
template 'gitignore.erb', target.join('.gitignore')
unless File.exists?(target.join('.git'))
inside target do
git 'init'
end
end
end
if options[:chef_minitest]
empty_directory target.join('files/default/tests/minitest/support')
template 'default_test.rb.erb', target.join('files/default/tests/minitest/default_test.rb')
template 'helpers.rb.erb', target.join('files/default/tests/minitest/support/helpers.rb')
end
if options[:scmversion]
create_file target.join('VERSION'), '0.1.0'
end
unless options[:no_bundler]
template 'Gemfile.erb', target.join('Gemfile')
end
if defined?(Kitchen::Generator::Init)
unless options[:skip_test_kitchen]
Kitchen::Generator::Init.new([], {}, destination_root: target).invoke_all
end
end
unless options[:skip_vagrant]
template 'Vagrantfile.erb', target.join('Vagrantfile')
end
end
|