puppet-strings 2.3.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +102 -4
  3. data/COMMITTERS.md +17 -17
  4. data/CONTRIBUTING.md +37 -7
  5. data/README.md +17 -12
  6. data/lib/puppet-strings.rb +5 -3
  7. data/lib/puppet-strings/describe.rb +2 -0
  8. data/lib/puppet-strings/json.rb +2 -0
  9. data/lib/puppet-strings/markdown.rb +12 -10
  10. data/lib/puppet-strings/markdown/base.rb +30 -3
  11. data/lib/puppet-strings/markdown/data_type.rb +18 -0
  12. data/lib/puppet-strings/markdown/data_types.rb +3 -1
  13. data/lib/puppet-strings/markdown/defined_type.rb +2 -0
  14. data/lib/puppet-strings/markdown/defined_types.rb +3 -1
  15. data/lib/puppet-strings/markdown/function.rb +9 -7
  16. data/lib/puppet-strings/markdown/functions.rb +3 -1
  17. data/lib/puppet-strings/markdown/puppet_class.rb +2 -0
  18. data/lib/puppet-strings/markdown/puppet_classes.rb +3 -1
  19. data/lib/puppet-strings/markdown/puppet_plan.rb +2 -0
  20. data/lib/puppet-strings/markdown/puppet_plans.rb +3 -1
  21. data/lib/puppet-strings/markdown/puppet_task.rb +2 -0
  22. data/lib/puppet-strings/markdown/puppet_tasks.rb +3 -1
  23. data/lib/puppet-strings/markdown/resource_type.rb +21 -2
  24. data/lib/puppet-strings/markdown/resource_types.rb +3 -1
  25. data/lib/puppet-strings/markdown/table_of_contents.rb +3 -1
  26. data/lib/puppet-strings/markdown/templates/classes_and_defines.erb +18 -6
  27. data/lib/puppet-strings/markdown/templates/data_type.erb +30 -7
  28. data/lib/puppet-strings/markdown/templates/data_type_function.erb +67 -0
  29. data/lib/puppet-strings/markdown/templates/function.erb +10 -1
  30. data/lib/puppet-strings/markdown/templates/puppet_task.erb +1 -1
  31. data/lib/puppet-strings/markdown/templates/resource_type.erb +35 -13
  32. data/lib/puppet-strings/markdown/templates/table_of_contents.erb +6 -6
  33. data/lib/puppet-strings/monkey_patches/display_object_command.rb +2 -0
  34. data/lib/puppet-strings/tasks.rb +2 -0
  35. data/lib/puppet-strings/tasks/generate.rb +2 -0
  36. data/lib/puppet-strings/tasks/gh_pages.rb +3 -0
  37. data/lib/puppet-strings/version.rb +3 -1
  38. data/lib/puppet-strings/yard.rb +9 -0
  39. data/lib/puppet-strings/yard/code_objects.rb +2 -0
  40. data/lib/puppet-strings/yard/code_objects/base.rb +2 -0
  41. data/lib/puppet-strings/yard/code_objects/class.rb +4 -2
  42. data/lib/puppet-strings/yard/code_objects/data_type.rb +30 -8
  43. data/lib/puppet-strings/yard/code_objects/data_type_alias.rb +2 -0
  44. data/lib/puppet-strings/yard/code_objects/defined_type.rb +4 -2
  45. data/lib/puppet-strings/yard/code_objects/function.rb +8 -5
  46. data/lib/puppet-strings/yard/code_objects/group.rb +3 -0
  47. data/lib/puppet-strings/yard/code_objects/plan.rb +4 -2
  48. data/lib/puppet-strings/yard/code_objects/provider.rb +6 -0
  49. data/lib/puppet-strings/yard/code_objects/task.rb +3 -1
  50. data/lib/puppet-strings/yard/code_objects/type.rb +49 -5
  51. data/lib/puppet-strings/yard/handlers.rb +2 -0
  52. data/lib/puppet-strings/yard/handlers/helpers.rb +2 -0
  53. data/lib/puppet-strings/yard/handlers/json/base.rb +2 -0
  54. data/lib/puppet-strings/yard/handlers/json/task_handler.rb +2 -0
  55. data/lib/puppet-strings/yard/handlers/puppet/base.rb +3 -0
  56. data/lib/puppet-strings/yard/handlers/puppet/class_handler.rb +2 -0
  57. data/lib/puppet-strings/yard/handlers/puppet/data_type_alias_handler.rb +2 -0
  58. data/lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb +2 -0
  59. data/lib/puppet-strings/yard/handlers/puppet/function_handler.rb +3 -1
  60. data/lib/puppet-strings/yard/handlers/puppet/plan_handler.rb +2 -0
  61. data/lib/puppet-strings/yard/handlers/ruby/base.rb +5 -0
  62. data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +225 -52
  63. data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +9 -7
  64. data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +13 -0
  65. data/lib/puppet-strings/yard/handlers/ruby/rsapi_handler.rb +4 -1
  66. data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +20 -6
  67. data/lib/puppet-strings/yard/handlers/ruby/type_extras_handler.rb +6 -3
  68. data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +18 -1
  69. data/lib/puppet-strings/yard/parsers.rb +2 -0
  70. data/lib/puppet-strings/yard/parsers/json/parser.rb +2 -0
  71. data/lib/puppet-strings/yard/parsers/json/task_statement.rb +2 -0
  72. data/lib/puppet-strings/yard/parsers/puppet/parser.rb +18 -14
  73. data/lib/puppet-strings/yard/parsers/puppet/statement.rb +4 -0
  74. data/lib/puppet-strings/yard/tags.rb +4 -0
  75. data/lib/puppet-strings/yard/tags/enum_tag.rb +14 -0
  76. data/lib/puppet-strings/yard/tags/factory.rb +18 -0
  77. data/lib/puppet-strings/yard/tags/overload_tag.rb +4 -1
  78. data/lib/puppet-strings/yard/tags/parameter_directive.rb +5 -4
  79. data/lib/puppet-strings/yard/tags/property_directive.rb +5 -4
  80. data/lib/puppet-strings/yard/tags/summary_tag.rb +2 -0
  81. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/method_details_list.erb +6 -0
  82. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/setup.rb +9 -1
  83. data/lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb +1 -1
  84. data/lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb +3 -1
  85. data/lib/puppet-strings/yard/templates/default/tags/html/enum.erb +17 -0
  86. data/lib/puppet-strings/yard/templates/default/tags/setup.rb +6 -0
  87. data/lib/puppet-strings/yard/util.rb +7 -4
  88. data/lib/puppet/application/strings.rb +2 -0
  89. data/lib/puppet/face/strings.rb +4 -1
  90. data/lib/puppet/feature/rgen.rb +2 -0
  91. data/lib/puppet/feature/yard.rb +2 -0
  92. metadata +14 -51
  93. data/Gemfile +0 -47
  94. data/HISTORY.md +0 -218
  95. data/JSON.md +0 -832
  96. data/Rakefile +0 -168
  97. data/codecov.yml +0 -3
  98. data/misc/ANNOUNCEMENT_TEMPLATE.md +0 -40
  99. data/spec/acceptance/emit_json_options_spec.rb +0 -69
  100. data/spec/acceptance/generate_markdown_spec.rb +0 -47
  101. data/spec/acceptance/running_strings_generate_spec.rb +0 -78
  102. data/spec/fixtures/acceptance/modules/test/functions/add.pp +0 -9
  103. data/spec/fixtures/acceptance/modules/test/lib/puppet/functions/4x_function.rb +0 -5
  104. data/spec/fixtures/acceptance/modules/test/lib/puppet/parser/functions/function3x.rb +0 -2
  105. data/spec/fixtures/acceptance/modules/test/lib/puppet/provider/server/linux.rb +0 -9
  106. data/spec/fixtures/acceptance/modules/test/lib/puppet/type/database.rb +0 -15
  107. data/spec/fixtures/acceptance/modules/test/manifests/init.pp +0 -27
  108. data/spec/fixtures/acceptance/modules/test/manifests/triple_nested_classes.pp +0 -27
  109. data/spec/fixtures/acceptance/modules/test/metadata.json +0 -10
  110. data/spec/fixtures/acceptance/modules/test/types/elephant.pp +0 -2
  111. data/spec/fixtures/unit/markdown/output.md +0 -508
  112. data/spec/fixtures/unit/markdown/output_with_data_types.md +0 -553
  113. data/spec/fixtures/unit/markdown/output_with_plan.md +0 -542
  114. data/spec/spec_helper.rb +0 -49
  115. data/spec/spec_helper_acceptance.rb +0 -58
  116. data/spec/spec_helper_acceptance_local.rb +0 -10
  117. data/spec/unit/puppet-strings/describe_spec.rb +0 -141
  118. data/spec/unit/puppet-strings/json_spec.rb +0 -302
  119. data/spec/unit/puppet-strings/markdown/base_spec.rb +0 -146
  120. data/spec/unit/puppet-strings/markdown_spec.rb +0 -357
  121. data/spec/unit/puppet-strings/yard/code_objects/task_spec.rb +0 -92
  122. data/spec/unit/puppet-strings/yard/handlers/json/task_handler_spec.rb +0 -116
  123. data/spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb +0 -217
  124. data/spec/unit/puppet-strings/yard/handlers/puppet/data_type_alias_handler_spec.rb +0 -65
  125. data/spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb +0 -231
  126. data/spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb +0 -315
  127. data/spec/unit/puppet-strings/yard/handlers/ruby/data_type_handler_spec.rb +0 -232
  128. data/spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb +0 -746
  129. data/spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb +0 -158
  130. data/spec/unit/puppet-strings/yard/handlers/ruby/rsapi_handler_spec.rb +0 -235
  131. data/spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb +0 -311
  132. data/spec/unit/puppet-strings/yard/parsers/json/parser_spec.rb +0 -72
  133. data/spec/unit/puppet-strings/yard/parsers/json/task_statement_spec.rb +0 -56
  134. data/spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb +0 -251
  135. data/spec/unit/puppet-strings/yard/util_spec.rb +0 -48
@@ -1,553 +0,0 @@
1
- # Reference
2
- <!-- DO NOT EDIT: This document was generated by Puppet Strings -->
3
-
4
- ## Table of Contents
5
-
6
- **Classes**
7
-
8
- _Public Classes_
9
-
10
- * [`klass`](#klass): A simple class.
11
-
12
- _Private Classes_
13
-
14
- * `noparams`: Overview for class noparams
15
-
16
- **Defined types**
17
-
18
- * [`klass::dt`](#klassdt): A simple defined type.
19
-
20
- **Resource types**
21
-
22
- * [`apt_key`](#apt_key): Example resource type using the new API.
23
- * [`database`](#database): An example database server type.
24
-
25
- **Functions**
26
-
27
- * [`func`](#func): A simple Puppet function.
28
- * [`func3x`](#func3x): Documentation for an example 3.x function.
29
- * [`func4x`](#func4x): An example 4.x function.
30
- * [`func4x_1`](#func4x_1): An example 4.x function with only one signature.
31
-
32
- **Data types**
33
-
34
- * [`Amodule::ComplexAlias`](#amodulecomplexalias): Documentation for Amodule::ComplexAlias
35
- * [`Amodule::SimpleAlias`](#amodulesimplealias): Documentation for Amodule::SimpleAlias
36
- * [`UnitDataType`](#unitdatatype): An example Puppet Data Type in Ruby.
37
-
38
- **Tasks**
39
-
40
- * [`(stdin)`](#(stdin)): Allows you to backup your database to local file.
41
-
42
- ## Classes
43
-
44
- ### klass
45
-
46
- An overview for a simple class.
47
-
48
- * **TODO** Do a thing
49
-
50
- * **Note** some note
51
-
52
- * **Since** 1.0.0
53
-
54
- * **See also**
55
- www.puppet.com
56
-
57
- #### Examples
58
-
59
- ##### This is an example
60
-
61
- ```puppet
62
- class { 'klass':
63
- param1 => 1,
64
- param3 => 'foo',
65
- }
66
- ```
67
-
68
- ##### This is another example
69
-
70
- ```puppet
71
- class { 'klass':
72
- param1 => 1,
73
- param3 => 'foo',
74
- }
75
- ```
76
-
77
- #### Parameters
78
-
79
- The following parameters are available in the `klass` class.
80
-
81
- ##### `param1`
82
-
83
- Data type: `Integer`
84
-
85
- First param.
86
-
87
- Default value: 1
88
-
89
- ##### `param2`
90
-
91
- Data type: `Any`
92
-
93
- Second param.
94
-
95
- Options:
96
-
97
- * **:opt1** `String`: something about opt1
98
- * **:opt2** `Hash`: a hash of stuff
99
-
100
- Default value: `undef`
101
-
102
- ##### `param3`
103
-
104
- Data type: `String`
105
-
106
- Third param.
107
-
108
- Default value: 'hi'
109
-
110
- ## Defined types
111
-
112
- ### klass::dt
113
-
114
- An overview for a simple defined type.
115
-
116
- * **Since** 1.1.0
117
-
118
- * **See also**
119
- www.puppet.com
120
-
121
- #### Examples
122
-
123
- ##### Here's an example of this type:
124
-
125
- ```puppet
126
- klass::dt { 'foo':
127
- param1 => 33,
128
- param4 => false,
129
- }
130
- ```
131
-
132
- #### Parameters
133
-
134
- The following parameters are available in the `klass::dt` defined type.
135
-
136
- ##### `param1`
137
-
138
- Data type: `Integer`
139
-
140
- First param.
141
-
142
- Default value: 44
143
-
144
- ##### `param2`
145
-
146
- Data type: `Any`
147
-
148
- Second param.
149
-
150
- Options:
151
-
152
- * **:opt1** `String`: something about opt1
153
- * **:opt2** `Hash`: a hash of stuff
154
-
155
- ##### `param3`
156
-
157
- Data type: `String`
158
-
159
- Third param.
160
-
161
- Default value: 'hi'
162
-
163
- ##### `param4`
164
-
165
- Data type: `Boolean`
166
-
167
- Fourth param.
168
-
169
- Default value: `true`
170
-
171
- ## Resource types
172
-
173
- ### apt_key
174
-
175
- This type provides Puppet with the capabilities to manage GPG keys needed
176
- by apt to perform package validation. Apt has it's own GPG keyring that can
177
- be manipulated through the `apt-key` command.
178
- **Autorequires**:
179
- If Puppet is given the location of a key file which looks like an absolute
180
- path this type will autorequire that file.
181
-
182
- #### Examples
183
-
184
- ##### here's an example
185
-
186
- ```puppet
187
- apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F':
188
- source => 'http://apt.puppetlabs.com/pubkey.gpg'
189
- }
190
- ```
191
-
192
- #### Properties
193
-
194
- The following properties are available in the `apt_key` type.
195
-
196
- ##### `ensure`
197
-
198
- Data type: `Enum[present, absent]`
199
-
200
- Whether this apt key should be present or absent on the target system.
201
-
202
- ##### `created`
203
-
204
- Data type: `String`
205
-
206
- Date the key was created, in ISO format.
207
-
208
- #### Parameters
209
-
210
- The following parameters are available in the `apt_key` type.
211
-
212
- ##### `id`
213
-
214
- namevar
215
-
216
- Data type: `Variant[Pattern[/A(0x)?[0-9a-fA-F]{8}Z/], Pattern[/A(0x)?[0-9a-fA-F]{16}Z/], Pattern[/A(0x)?[0-9a-fA-F]{40}Z/]]`
217
- _*this data type contains a regex that may not be accurately reflected in generated documentation_
218
-
219
- The ID of the key you want to manage.
220
-
221
- ### database
222
-
223
- An example database server type.
224
-
225
- #### Examples
226
-
227
- ##### here's an example
228
-
229
- ```puppet
230
- database { 'foo':
231
- address => 'qux.baz.bar',
232
- }
233
- ```
234
-
235
- #### Properties
236
-
237
- The following properties are available in the `database` type.
238
-
239
- ##### `ensure`
240
-
241
- Valid values: present, absent, up, down
242
-
243
- Aliases: "up"=>"present", "down"=>"absent"
244
-
245
- What state the database should be in.
246
-
247
- Default value: up
248
-
249
- ##### `file`
250
-
251
- The database file to use.
252
-
253
- ##### `log_level`
254
-
255
- Valid values: debug, warn, error
256
-
257
- The log level to use.
258
-
259
- Default value: warn
260
-
261
- #### Parameters
262
-
263
- The following parameters are available in the `database` type.
264
-
265
- ##### `address`
266
-
267
- namevar
268
-
269
- The database server name.
270
-
271
- ##### `encryption_key`
272
-
273
- The encryption key to use.
274
-
275
- Required features: encryption.
276
-
277
- ##### `encrypt`
278
-
279
- Valid values: `true`, `false`, yes, no
280
-
281
- Whether or not to encrypt the database.
282
-
283
- Default value: `false`
284
-
285
- ## Functions
286
-
287
- ### func
288
-
289
- Type: Puppet Language
290
-
291
- A simple Puppet function.
292
-
293
- #### Examples
294
-
295
- ##### Test
296
-
297
- ```puppet
298
- $result = func(1, 2)
299
- ```
300
-
301
- #### `func(Integer $param1, Any $param2, String $param3 = hi)`
302
-
303
- A simple Puppet function.
304
-
305
- Returns: `Undef` Returns nothing.
306
-
307
- Raises:
308
- * `SomeError` this is some error
309
-
310
- ##### Examples
311
-
312
- ###### Test
313
-
314
- ```puppet
315
- $result = func(1, 2)
316
- ```
317
-
318
- ##### `param1`
319
-
320
- Data type: `Integer`
321
-
322
- First param.
323
-
324
- ##### `param2`
325
-
326
- Data type: `Any`
327
-
328
- Second param.
329
-
330
- ##### `param3`
331
-
332
- Data type: `String`
333
-
334
- Third param.
335
-
336
- Options:
337
-
338
- * **:param3opt** `Array`: Something about this option
339
-
340
- ### func3x
341
-
342
- Type: Ruby 3.x API
343
-
344
- Documentation for an example 3.x function.
345
-
346
- #### Examples
347
-
348
- ##### Calling the function.
349
-
350
- ```puppet
351
- func3x('hi', 10)
352
- ```
353
-
354
- #### `func3x(String $param1, Integer $param2)`
355
-
356
- Documentation for an example 3.x function.
357
-
358
- Returns: `Undef`
359
-
360
- ##### Examples
361
-
362
- ###### Calling the function.
363
-
364
- ```puppet
365
- func3x('hi', 10)
366
- ```
367
-
368
- ##### `param1`
369
-
370
- Data type: `String`
371
-
372
- The first parameter.
373
-
374
- ##### `param2`
375
-
376
- Data type: `Integer`
377
-
378
- The second parameter.
379
-
380
- ### func4x
381
-
382
- Type: Ruby 4.x API
383
-
384
- An example 4.x function.
385
-
386
- #### Examples
387
-
388
- ##### Calling the function
389
-
390
- ```puppet
391
- $result = func4x(1, 'foo')
392
- ```
393
-
394
- ##### Calling the function with all args
395
-
396
- ```puppet
397
- $result = func4x(1, 'foo', ['bar'])
398
- ```
399
-
400
- #### `func4x(Integer $param1, Any $param2, Optional[Array[String]] $param3)`
401
-
402
- An overview for the first overload.
403
-
404
- Returns: `Undef` Returns nothing.
405
-
406
- ##### Examples
407
-
408
- ###### Calling the function foo
409
-
410
- ```puppet
411
- $result = func4x(1, 'foooo')
412
- ```
413
-
414
- ##### `param1`
415
-
416
- Data type: `Integer`
417
-
418
- The first parameter.
419
-
420
- ##### `param2`
421
-
422
- Data type: `Any`
423
-
424
- The second parameter.
425
-
426
- Options:
427
-
428
- * **:option** `String`: an option
429
- * **:option2** `String`: another option
430
-
431
- ##### `param3`
432
-
433
- Data type: `Optional[Array[String]]`
434
-
435
- The third parameter.
436
-
437
- #### `func4x(Boolean $param, Callable &$block)`
438
-
439
- An overview for the second overload.
440
-
441
- Returns: `String` Returns a string.
442
-
443
- ##### Examples
444
-
445
- ###### Calling the function bar
446
-
447
- ```puppet
448
- $result = func4x(1, 'bar', ['foo'])
449
- ```
450
-
451
- ##### `param`
452
-
453
- Data type: `Boolean`
454
-
455
- The first parameter.
456
-
457
- ##### `&block`
458
-
459
- Data type: `Callable`
460
-
461
- The block parameter.
462
-
463
- ### func4x_1
464
-
465
- Type: Ruby 4.x API
466
-
467
- An example 4.x function with only one signature.
468
-
469
- #### `func4x_1(Integer $param1)`
470
-
471
- An example 4.x function with only one signature.
472
-
473
- Returns: `Undef` Returns nothing.
474
-
475
- ##### `param1`
476
-
477
- Data type: `Integer`
478
-
479
- The first parameter.
480
-
481
- ## Data types
482
-
483
- ### Amodule::ComplexAlias
484
-
485
- Documentation for Amodule::ComplexAlias
486
-
487
- Alias of `Struct[{
488
- value_type => Optional[ValueType],
489
- merge => Optional[MergeType]
490
- }]`
491
-
492
- ### Amodule::SimpleAlias
493
-
494
- Documentation for Amodule::SimpleAlias
495
-
496
- Alias of `Variant[Numeric, String[1,20]]`
497
-
498
- ### UnitDataType
499
-
500
- An example Puppet Data Type in Ruby.
501
-
502
- #### Parameters
503
-
504
- The following parameters are available in the `UnitDataType` data type.
505
-
506
- ##### `param1`
507
-
508
- Data type: `Variant[Numeric, String[1,2]]`
509
-
510
- A variant parameter.
511
-
512
- ##### `param2`
513
-
514
- Data type: `Optional[String[1]]`
515
-
516
- Optional String parameter.
517
-
518
- Default value: param2
519
-
520
- ## Tasks
521
-
522
- ### (stdin)
523
-
524
- Allows you to backup your database to local file.
525
-
526
- **Supports noop?** false
527
-
528
- #### Parameters
529
-
530
- ##### `database`
531
-
532
- Data type: `Optional[String[1]]`
533
-
534
- Database to connect to
535
-
536
- ##### `user`
537
-
538
- Data type: `Optional[String[1]]`
539
-
540
- The user
541
-
542
- ##### `password`
543
-
544
- Data type: `Optional[String[1]]`
545
-
546
- The password
547
-
548
- ##### `sql`
549
-
550
- Data type: `String[1]`
551
-
552
- Path to file you want backup to
553
-