chef-gen-flavor-base 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/History.md +6 -0
- data/LICENSE +17 -0
- data/Manifest.txt +50 -0
- data/README.md +818 -0
- data/chef-gen-flavor-base.gemspec +84 -0
- data/lib/chef_gen/flavor_base.rb +185 -0
- data/lib/chef_gen/flavor_base/copy_helpers.rb +45 -0
- data/lib/chef_gen/flavor_base/resource_helpers.rb +110 -0
- data/lib/chef_gen/snippet/actions_taken.rb +82 -0
- data/lib/chef_gen/snippet/attributes.rb +35 -0
- data/lib/chef_gen/snippet/chef_spec.rb +121 -0
- data/lib/chef_gen/snippet/cookbook_base.rb +135 -0
- data/lib/chef_gen/snippet/debugging.rb +26 -0
- data/lib/chef_gen/snippet/example_file.rb +36 -0
- data/lib/chef_gen/snippet/example_template.rb +36 -0
- data/lib/chef_gen/snippet/git_init.rb +36 -0
- data/lib/chef_gen/snippet/guard.rb +70 -0
- data/lib/chef_gen/snippet/next_steps.rb +44 -0
- data/lib/chef_gen/snippet/no_clobber.rb +62 -0
- data/lib/chef_gen/snippet/recipes.rb +35 -0
- data/lib/chef_gen/snippet/resource_provider.rb +37 -0
- data/lib/chef_gen/snippet/standard_ignore.rb +85 -0
- data/lib/chef_gen/snippet/style_foodcritic.rb +73 -0
- data/lib/chef_gen/snippet/style_rubocop.rb +115 -0
- data/lib/chef_gen/snippet/style_tailor.rb +64 -0
- data/lib/chef_gen/snippet/test_kitchen.rb +129 -0
- data/lib/chef_gen/snippet_base.rb +46 -0
- data/lib/chef_gen/snippets.rb +24 -0
- data/shared/snippet/attributes/templates/default/attributes_default_rb.erb +8 -0
- data/shared/snippet/chef_spec/templates/default/_rspec.erb +2 -0
- data/shared/snippet/chef_spec/templates/default/spec_chef_runner_context_rb.erb +36 -0
- data/shared/snippet/chef_spec/templates/default/spec_recipes_default_spec_rb.erb +7 -0
- data/shared/snippet/chef_spec/templates/default/spec_spec_helper_rb.erb +95 -0
- data/shared/snippet/cookbook_base/templates/default/Berksfile.erb +12 -0
- data/shared/snippet/cookbook_base/templates/default/CHANGELOG_md.erb +5 -0
- data/shared/snippet/cookbook_base/templates/default/Gemfile.erb +18 -0
- data/shared/snippet/cookbook_base/templates/default/README_md.erb +92 -0
- data/shared/snippet/cookbook_base/templates/default/Rakefile.erb +20 -0
- data/shared/snippet/cookbook_base/templates/default/metadata_rb.erb +13 -0
- data/shared/snippet/example_file/files/default/files_default_example_conf +34 -0
- data/shared/snippet/example_template/files/default/templates_default_example_conf_erb +22 -0
- data/shared/snippet/guard/templates/default/Guardfile.erb +16 -0
- data/shared/snippet/recipes/templates/default/recipes_default_rb.erb +9 -0
- data/shared/snippet/resource_provider/templates/default/providers_default_rb.erb +20 -0
- data/shared/snippet/resource_provider/templates/default/resources_default_rb.erb +9 -0
- data/shared/snippet/style_rubocop/templates/default/_rubocop_yml.erb +31 -0
- data/shared/snippet/test_kitchen/libraries/kitchen_helper.rb +13 -0
- data/shared/snippet/test_kitchen/templates/default/_kitchen_yml.erb +30 -0
- data/shared/snippet/test_kitchen/templates/default/test_integration_default_serverspec_recipes_default_spec_rb.erb +16 -0
- data/shared/snippet/test_kitchen/templates/default/test_integration_default_serverspec_spec_helper_rb.erb +7 -0
- metadata +372 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'chef_gen/snippet_base'
|
2
|
+
|
3
|
+
module ChefGen
|
4
|
+
module Snippet
|
5
|
+
# a cookbook that has attributes
|
6
|
+
class Attributes < ChefGen::SnippetBase
|
7
|
+
# the name of the snippet
|
8
|
+
NAME = 'attributes'
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# initializes the snippet in setup mode
|
13
|
+
# @return [void]
|
14
|
+
# @api private
|
15
|
+
def initialize_setup
|
16
|
+
super
|
17
|
+
snippet_content_path = File.expand_path(File.join(static_content_path(__FILE__))) + '/.'
|
18
|
+
@flavor.class.do_add_content do
|
19
|
+
tocopy << [snippet_content_path]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# initializes the snippet in generate mode
|
24
|
+
# @return [void]
|
25
|
+
# @api private
|
26
|
+
def initialize_generate
|
27
|
+
super
|
28
|
+
@flavor.class.do_declare_resources do
|
29
|
+
directories << 'attributes'
|
30
|
+
templates_if_missing << File.join('attributes', 'default.rb')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require 'chef_gen/snippet_base'
|
2
|
+
|
3
|
+
module ChefGen
|
4
|
+
module Snippet
|
5
|
+
# creates a framework for ChefSpec unit testing
|
6
|
+
class ChefSpec < ChefGen::SnippetBase
|
7
|
+
# the name of the snippet
|
8
|
+
NAME = 'chef_spec'
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# initializes the snippet in setup mode
|
13
|
+
# @return [void]
|
14
|
+
# @api private
|
15
|
+
def initialize_setup
|
16
|
+
super
|
17
|
+
snippet_content_path = File.expand_path(File.join(static_content_path(__FILE__))) + '/.'
|
18
|
+
@flavor.class.do_add_content do
|
19
|
+
tocopy << [snippet_content_path]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# initializes the snippet in generate mode
|
24
|
+
# @return [void]
|
25
|
+
# @api private
|
26
|
+
def initialize_generate
|
27
|
+
super
|
28
|
+
declare_files_templates
|
29
|
+
declare_chefignore_patterns
|
30
|
+
declare_cookbook_gems
|
31
|
+
declare_rake_tasks
|
32
|
+
declare_guard_sets
|
33
|
+
end
|
34
|
+
|
35
|
+
# declares directories, files and templates
|
36
|
+
# @return [void]
|
37
|
+
# @api private
|
38
|
+
def declare_files_templates
|
39
|
+
@flavor.class.do_declare_resources do
|
40
|
+
directories << 'spec'
|
41
|
+
directories << File.join('spec', 'recipes')
|
42
|
+
templates << '.rspec'
|
43
|
+
templates_if_missing << File.join('spec', 'spec_helper.rb')
|
44
|
+
templates_if_missing << File.join('spec', 'recipes', 'default_spec.rb')
|
45
|
+
templates_if_missing << File.join('spec', 'chef_runner_context.rb')
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# declares chefignore patterns if the flavor supports it
|
50
|
+
# @return [void]
|
51
|
+
# @api private
|
52
|
+
def declare_chefignore_patterns
|
53
|
+
@flavor.class.do_declare_resources do
|
54
|
+
if snippet?('standard_ignore')
|
55
|
+
%w(
|
56
|
+
.rspec spec/* spec/fixtures/*
|
57
|
+
).each do |e|
|
58
|
+
chefignore_patterns << e
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# declares cookbook_gems if the flavor supports it
|
65
|
+
# @return [void]
|
66
|
+
# @api private
|
67
|
+
def declare_cookbook_gems
|
68
|
+
@flavor.class.do_declare_resources do
|
69
|
+
if snippet?('cookbook_base')
|
70
|
+
cookbook_gems['chefspec'] = '~> 4.1'
|
71
|
+
cookbook_gems['guard-rspec'] = '~> 4.5'
|
72
|
+
cookbook_gems['ci_reporter_rspec'] = '~> 1.0'
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# declares rake tasks if the flavor supports it
|
78
|
+
# @return [void]
|
79
|
+
# @api private
|
80
|
+
def declare_rake_tasks
|
81
|
+
@flavor.class.do_declare_resources do
|
82
|
+
if snippet?('cookbook_base')
|
83
|
+
rake_tasks['chefspec'] = <<'END'
|
84
|
+
require 'rspec/core/rake_task'
|
85
|
+
RSpec::Core::RakeTask.new(:chefspec)
|
86
|
+
|
87
|
+
desc 'Generate ChefSpec coverage report'
|
88
|
+
task :coverage do
|
89
|
+
ENV['COVERAGE'] = 'true'
|
90
|
+
Rake::Task[:chefspec].invoke
|
91
|
+
end
|
92
|
+
task spec: :chefspec
|
93
|
+
END
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# declares guard sets if the flavor supports it
|
99
|
+
# @return [void]
|
100
|
+
# @api private
|
101
|
+
def declare_guard_sets
|
102
|
+
@flavor.class.do_declare_resources do
|
103
|
+
if snippet?('cookbook_base')
|
104
|
+
guard_sets['chefspec'] = <<'END'
|
105
|
+
rspec_command = ENV.key?('DISABLE_PRY_RESCUE') ? 'rspec' : 'rescue rspec'
|
106
|
+
guard :rspec, all_on_start: true, cmd: "bundle exec #{rspec_command}" do
|
107
|
+
watch(%r{^spec/recipes/.+_spec\.rb$})
|
108
|
+
watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
|
109
|
+
watch(%r{^attributes/.+\.rb$}) { 'spec' }
|
110
|
+
watch(%r{^resources/.+\.rb$}) { 'spec' }
|
111
|
+
watch(%r{^providers/.+\.rb$}) { 'spec' }
|
112
|
+
watch(%r{^libraries/.+\.rb$}) { 'spec' }
|
113
|
+
watch(%r{^recipes/(.+)\.rb$}) { |m| "spec/recipes/#{m[1]}_spec.rb" }
|
114
|
+
end
|
115
|
+
END
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
require 'chef_gen/snippet_base'
|
2
|
+
|
3
|
+
require 'chef/mixin/params_validate'
|
4
|
+
|
5
|
+
module ChefGen
|
6
|
+
module Snippet
|
7
|
+
# creates the basic files that every cookbook should have
|
8
|
+
# each file is managed through a separate method to allow for
|
9
|
+
# people to mix this in but turn off just one file
|
10
|
+
class CookbookBase < ChefGen::SnippetBase
|
11
|
+
# the name of the snippet
|
12
|
+
NAME = 'cookbook_base'
|
13
|
+
|
14
|
+
# @!attribute [rw] cookbook_gems
|
15
|
+
# @return [Hash<String,String>] a map of gem names to constraints
|
16
|
+
|
17
|
+
# @!attribute [rw] gem_sources
|
18
|
+
# @return [Array<String>] a list of gem sources
|
19
|
+
|
20
|
+
# @!attribute [rw] :berks_sources
|
21
|
+
# @return [Array<String>] a list of cookbook sources
|
22
|
+
|
23
|
+
# @!attribute [rw] :rake_tasks
|
24
|
+
# @return [Hash<String,String>] a map of task names to Rakefile bodies
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
# initializes the snippet in setup mode
|
29
|
+
# @return [void]
|
30
|
+
# @api private
|
31
|
+
def initialize_setup
|
32
|
+
super
|
33
|
+
snippet_content_path = File.expand_path(File.join(static_content_path(__FILE__))) + '/.'
|
34
|
+
@flavor.class.do_add_content do
|
35
|
+
tocopy << [snippet_content_path]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# initializes the snippet in generate mode
|
40
|
+
# @return [void]
|
41
|
+
# @api private
|
42
|
+
def initialize_generate
|
43
|
+
super
|
44
|
+
add_accessors
|
45
|
+
@flavor.class.do_declare_resources do
|
46
|
+
templates_if_missing << 'metadata.rb'
|
47
|
+
templates_if_missing << 'README.md'
|
48
|
+
templates_if_missing << 'CHANGELOG.md'
|
49
|
+
end
|
50
|
+
declare_gemfile
|
51
|
+
declare_berksfile
|
52
|
+
declare_rakefile
|
53
|
+
declare_chefignore_patterns
|
54
|
+
end
|
55
|
+
|
56
|
+
# defines accessors on the flavor for cookbook gems, gem sources,
|
57
|
+
# berks sources and rake tasks
|
58
|
+
# @return [void]
|
59
|
+
# @api private
|
60
|
+
def add_accessors
|
61
|
+
@flavor.class.send(:attr_accessor, :cookbook_gems)
|
62
|
+
@flavor.cookbook_gems = {
|
63
|
+
'rake' => '~> 10.4',
|
64
|
+
'berkshelf' => '~> 3.3'
|
65
|
+
}
|
66
|
+
|
67
|
+
@flavor.class.send(:attr_accessor, :gem_sources)
|
68
|
+
@flavor.gem_sources = %w(https://rubygems.org)
|
69
|
+
|
70
|
+
@flavor.class.send(:attr_accessor, :berks_sources)
|
71
|
+
@flavor.berks_sources = %w(https://supermarket.chef.io)
|
72
|
+
|
73
|
+
@flavor.class.send(:attr_accessor, :rake_tasks)
|
74
|
+
@flavor.rake_tasks = {}
|
75
|
+
end
|
76
|
+
|
77
|
+
# declares the Gemfile with lazy evaluation of the gem list
|
78
|
+
# @return [void]
|
79
|
+
# @api private
|
80
|
+
def declare_gemfile
|
81
|
+
@flavor.class.do_declare_resources do
|
82
|
+
# :nocov:
|
83
|
+
lazy_vars = Chef::DelayedEvaluator.new do
|
84
|
+
{ gems: cookbook_gems, sources: gem_sources }
|
85
|
+
end
|
86
|
+
# :nocov:
|
87
|
+
add_templates(%w(Gemfile), :create, variables: lazy_vars)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# declares the Berksfile with lazy evaluation of the sources
|
92
|
+
# @return [void]
|
93
|
+
# @api private
|
94
|
+
def declare_berksfile
|
95
|
+
@flavor.class.do_declare_resources do
|
96
|
+
# :nocov:
|
97
|
+
lazy_vars = Chef::DelayedEvaluator.new do
|
98
|
+
{ sources: berks_sources }
|
99
|
+
end
|
100
|
+
# :nocov:
|
101
|
+
add_templates(%w(Berksfile), :create, variables: lazy_vars)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# declares the Rakefile with lazy evaluation of the tasks
|
106
|
+
# @return [void]
|
107
|
+
# @api private
|
108
|
+
def declare_rakefile
|
109
|
+
@flavor.class.do_declare_resources do
|
110
|
+
# :nocov:
|
111
|
+
lazy_vars = Chef::DelayedEvaluator.new do
|
112
|
+
{ tasks: rake_tasks }
|
113
|
+
end
|
114
|
+
# :nocov:
|
115
|
+
add_templates(%w(Rakefile), :create, variables: lazy_vars)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
# adds patterns to chefignore patterns
|
120
|
+
# @return [void]
|
121
|
+
# @api private
|
122
|
+
def declare_chefignore_patterns
|
123
|
+
@flavor.class.do_declare_resources do
|
124
|
+
if snippet?('standard_ignore')
|
125
|
+
%w(
|
126
|
+
Gemfile Gemfile.lock Rakefile Berksfile Berksfile.lock
|
127
|
+
).each do |e|
|
128
|
+
chefignore_patterns << e
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'chef_gen/snippet_base'
|
2
|
+
|
3
|
+
module ChefGen
|
4
|
+
module Snippet
|
5
|
+
# adds gems useful for debugging cookbooks to the Gemfile
|
6
|
+
class Debugging < ChefGen::SnippetBase
|
7
|
+
# the name of the snippet
|
8
|
+
NAME = 'debugging'
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# initializes the snippet in generate mode
|
13
|
+
# @return [void]
|
14
|
+
# @api private
|
15
|
+
def initialize_generate
|
16
|
+
super
|
17
|
+
@flavor.class.do_declare_resources do
|
18
|
+
cookbook_gems['pry'] = '~> 0.10'
|
19
|
+
cookbook_gems['pry-byebug'] = '~> 3.1'
|
20
|
+
cookbook_gems['pry-rescue'] = '~> 1.4'
|
21
|
+
cookbook_gems['pry-stack_explorer'] = '~> 0.4'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'chef_gen/snippet_base'
|
2
|
+
|
3
|
+
module ChefGen
|
4
|
+
module Snippet
|
5
|
+
# a sample cookbook_file source
|
6
|
+
class ExampleFile < ChefGen::SnippetBase
|
7
|
+
# the name of the snippet
|
8
|
+
NAME = 'example_file'
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# initializes the snippet in setup mode
|
13
|
+
# @return [void]
|
14
|
+
# @api private
|
15
|
+
def initialize_setup
|
16
|
+
super
|
17
|
+
snippet_content_path = File.expand_path(File.join(static_content_path(__FILE__))) + '/.'
|
18
|
+
@flavor.class.do_add_content do
|
19
|
+
tocopy << [snippet_content_path]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# initializes the snippet in generate mode
|
24
|
+
# @return [void]
|
25
|
+
# @api private
|
26
|
+
def initialize_generate
|
27
|
+
super
|
28
|
+
@flavor.class.do_declare_resources do
|
29
|
+
directories << 'files'
|
30
|
+
directories << File.join('files', 'default')
|
31
|
+
files_if_missing << File.join('files', 'default', 'example.conf')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'chef_gen/snippet_base'
|
2
|
+
|
3
|
+
module ChefGen
|
4
|
+
module Snippet
|
5
|
+
# a sample template source
|
6
|
+
class ExampleTemplate < ChefGen::SnippetBase
|
7
|
+
# the name of the snippet
|
8
|
+
NAME = 'example_template'
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# initializes the snippet in setup mode
|
13
|
+
# @return [void]
|
14
|
+
# @api private
|
15
|
+
def initialize_setup
|
16
|
+
super
|
17
|
+
snippet_content_path = File.expand_path(File.join(static_content_path(__FILE__))) + '/.'
|
18
|
+
@flavor.class.do_add_content do
|
19
|
+
tocopy << [snippet_content_path]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# initializes the snippet in generate mode
|
24
|
+
# @return [void]
|
25
|
+
# @api private
|
26
|
+
def initialize_generate
|
27
|
+
super
|
28
|
+
@flavor.class.do_declare_resources do
|
29
|
+
directories << 'templates'
|
30
|
+
directories << File.join('templates', 'default')
|
31
|
+
files_if_missing << File.join('templates', 'default', 'example.conf.erb')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'chef_gen/snippet_base'
|
2
|
+
require 'chef_gen/flavor_base/resource_helpers'
|
3
|
+
|
4
|
+
module ChefGen
|
5
|
+
module Snippet
|
6
|
+
# initializes a git repo
|
7
|
+
class GitInit < ChefGen::SnippetBase
|
8
|
+
include ChefGen::FlavorBase::ResourceHelpers
|
9
|
+
|
10
|
+
# the name of the snippet
|
11
|
+
NAME = 'git_init'
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
# initializes the snippet in generate mode
|
16
|
+
# @return [void]
|
17
|
+
# @api private
|
18
|
+
def initialize_generate
|
19
|
+
super
|
20
|
+
@flavor.class.do_declare_resources do
|
21
|
+
c = ChefDK::Generator.context
|
22
|
+
if c.have_git && !c.skip_git_init
|
23
|
+
dst = destination_path
|
24
|
+
# :nocov:
|
25
|
+
@recipe.send(:execute, 'initialize git repo') do
|
26
|
+
command('git init .')
|
27
|
+
cwd dst
|
28
|
+
end
|
29
|
+
# :nocov:
|
30
|
+
actions_taken << 'initialize git repo' if snippet?('actions_taken')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'chef_gen/snippet_base'
|
2
|
+
|
3
|
+
require 'chef/mixin/params_validate'
|
4
|
+
|
5
|
+
module ChefGen
|
6
|
+
module Snippet
|
7
|
+
# creates a guardfile and an accessor to define guard sets
|
8
|
+
class Guard < ChefGen::SnippetBase
|
9
|
+
# the name of the snippet
|
10
|
+
NAME = 'guard'
|
11
|
+
|
12
|
+
# @!attribute [rw] :guard_sets
|
13
|
+
# @return [Hash<String,String>] a map of set names to Guardfile bodies
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
# initializes the snippet in setup mode
|
18
|
+
# @return [void]
|
19
|
+
# @api private
|
20
|
+
def initialize_setup
|
21
|
+
super
|
22
|
+
snippet_content_path = File.expand_path(File.join(static_content_path(__FILE__))) + '/.'
|
23
|
+
@flavor.class.do_add_content do
|
24
|
+
tocopy << [snippet_content_path]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# initializes the snippet in generate mode
|
29
|
+
# @return [void]
|
30
|
+
# @api private
|
31
|
+
def initialize_generate
|
32
|
+
super
|
33
|
+
add_accessors
|
34
|
+
declare_guardfile
|
35
|
+
declare_chefignore_patterns
|
36
|
+
end
|
37
|
+
|
38
|
+
# adds accessors to the flavor for guard sets
|
39
|
+
# @return [void]
|
40
|
+
# @api private
|
41
|
+
def add_accessors
|
42
|
+
@flavor.class.send(:attr_accessor, :guard_sets)
|
43
|
+
@flavor.guard_sets = {}
|
44
|
+
end
|
45
|
+
|
46
|
+
# declares the Guardfile with lazy evaluation of the guards
|
47
|
+
# @return [void]
|
48
|
+
# @api private
|
49
|
+
def declare_guardfile
|
50
|
+
@flavor.class.do_declare_resources do
|
51
|
+
# :nocov:
|
52
|
+
lazy_vars = Chef::DelayedEvaluator.new do
|
53
|
+
{ guards: guard_sets }
|
54
|
+
end
|
55
|
+
# :nocov:
|
56
|
+
add_templates(%w(Guardfile), :create, variables: lazy_vars)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# adds patterns to chefignore patterns
|
61
|
+
# @return [void]
|
62
|
+
# @api private
|
63
|
+
def declare_chefignore_patterns
|
64
|
+
@flavor.class.do_declare_resources do
|
65
|
+
chefignore_patterns << 'Guardfile' if snippet?('standard_ignore')
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|