chef-flavor-pan 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/.rubocop.yml +563 -0
  4. data/CHANGELOG.md +23 -0
  5. data/LICENSE +15 -0
  6. data/README.md +133 -0
  7. data/base/code_generator/files/default/Berksfile +3 -0
  8. data/base/code_generator/files/default/Gemfile +5 -0
  9. data/base/code_generator/files/default/LICENSE +3 -0
  10. data/base/code_generator/files/default/Thorfile +12 -0
  11. data/base/code_generator/files/default/_chef_client.rb +14 -0
  12. data/base/code_generator/files/default/_defaults_linux.rb +16 -0
  13. data/base/code_generator/files/default/_defaults_windows.rb +41 -0
  14. data/base/code_generator/files/default/chefignore +95 -0
  15. data/base/code_generator/files/default/gitignore +16 -0
  16. data/base/code_generator/recipes/cookbook.rb +86 -0
  17. data/base/code_generator/templates/default/.kitchen.yml.erb +19 -0
  18. data/base/code_generator/templates/default/CHANGELOG.md.erb +13 -0
  19. data/base/code_generator/templates/default/LICENSE.all_rights.erb +3 -0
  20. data/base/code_generator/templates/default/LICENSE.apache2.erb +201 -0
  21. data/base/code_generator/templates/default/README.md.erb +29 -0
  22. data/base/code_generator/templates/default/default_attributes.rb.erb +1 -0
  23. data/base/code_generator/templates/default/default_recipe.rb.erb +3 -0
  24. data/base/code_generator/templates/default/metadata.rb.erb +10 -0
  25. data/lib/chef_gen/flavor/base.rb +22 -0
  26. data/lib/chef_gen/flavor/new.rb +22 -0
  27. data/lib/chef_gen/flavor/review.rb +22 -0
  28. data/new/code_generator/files/default/Berksfile +3 -0
  29. data/new/code_generator/files/default/Gemfile +5 -0
  30. data/new/code_generator/files/default/LICENSE +3 -0
  31. data/new/code_generator/files/default/Thorfile +12 -0
  32. data/new/code_generator/files/default/chefignore +95 -0
  33. data/new/code_generator/files/default/gitignore +16 -0
  34. data/new/code_generator/recipes/cookbook.rb +74 -0
  35. data/new/code_generator/templates/default/.kitchen.yml.erb +19 -0
  36. data/new/code_generator/templates/default/CHANGELOG.md.erb +13 -0
  37. data/new/code_generator/templates/default/LICENSE.all_rights.erb +3 -0
  38. data/new/code_generator/templates/default/LICENSE.apache2.erb +201 -0
  39. data/new/code_generator/templates/default/README.md.erb +29 -0
  40. data/new/code_generator/templates/default/default_attributes.rb.erb +1 -0
  41. data/new/code_generator/templates/default/default_recipe.rb.erb +0 -0
  42. data/new/code_generator/templates/default/metadata.rb.erb +6 -0
  43. data/pan.gemspec +19 -0
  44. data/review/code_generator/files/default/Berksfile +3 -0
  45. data/review/code_generator/files/default/Gemfile +5 -0
  46. data/review/code_generator/files/default/LICENSE +3 -0
  47. data/review/code_generator/files/default/Thorfile +12 -0
  48. data/review/code_generator/files/default/chefignore +95 -0
  49. data/review/code_generator/files/default/gitignore +16 -0
  50. data/review/code_generator/recipes/cookbook.rb +29 -0
  51. metadata +100 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c67ec864e91c5e64f2a2d03bbd8cdf71b42f5b9a
4
+ data.tar.gz: 8d0cb88b7444e9cc21f5630fc9ff354c508da678
5
+ SHA512:
6
+ metadata.gz: aa0d1230b87d78924f093855707e21f726c195eb1c5aa73f6d14f39af990adb60d6da9aece75510ccd10cb7d4926c317c52c3557556e90a345293447179e1b9a
7
+ data.tar.gz: b6f5064dafec8e352cb61121fc686d8700c226b2fbe088fcd4a62f0e4ec73922df6ed1871f4f4db234014a4c08ac90e6312fc040221afc47076e332fa9d8e1df
@@ -0,0 +1,7 @@
1
+ *~
2
+ *#
3
+ .#*
4
+ \#*#
5
+ .*.sw[a-z]
6
+ *.un~
7
+ .DS_Store
@@ -0,0 +1,563 @@
1
+ # This is the default configuration file. Enabling and disabling is configured
2
+ # in separate files. This file adds all other parameters apart from Enabled.
3
+
4
+ #inherit_from:
5
+ # - enabled.yml
6
+ # - disabled.yml
7
+
8
+ # Common configuration.
9
+ AllCops:
10
+ # Include gemspec and Rakefile
11
+ Include:
12
+ - '**/*.gemspec'
13
+ - '**/*.podspec'
14
+ - '**/*.jbuilder'
15
+ - '**/*.rake'
16
+ - '**/Gemfile'
17
+ - '**/Rakefile'
18
+ - '**/Capfile'
19
+ - '**/Guardfile'
20
+ - '**/Podfile'
21
+ - '**/Thorfile'
22
+ - '**/Vagrantfile'
23
+ Exclude:
24
+ - 'vendor/**/*'
25
+ # By default, the rails cops are not run. Override in project or home
26
+ # directory .rubocop.yml files, or by giving the -R/--rails option.
27
+ RunRailsCops: false
28
+
29
+ # Indent private/protected/public as deep as method definitions
30
+ Style/AccessModifierIndentation:
31
+ EnforcedStyle: indent
32
+ SupportedStyles:
33
+ - outdent
34
+ - indent
35
+
36
+ # Align the elements of a hash literal if they span more than one line.
37
+ Style/AlignHash:
38
+ # Alignment of entries using hash rocket as separator. Valid values are:
39
+ #
40
+ # key - left alignment of keys
41
+ # 'a' => 2
42
+ # 'bb' => 3
43
+ # separator - alignment of hash rockets, keys are right aligned
44
+ # 'a' => 2
45
+ # 'bb' => 3
46
+ # table - left alignment of keys, hash rockets, and values
47
+ # 'a' => 2
48
+ # 'bb' => 3
49
+ EnforcedHashRocketStyle: key
50
+ # Alignment of entries using colon as separator. Valid values are:
51
+ #
52
+ # key - left alignment of keys
53
+ # a: 0
54
+ # bb: 1
55
+ # separator - alignment of colons, keys are right aligned
56
+ # a: 0
57
+ # bb: 1
58
+ # table - left alignment of keys and values
59
+ # a: 0
60
+ # bb: 1
61
+ EnforcedColonStyle: key
62
+ # Select whether hashes that are the last argument in a method call should be
63
+ # inspected? Valid values are:
64
+ #
65
+ # always_inspect - Inspect both implicit and explicit hashes.
66
+ # Registers an offense for:
67
+ # function(a: 1,
68
+ # b: 2)
69
+ # Registers an offense for:
70
+ # function({a: 1,
71
+ # b: 2})
72
+ # always_ignore - Ignore both implicit and explicit hashes.
73
+ # Accepts:
74
+ # function(a: 1,
75
+ # b: 2)
76
+ # Accepts:
77
+ # function({a: 1,
78
+ # b: 2})
79
+ # ignore_implicit - Ignore only implicit hashes.
80
+ # Accepts:
81
+ # function(a: 1,
82
+ # b: 2)
83
+ # Registers an offense for:
84
+ # function({a: 1,
85
+ # b: 2})
86
+ # ignore_explicit - Ignore only explicit hashes.
87
+ # Accepts:
88
+ # function({a: 1,
89
+ # b: 2})
90
+ # Registers an offense for:
91
+ # function(a: 1,
92
+ # b: 2)
93
+ EnforcedLastArgumentHashStyle: always_inspect
94
+ SupportedLastArgumentHashStyles:
95
+ - always_inspect
96
+ - always_ignore
97
+ - ignore_implicit
98
+ - ignore_explicit
99
+
100
+ Style/AlignParameters:
101
+ # Alignment of parameters in multi-line method calls.
102
+ #
103
+ # The `with_first_parameter` style aligns the following lines along the same
104
+ # column as the first parameter.
105
+ #
106
+ # method_call(a,
107
+ # b)
108
+ #
109
+ # The `with_fixed_indentation` style aligns the following lines with one
110
+ # level of indentation relative to the start of the line with the method call.
111
+ #
112
+ # method_call(a,
113
+ # b)
114
+ EnforcedStyle: with_first_parameter
115
+ SupportedStyles:
116
+ - with_first_parameter
117
+ - with_fixed_indentation
118
+
119
+ Style/AndOr:
120
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
121
+ # or completely (always).
122
+ EnforcedStyle: always
123
+ SupportedStyles:
124
+ - always
125
+ - conditionals
126
+
127
+
128
+ # Checks if usage of %() or %Q() matches configuration.
129
+ Style/BarePercentLiterals:
130
+ EnforcedStyle: bare_percent
131
+ SupportedStyles:
132
+ - percent_q
133
+ - bare_percent
134
+
135
+ Style/BracesAroundHashParameters:
136
+ EnforcedStyle: no_braces
137
+ SupportedStyles:
138
+ - braces
139
+ - no_braces
140
+
141
+ # Indentation of `when`.
142
+ Style/CaseIndentation:
143
+ IndentWhenRelativeTo: case
144
+ SupportedStyles:
145
+ - case
146
+ - end
147
+ IndentOneStep: false
148
+
149
+ Style/ClassAndModuleChildren:
150
+ # Checks the style of children definitions at classes and modules.
151
+ #
152
+ # Basically there are two different styles:
153
+ #
154
+ # `nested` - have each child on a separate line
155
+ # class Foo
156
+ # class Bar
157
+ # end
158
+ # end
159
+ #
160
+ # `compact` - combine definitions as much as possible
161
+ # class Foo::Bar
162
+ # end
163
+ #
164
+ # The compact style is only forced, for classes / modules with one child.
165
+ EnforcedStyle: nested
166
+ SupportedStyles:
167
+ - nested
168
+ - compact
169
+
170
+ Style/ClassCheck:
171
+ EnforcedStyle: is_a?
172
+ SupportedStyles:
173
+ - is_a?
174
+ - kind_of?
175
+
176
+ # Align with the style guide.
177
+ Style/CollectionMethods:
178
+ # Mapping from undesired method to desired_method
179
+ # e.g. to use `detect` over `find`:
180
+ #
181
+ # CollectionMethods:
182
+ # PreferredMethods:
183
+ # find: detect
184
+ PreferredMethods:
185
+ collect: 'map'
186
+ collect!: 'map!'
187
+ inject: 'reduce'
188
+ detect: 'find'
189
+ find_all: 'select'
190
+
191
+ # Checks formatting of special comments
192
+ Style/CommentAnnotation:
193
+ Keywords:
194
+ - TODO
195
+ - FIXME
196
+ - OPTIMIZE
197
+ - HACK
198
+ - REVIEW
199
+
200
+ # Multi-line method chaining should be done with leading dots.
201
+ Style/DotPosition:
202
+ EnforcedStyle: leading
203
+ SupportedStyles:
204
+ - leading
205
+ - trailing
206
+
207
+ # Use empty lines between defs.
208
+ Style/EmptyLineBetweenDefs:
209
+ # If true, this parameter means that single line method definitions don't
210
+ # need an empty line between them.
211
+ AllowAdjacentOneLineDefs: false
212
+
213
+ # Checks whether the source file has a utf-8 encoding comment or not
214
+ Style/Encoding:
215
+ EnforcedStyle: always
216
+ SupportedStyles:
217
+ - when_needed
218
+ - always
219
+
220
+ Style/FileName:
221
+ Exclude:
222
+ - '**/Rakefile'
223
+ - '**/Gemfile'
224
+ - '**/Capfile'
225
+ - '**/Vagrantfile'
226
+ - '**/Podfile'
227
+ - '**/Thorfile'
228
+
229
+ # Checks use of for or each in multiline loops.
230
+ Style/For:
231
+ EnforcedStyle: each
232
+ SupportedStyles:
233
+ - for
234
+ - each
235
+
236
+ # Enforce the method used for string formatting.
237
+ Style/FormatString:
238
+ EnforcedStyle: format
239
+ SupportedStyles:
240
+ - format
241
+ - sprintf
242
+ - percent
243
+
244
+ # Built-in global variables are allowed by default.
245
+ Style/GlobalVars:
246
+ AllowedVariables: []
247
+
248
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
249
+ # needs to have to trigger this cop
250
+ Style/GuardClause:
251
+ MinBodyLength: 1
252
+
253
+ Style/HashSyntax:
254
+ EnforcedStyle: ruby19
255
+ SupportedStyles:
256
+ - ruby19
257
+ - hash_rockets
258
+
259
+ Style/IfUnlessModifier:
260
+ MaxLineLength: 80
261
+
262
+ # Checks the indentation of the first key in a hash literal.
263
+ Style/IndentHash:
264
+ # The value `special_inside_parentheses` means that hash literals with braces
265
+ # that have their opening brace on the same line as a surrounding opening
266
+ # round parenthesis, shall have their first key indented relative to the
267
+ # first position inside the parenthesis.
268
+ # The value `consistent` means that the indentation of the first key shall
269
+ # always be relative to the first position of the line where the opening
270
+ # brace is.
271
+ EnforcedStyle: special_inside_parentheses
272
+ SupportedStyles:
273
+ - special_inside_parentheses
274
+ - consistent
275
+
276
+ Style/LambdaCall:
277
+ EnforcedStyle: call
278
+ SupportedStyles:
279
+ - call
280
+ - braces
281
+
282
+ Style/Next:
283
+ # With `always` all conditions at the end of an iteration needs to be
284
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
285
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
286
+ EnforcedStyle: skip_modifier_ifs
287
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
288
+ # needs to have to trigger this cop
289
+ MinBodyLength: 3
290
+ SupportedStyles:
291
+ - skip_modifier_ifs
292
+ - always
293
+
294
+ Style/NonNilCheck:
295
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
296
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
297
+ # **usually** OK, but might change behavior.
298
+ #
299
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
300
+ # offenses for `!x.nil?` and does no changes that might change behavior.
301
+ IncludeSemanticChanges: false
302
+
303
+ Style/MethodDefParentheses:
304
+ EnforcedStyle: require_parentheses
305
+ SupportedStyles:
306
+ - require_parentheses
307
+ - require_no_parentheses
308
+
309
+ Style/MethodName:
310
+ EnforcedStyle: snake_case
311
+ SupportedStyles:
312
+ - snake_case
313
+ - camelCase
314
+
315
+ Style/NumericLiterals:
316
+ MinDigits: 5
317
+
318
+ # Allow safe assignment in conditions.
319
+ Style/ParenthesesAroundCondition:
320
+ AllowSafeAssignment: true
321
+
322
+ Style/PercentLiteralDelimiters:
323
+ PreferredDelimiters:
324
+ '%': ()
325
+ '%i': ()
326
+ '%q': ()
327
+ '%Q': ()
328
+ '%r': '{}'
329
+ '%s': ()
330
+ '%w': ()
331
+ '%W': ()
332
+ '%x': ()
333
+
334
+ Style/PercentQLiterals:
335
+ EnforcedStyle: lower_case_q
336
+ SupportedStyles:
337
+ - lower_case_q # Use %q when possible, %Q when necessary
338
+ - upper_case_q # Always use %Q
339
+
340
+ Style/RaiseArgs:
341
+ EnforcedStyle: exploded
342
+ SupportedStyles:
343
+ - compact # raise Exception.new(msg)
344
+ - exploded # raise Exception, msg
345
+
346
+ Style/RedundantReturn:
347
+ # When true allows code like `return x, y`.
348
+ AllowMultipleReturnValues: false
349
+
350
+ Style/RegexpLiteral:
351
+ # The maximum number of (escaped) slashes that a slash-delimited regexp is
352
+ # allowed to have. If there are more slashes, a %r regexp shall be used.
353
+ MaxSlashes: 1
354
+
355
+ Style/Semicolon:
356
+ # Allow ; to separate several expressions on the same line.
357
+ AllowAsExpressionSeparator: false
358
+
359
+ Style/SignalException:
360
+ EnforcedStyle: semantic
361
+ SupportedStyles:
362
+ - only_raise
363
+ - only_fail
364
+ - semantic
365
+
366
+ Style/SingleLineBlockParams:
367
+ Methods:
368
+ - reduce:
369
+ - a
370
+ - e
371
+ - inject:
372
+ - a
373
+ - e
374
+
375
+ Style/SingleLineMethods:
376
+ AllowIfMethodIsEmpty: true
377
+
378
+ Style/StringLiterals:
379
+ EnforcedStyle: single_quotes
380
+ SupportedStyles:
381
+ - single_quotes
382
+ - double_quotes
383
+
384
+ Style/SpaceAroundEqualsInParameterDefault:
385
+ EnforcedStyle: space
386
+ SupportedStyles:
387
+ - space
388
+ - no_space
389
+
390
+ Style/SpaceBeforeBlockBraces:
391
+ EnforcedStyle: space
392
+ SupportedStyles:
393
+ - space
394
+ - no_space
395
+
396
+ Style/SpaceInsideBlockBraces:
397
+ EnforcedStyle: space
398
+ SupportedStyles:
399
+ - space
400
+ - no_space
401
+ # Valid values are: space, no_space
402
+ EnforcedStyleForEmptyBraces: no_space
403
+ # Space between { and |. Overrides EnforcedStyle if there is a conflict.
404
+ SpaceBeforeBlockParameters: true
405
+
406
+ Style/SpaceInsideHashLiteralBraces:
407
+ EnforcedStyle: space
408
+ EnforcedStyleForEmptyBraces: no_space
409
+ SupportedStyles:
410
+ - space
411
+ - no_space
412
+
413
+ Style/TrailingBlankLines:
414
+ EnforcedStyle: final_newline
415
+ SupportedStyles:
416
+ - final_newline
417
+ - final_blank_line
418
+
419
+ Style/TrailingComma:
420
+ # If EnforcedStyleForMultiline is comma, the cop allows a comma after the
421
+ # last item of a list, but only for lists where each item is on its own line.
422
+ EnforcedStyleForMultiline: no_comma
423
+ SupportedStyles:
424
+ - comma
425
+ - no_comma
426
+
427
+ # TrivialAccessors doesn't require exact name matches and doesn't allow
428
+ # predicated methods by default.
429
+ Style/TrivialAccessors:
430
+ ExactNameMatch: false
431
+ AllowPredicates: false
432
+ # Allows trivial writers that don't end in an equal sign. e.g.
433
+ #
434
+ # def on_exception(action)
435
+ # @on_exception=action
436
+ # end
437
+ # on_exception :restart
438
+ #
439
+ # Commonly used in DSLs
440
+ AllowDSLWriters: false
441
+ Whitelist:
442
+ - to_ary
443
+ - to_a
444
+ - to_c
445
+ - to_enum
446
+ - to_h
447
+ - to_hash
448
+ - to_i
449
+ - to_int
450
+ - to_io
451
+ - to_open
452
+ - to_path
453
+ - to_proc
454
+ - to_r
455
+ - to_regexp
456
+ - to_str
457
+ - to_s
458
+ - to_sym
459
+
460
+ Style/VariableName:
461
+ EnforcedStyle: snake_case
462
+ SupportedStyles:
463
+ - snake_case
464
+ - camelCase
465
+
466
+ Style/WhileUntilModifier:
467
+ MaxLineLength: 80
468
+
469
+ Style/WordArray:
470
+ MinSize: 0
471
+
472
+ ##################### Metrics ##################################
473
+
474
+ Metrics/BlockNesting:
475
+ Max: 3
476
+
477
+ Metrics/ClassLength:
478
+ CountComments: false # count full line comments?
479
+ Max: 100
480
+
481
+ # Avoid complex methods.
482
+ Metrics/CyclomaticComplexity:
483
+ Max: 6
484
+
485
+ Metrics/LineLength:
486
+ Max: 200
487
+ AllowURI: true
488
+
489
+ Metrics/MethodLength:
490
+ CountComments: false # count full line comments?
491
+ Max: 20
492
+
493
+ Metrics/ParameterLists:
494
+ Max: 5
495
+ CountKeywordArgs: true
496
+
497
+ Metrics/PerceivedComplexity:
498
+ Max: 7
499
+
500
+ ##################### Lint ##################################
501
+
502
+ # Allow safe assignment in conditions.
503
+ Lint/AssignmentInCondition:
504
+ AllowSafeAssignment: true
505
+
506
+ # Align ends correctly.
507
+ Lint/EndAlignment:
508
+ # The value `keyword` means that `end` should be aligned with the matching
509
+ # keyword (if, while, etc.).
510
+ # The value `variable` means that in assignments, `end` should be aligned
511
+ # with the start of the variable on the left hand side of `=`. In all other
512
+ # situations, `end` should still be aligned with the keyword.
513
+ AlignWith: keyword
514
+ SupportedStyles:
515
+ - keyword
516
+ - variable
517
+
518
+ Lint/DefEndAlignment:
519
+ # The value `def` means that `end` should be aligned with the def keyword.
520
+ # The value `start_of_line` means that `end` should be aligned with method
521
+ # calls like `private`, `public`, etc, if present in front of the `def`
522
+ # keyword on the same line.
523
+ AlignWith: start_of_line
524
+ SupportedStyles:
525
+ - start_of_line
526
+ - def
527
+
528
+ ##################### Rails ##################################
529
+
530
+ Rails/ActionFilter:
531
+ EnforcedStyle: action
532
+ SupportedStyles:
533
+ - action
534
+ - filter
535
+ Include:
536
+ - app/controllers/**/*.rb
537
+
538
+ Rails/DefaultScope:
539
+ Include:
540
+ - app/models/**/*.rb
541
+
542
+ Rails/HasAndBelongsToMany:
543
+ Include:
544
+ - app/models/**/*.rb
545
+
546
+ Rails/Output:
547
+ Include:
548
+ - app/**/*.rb
549
+ - config/**/*.rb
550
+ - db/**/*.rb
551
+ - lib/**/*.rb
552
+
553
+ Rails/ReadWriteAttribute:
554
+ Include:
555
+ - app/models/**/*.rb
556
+
557
+ Rails/ScopeArgs:
558
+ Include:
559
+ - app/models/**/*.rb
560
+
561
+ Rails/Validation:
562
+ Include:
563
+ - app/models/**/*.rb