puppet-strings 2.4.0 → 2.8.0

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