chef-gen-flavor-example 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +8 -0
- data/LICENSE +2 -0
- data/Manifest.txt +4 -4
- data/README.md +20 -11
- data/chef-gen-flavor-example.gemspec +13 -13
- data/lib/chef_gen/flavor/example.rb +27 -22
- data/lib/chef_gen/flavor/example2.rb +11 -30
- data/shared/flavor/example/metadata.rb +2 -0
- data/{code_generator → shared/flavor/example}/recipes/cookbook.rb +9 -3
- data/shared/flavor/example2/metadata.rb +2 -0
- data/shared/flavor/example2/recipes/cookbook.rb +3 -0
- metadata +23 -17
- data/code_generator/metadata.rb +0 -2
- data/code_generator_2/metadata.rb +0 -2
- data/code_generator_2/recipes/cookbook.rb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a20b3d8328c9bd9edd3e83d34ee9c8c8e6ded651
|
4
|
+
data.tar.gz: ab15529d579b8be432cf504034cf98955c647ebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 755ea8b3b2ef8e21b3ce4cd25149a45db44ddd58deb33f5ff2a8f7f2d2cf650092f40c820bc52504165826442b1c8d37c4b2693a857f4d77ddf586e461f11792
|
7
|
+
data.tar.gz: 1d0e474dce1159cdcfe06a8b41be29c880f4d958a88aad0e59d9cd3221dbc90d6a47cc042e1e09cf1f800b7fb3c69c5539b98e5f14ebe2072c0bec9cd70dd326
|
data/History.md
CHANGED
data/LICENSE
CHANGED
data/Manifest.txt
CHANGED
@@ -3,9 +3,9 @@ LICENSE
|
|
3
3
|
Manifest.txt
|
4
4
|
README.md
|
5
5
|
chef-gen-flavor-example.gemspec
|
6
|
-
code_generator/metadata.rb
|
7
|
-
code_generator/recipes/cookbook.rb
|
8
|
-
code_generator_2/metadata.rb
|
9
|
-
code_generator_2/recipes/cookbook.rb
|
10
6
|
lib/chef_gen/flavor/example.rb
|
11
7
|
lib/chef_gen/flavor/example2.rb
|
8
|
+
shared/flavor/example/metadata.rb
|
9
|
+
shared/flavor/example/recipes/cookbook.rb
|
10
|
+
shared/flavor/example2/metadata.rb
|
11
|
+
shared/flavor/example2/recipes/cookbook.rb
|
data/README.md
CHANGED
@@ -1,20 +1,26 @@
|
|
1
1
|
# chef-gen-flavor-example
|
2
2
|
|
3
|
-
* home :: https://github.com/
|
3
|
+
* home :: https://github.com/jf647/chef-gen-flavor-example
|
4
4
|
* license :: [Apache2](http://www.apache.org/licenses/LICENSE-2.0)
|
5
5
|
* gem version :: [![Gem Version](https://badge.fury.io/rb/chef-gen-flavor-example.png)](http://badge.fury.io/rb/chef-gen-flavor-example)
|
6
|
-
* build status :: [![Circle CI](https://circleci.com/gh/
|
7
|
-
* code climate :: [![Code Climate](https://codeclimate.com/github/
|
8
|
-
* docs :: [![Inline docs](http://inch-ci.org/github/
|
6
|
+
* build status :: [![Circle CI](https://circleci.com/gh/jf647/chef-gen-flavor-example.svg?style=svg)](https://circleci.com/gh/jf647/chef-gen-flavor-example)
|
7
|
+
* code climate :: [![Code Climate](https://codeclimate.com/github/jf647/chef-gen-flavor-example/badges/gpa.svg)](https://codeclimate.com/github/jf647/chef-gen-flavor-example)
|
8
|
+
* docs :: [![Inline docs](http://inch-ci.org/github/jf647/chef-gen-flavor-example.svg?branch=master)](http://inch-ci.org/github/jf647/chef-gen-flavor-example)
|
9
9
|
|
10
10
|
## DESCRIPTION
|
11
11
|
|
12
12
|
An example plugin for [chef-gen-flavors](https://rubygems.org/gems/chef-gen-flavors).
|
13
13
|
|
14
|
-
This plugin makes use of
|
15
|
-
|
16
|
-
|
17
|
-
started writing your own flavors for
|
14
|
+
This plugin makes use of all the snippets provided by
|
15
|
+
chef-gen-flavor-base, is meant as a reference implementation than for
|
16
|
+
actual use. It demonstrates how to create a flavor with tests and serves
|
17
|
+
as a good example of how to get started writing your own flavors for
|
18
|
+
distribution.
|
19
|
+
|
20
|
+
There are two flavors in this gem:
|
21
|
+
|
22
|
+
* example: includes all the snippets in their default form
|
23
|
+
* example2: inherits from example but removes ExampleFile and ExampleTemplate from the list of snippets to use
|
18
24
|
|
19
25
|
# INSTALLATION
|
20
26
|
|
@@ -25,7 +31,8 @@ To install the latest public gem version:
|
|
25
31
|
To install from (possibly modified) source:
|
26
32
|
|
27
33
|
bundle
|
28
|
-
bundle exec rake
|
34
|
+
bundle exec rake package
|
35
|
+
chef gem install pkg/chef-gen-flavor-example-X.Y.Z.gem
|
29
36
|
|
30
37
|
## USAGE
|
31
38
|
|
@@ -35,7 +42,7 @@ This should generate the following cookbook:
|
|
35
42
|
|
36
43
|
```
|
37
44
|
$ chef generate cookbook foo
|
38
|
-
using ChefGen flavor
|
45
|
+
using ChefGen flavor 'example'
|
39
46
|
Compiling Cookbooks...
|
40
47
|
Recipe: code_generator::cookbook
|
41
48
|
* directory[/home/james/foo/] action create
|
@@ -155,12 +162,14 @@ unit tests run cleanly, and that the kitchen suites can be listed.
|
|
155
162
|
|
156
163
|
## AUTHOR
|
157
164
|
|
158
|
-
James FitzGibbon
|
165
|
+
[James FitzGibbon](https://github.com/jf647)
|
159
166
|
|
160
167
|
## LICENSE
|
161
168
|
|
162
169
|
Copyright 2015 Nordstrom, Inc.
|
163
170
|
|
171
|
+
Copyright 2015 James FitzGibbon
|
172
|
+
|
164
173
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
165
174
|
use this file except in compliance with the License. You may obtain a copy
|
166
175
|
of the License at
|
@@ -1,19 +1,19 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: chef-gen-flavor-example 0.
|
2
|
+
# stub: chef-gen-flavor-example 0.6.0.20150909153225 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "chef-gen-flavor-example"
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.6.0.20150909153225"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["James FitzGibbon"]
|
11
|
-
s.date = "2015-
|
12
|
-
s.description = "An example plugin for [chef-gen-flavors](https://rubygems.org/gems/chef-gen-flavors).\n\nThis plugin makes use of
|
13
|
-
s.email = ["james.i.fitzgibbon@
|
11
|
+
s.date = "2015-09-09"
|
12
|
+
s.description = "An example plugin for [chef-gen-flavors](https://rubygems.org/gems/chef-gen-flavors).\n\nThis plugin makes use of all the snippets provided by\nchef-gen-flavor-base, is meant as a reference implementation than for\nactual use. It demonstrates how to create a flavor with tests and serves\nas a good example of how to get started writing your own flavors for\ndistribution.\n\nThere are two flavors in this gem:\n\n* example: includes all the snippets in their default form\n* example2: inherits from example but removes ExampleFile and ExampleTemplate from the list of snippets to use"
|
13
|
+
s.email = ["james.i.fitzgibbon@jf647.com"]
|
14
14
|
s.extra_rdoc_files = ["History.md", "Manifest.txt", "README.md"]
|
15
|
-
s.files = ["History.md", "LICENSE", "Manifest.txt", "README.md", "chef-gen-flavor-example.gemspec", "
|
16
|
-
s.homepage = "https://github.com/
|
15
|
+
s.files = ["History.md", "LICENSE", "Manifest.txt", "README.md", "chef-gen-flavor-example.gemspec", "lib/chef_gen/flavor/example.rb", "lib/chef_gen/flavor/example2.rb", "shared/flavor/example/metadata.rb", "shared/flavor/example/recipes/cookbook.rb", "shared/flavor/example2/metadata.rb", "shared/flavor/example2/recipes/cookbook.rb"]
|
16
|
+
s.homepage = "https://github.com/jf647/chef-gen-flavor-example"
|
17
17
|
s.licenses = ["apache2"]
|
18
18
|
s.rdoc_options = ["--main", "README.md"]
|
19
19
|
s.rubygems_version = "2.4.4"
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.specification_version = 4
|
24
24
|
|
25
25
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
-
s.add_runtime_dependency(%q<chef-gen-
|
26
|
+
s.add_runtime_dependency(%q<chef-gen-flavor-base>, ["~> 0.9"])
|
27
27
|
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
|
28
28
|
s.add_development_dependency(%q<chef-dk>, ["~> 0.5"])
|
29
29
|
s.add_development_dependency(%q<hoe>, ["~> 3.13"])
|
@@ -37,10 +37,10 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_development_dependency(%q<simplecov>, ["~> 0.9"])
|
38
38
|
s.add_development_dependency(%q<simplecov-console>, ["~> 0.2"])
|
39
39
|
s.add_development_dependency(%q<yard>, ["~> 0.8"])
|
40
|
-
s.add_development_dependency(%q<aruba>, ["~> 0.6"])
|
40
|
+
s.add_development_dependency(%q<aruba>, ["~> 0.6.2"])
|
41
41
|
s.add_development_dependency(%q<rspec_junit_formatter>, ["~> 0.2"])
|
42
42
|
else
|
43
|
-
s.add_dependency(%q<chef-gen-
|
43
|
+
s.add_dependency(%q<chef-gen-flavor-base>, ["~> 0.9"])
|
44
44
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
45
45
|
s.add_dependency(%q<chef-dk>, ["~> 0.5"])
|
46
46
|
s.add_dependency(%q<hoe>, ["~> 3.13"])
|
@@ -54,11 +54,11 @@ Gem::Specification.new do |s|
|
|
54
54
|
s.add_dependency(%q<simplecov>, ["~> 0.9"])
|
55
55
|
s.add_dependency(%q<simplecov-console>, ["~> 0.2"])
|
56
56
|
s.add_dependency(%q<yard>, ["~> 0.8"])
|
57
|
-
s.add_dependency(%q<aruba>, ["~> 0.6"])
|
57
|
+
s.add_dependency(%q<aruba>, ["~> 0.6.2"])
|
58
58
|
s.add_dependency(%q<rspec_junit_formatter>, ["~> 0.2"])
|
59
59
|
end
|
60
60
|
else
|
61
|
-
s.add_dependency(%q<chef-gen-
|
61
|
+
s.add_dependency(%q<chef-gen-flavor-base>, ["~> 0.9"])
|
62
62
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
63
63
|
s.add_dependency(%q<chef-dk>, ["~> 0.5"])
|
64
64
|
s.add_dependency(%q<hoe>, ["~> 3.13"])
|
@@ -72,7 +72,7 @@ Gem::Specification.new do |s|
|
|
72
72
|
s.add_dependency(%q<simplecov>, ["~> 0.9"])
|
73
73
|
s.add_dependency(%q<simplecov-console>, ["~> 0.2"])
|
74
74
|
s.add_dependency(%q<yard>, ["~> 0.8"])
|
75
|
-
s.add_dependency(%q<aruba>, ["~> 0.6"])
|
75
|
+
s.add_dependency(%q<aruba>, ["~> 0.6.2"])
|
76
76
|
s.add_dependency(%q<rspec_junit_formatter>, ["~> 0.2"])
|
77
77
|
end
|
78
78
|
end
|
@@ -6,30 +6,35 @@ module ChefGen
|
|
6
6
|
# a pluggable framework for distributing templates as ruby gems
|
7
7
|
module Flavor
|
8
8
|
# an example plugin for chef-gen-template
|
9
|
-
class Example < FlavorBase
|
10
|
-
|
11
|
-
include
|
12
|
-
|
13
|
-
include ChefGen::Snippet::ChefSpec
|
14
|
-
include ChefGen::Snippet::TestKitchen
|
15
|
-
include ChefGen::Snippet::StandardIgnore
|
16
|
-
include ChefGen::Snippet::StyleRubocop
|
17
|
-
include ChefGen::Snippet::StyleTailor
|
18
|
-
include ChefGen::Snippet::StyleFoodcritic
|
19
|
-
include ChefGen::Snippet::GitInit
|
20
|
-
include ChefGen::Snippet::ExampleFile
|
21
|
-
include ChefGen::Snippet::ExampleTemplate
|
22
|
-
include ChefGen::Snippet::ResourceProvider
|
9
|
+
class Example < ChefGen::FlavorBase
|
10
|
+
NAME = 'example'
|
11
|
+
DESC = 'include ALL the snippets'
|
12
|
+
VERSION = '0.6.0'
|
23
13
|
|
24
|
-
|
25
|
-
|
14
|
+
def initialize(temp_path: nil, type: nil, recipe: nil)
|
15
|
+
super
|
16
|
+
@snippets << ChefGen::Snippet::CookbookBase
|
17
|
+
@snippets << ChefGen::Snippet::ActionsTaken
|
18
|
+
@snippets << ChefGen::Snippet::Attributes
|
19
|
+
@snippets << ChefGen::Snippet::ChefSpec
|
20
|
+
@snippets << ChefGen::Snippet::Debugging
|
21
|
+
@snippets << ChefGen::Snippet::ExampleFile
|
22
|
+
@snippets << ChefGen::Snippet::ExampleTemplate
|
23
|
+
@snippets << ChefGen::Snippet::Guard
|
24
|
+
@snippets << ChefGen::Snippet::GitInit
|
25
|
+
@snippets << ChefGen::Snippet::NextSteps
|
26
|
+
@snippets << ChefGen::Snippet::NoClobber
|
27
|
+
@snippets << ChefGen::Snippet::Recipes
|
28
|
+
@snippets << ChefGen::Snippet::ResourceProvider
|
29
|
+
@snippets << ChefGen::Snippet::StandardIgnore
|
30
|
+
@snippets << ChefGen::Snippet::StyleFoodcritic
|
31
|
+
@snippets << ChefGen::Snippet::StyleRubocop
|
32
|
+
@snippets << ChefGen::Snippet::StyleTailor
|
33
|
+
@snippets << ChefGen::Snippet::TestKitchen
|
34
|
+
end
|
26
35
|
|
27
|
-
|
28
|
-
|
29
|
-
def description
|
30
|
-
'Example cookbook template'
|
31
|
-
end
|
32
|
-
# :nocov:
|
36
|
+
do_add_content do
|
37
|
+
@tocopy << [File.expand_path(File.join(static_content_path(__FILE__))) + '/.']
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
@@ -5,40 +5,21 @@ module ChefGen
|
|
5
5
|
# a pluggable framework for distributing templates as ruby gems
|
6
6
|
module Flavor
|
7
7
|
# a flavor that inherits from ChefGen::Flavor::Example
|
8
|
-
class Example2 < Example
|
9
|
-
|
10
|
-
|
8
|
+
class Example2 < ChefGen::Flavor::Example
|
9
|
+
NAME = 'example2'
|
10
|
+
DESC = 'remove example files'
|
11
|
+
VERSION = '0.6.0'
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
# :nocov:
|
18
|
-
|
19
|
-
def code_generator_path(classfile)
|
20
|
-
File.expand_path(
|
21
|
-
File.join(
|
22
|
-
classfile,
|
23
|
-
'..', '..', '..', '..',
|
24
|
-
'code_generator_2'
|
25
|
-
)
|
26
|
-
)
|
13
|
+
def initialize(temp_path: nil, type: nil, recipe: nil)
|
14
|
+
super
|
15
|
+
# remove ExampleFile and ExampleTemplate snippets
|
16
|
+
@snippets.reject! do |e|
|
17
|
+
e == ChefGen::Snippet::ExampleFile || e == ChefGen::Snippet::ExampleTemplate
|
27
18
|
end
|
28
19
|
end
|
29
20
|
|
30
|
-
|
31
|
-
|
32
|
-
toremove = [
|
33
|
-
'files',
|
34
|
-
File.join('files', 'default'),
|
35
|
-
File.join('files', 'default', 'example.conf'),
|
36
|
-
'templates',
|
37
|
-
File.join('templates', 'default'),
|
38
|
-
File.join('templates', 'default', 'example.conf.erb')
|
39
|
-
]
|
40
|
-
@directories.reject! { |e| toremove.include? e }
|
41
|
-
@files_if_missing.reject! { |e| toremove.include? e }
|
21
|
+
do_add_content do
|
22
|
+
@tocopy << [File.expand_path(File.join(static_content_path(__FILE__))) + '/.']
|
42
23
|
end
|
43
24
|
end
|
44
25
|
end
|
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
f = ChefGen::Flavor::Example.new(
|
2
|
+
type: 'cookbook', recipe: self
|
3
|
+
)
|
3
4
|
|
5
|
+
f.class.after_declare_resources do
|
6
|
+
self.next_steps = <<END
|
4
7
|
|
5
8
|
Now cd into the generated cookbook directory and run
|
6
9
|
'bundle' to install Ruby gems needed for local testing and
|
7
10
|
'bundle exec rake -T' to see which testing tasks you can run.
|
8
11
|
|
9
12
|
You are now ready to begin writing your first recipe.
|
13
|
+
|
10
14
|
END
|
11
|
-
|
15
|
+
end
|
16
|
+
|
17
|
+
f.declare_resources
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-gen-flavor-example
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James FitzGibbon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: chef-gen-
|
14
|
+
name: chef-gen-flavor-base
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.9'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +212,14 @@ dependencies:
|
|
212
212
|
requirements:
|
213
213
|
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: 0.6.2
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
222
|
+
version: 0.6.2
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: rspec_junit_formatter
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,12 +237,18 @@ dependencies:
|
|
237
237
|
description: |-
|
238
238
|
An example plugin for [chef-gen-flavors](https://rubygems.org/gems/chef-gen-flavors).
|
239
239
|
|
240
|
-
This plugin makes use of
|
241
|
-
|
242
|
-
|
243
|
-
started writing your own flavors for
|
240
|
+
This plugin makes use of all the snippets provided by
|
241
|
+
chef-gen-flavor-base, is meant as a reference implementation than for
|
242
|
+
actual use. It demonstrates how to create a flavor with tests and serves
|
243
|
+
as a good example of how to get started writing your own flavors for
|
244
|
+
distribution.
|
245
|
+
|
246
|
+
There are two flavors in this gem:
|
247
|
+
|
248
|
+
* example: includes all the snippets in their default form
|
249
|
+
* example2: inherits from example but removes ExampleFile and ExampleTemplate from the list of snippets to use
|
244
250
|
email:
|
245
|
-
- james.i.fitzgibbon@
|
251
|
+
- james.i.fitzgibbon@jf647.com
|
246
252
|
executables: []
|
247
253
|
extensions: []
|
248
254
|
extra_rdoc_files:
|
@@ -255,13 +261,13 @@ files:
|
|
255
261
|
- Manifest.txt
|
256
262
|
- README.md
|
257
263
|
- chef-gen-flavor-example.gemspec
|
258
|
-
- code_generator/metadata.rb
|
259
|
-
- code_generator/recipes/cookbook.rb
|
260
|
-
- code_generator_2/metadata.rb
|
261
|
-
- code_generator_2/recipes/cookbook.rb
|
262
264
|
- lib/chef_gen/flavor/example.rb
|
263
265
|
- lib/chef_gen/flavor/example2.rb
|
264
|
-
|
266
|
+
- shared/flavor/example/metadata.rb
|
267
|
+
- shared/flavor/example/recipes/cookbook.rb
|
268
|
+
- shared/flavor/example2/metadata.rb
|
269
|
+
- shared/flavor/example2/recipes/cookbook.rb
|
270
|
+
homepage: https://github.com/jf647/chef-gen-flavor-example
|
265
271
|
licenses:
|
266
272
|
- apache2
|
267
273
|
metadata: {}
|
data/code_generator/metadata.rb
DELETED