puppet-strings 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -2
  3. data/lib/puppet-strings.rb +2 -2
  4. data/lib/puppet-strings/markdown.rb +1 -1
  5. data/lib/puppet-strings/markdown/base.rb +6 -0
  6. data/lib/puppet-strings/markdown/data_type.rb +16 -0
  7. data/lib/puppet-strings/markdown/resource_type.rb +19 -2
  8. data/lib/puppet-strings/markdown/templates/classes_and_defines.erb +4 -4
  9. data/lib/puppet-strings/markdown/templates/data_type.erb +11 -4
  10. data/lib/puppet-strings/markdown/templates/data_type_function.erb +67 -0
  11. data/lib/puppet-strings/markdown/templates/function.erb +2 -1
  12. data/lib/puppet-strings/markdown/templates/puppet_task.erb +1 -1
  13. data/lib/puppet-strings/markdown/templates/resource_type.erb +12 -12
  14. data/lib/puppet-strings/markdown/templates/table_of_contents.erb +6 -6
  15. data/lib/puppet-strings/version.rb +1 -1
  16. data/lib/puppet-strings/yard/code_objects/data_type.rb +26 -6
  17. data/lib/puppet-strings/yard/code_objects/type.rb +46 -5
  18. data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +190 -43
  19. data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +6 -0
  20. data/lib/puppet-strings/yard/handlers/ruby/type_extras_handler.rb +1 -1
  21. data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +6 -0
  22. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/method_details_list.erb +6 -0
  23. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/setup.rb +9 -1
  24. data/lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb +3 -1
  25. metadata +4 -46
  26. data/CODEOWNERS +0 -1
  27. data/Gemfile +0 -53
  28. data/HISTORY.md +0 -218
  29. data/JSON.md +0 -832
  30. data/Rakefile +0 -160
  31. data/codecov.yml +0 -3
  32. data/misc/ANNOUNCEMENT_TEMPLATE.md +0 -40
  33. data/spec/acceptance/emit_json_options_spec.rb +0 -69
  34. data/spec/acceptance/generate_markdown_spec.rb +0 -47
  35. data/spec/acceptance/running_strings_generate_spec.rb +0 -88
  36. data/spec/fixtures/acceptance/modules/test/functions/add.pp +0 -9
  37. data/spec/fixtures/acceptance/modules/test/lib/puppet/functions/4x_function.rb +0 -5
  38. data/spec/fixtures/acceptance/modules/test/lib/puppet/parser/functions/function3x.rb +0 -2
  39. data/spec/fixtures/acceptance/modules/test/lib/puppet/provider/server/linux.rb +0 -9
  40. data/spec/fixtures/acceptance/modules/test/lib/puppet/type/database.rb +0 -15
  41. data/spec/fixtures/acceptance/modules/test/manifests/init.pp +0 -31
  42. data/spec/fixtures/acceptance/modules/test/manifests/triple_nested_classes.pp +0 -27
  43. data/spec/fixtures/acceptance/modules/test/metadata.json +0 -10
  44. data/spec/fixtures/acceptance/modules/test/types/elephant.pp +0 -2
  45. data/spec/fixtures/unit/markdown/output.md +0 -561
  46. data/spec/fixtures/unit/markdown/output_with_data_types.md +0 -606
  47. data/spec/fixtures/unit/markdown/output_with_plan.md +0 -595
  48. data/spec/spec_helper.rb +0 -49
  49. data/spec/spec_helper_acceptance.rb +0 -58
  50. data/spec/spec_helper_acceptance_local.rb +0 -10
  51. data/spec/unit/puppet-strings/describe_spec.rb +0 -141
  52. data/spec/unit/puppet-strings/json_spec.rb +0 -302
  53. data/spec/unit/puppet-strings/markdown/base_spec.rb +0 -146
  54. data/spec/unit/puppet-strings/markdown_spec.rb +0 -374
  55. data/spec/unit/puppet-strings/yard/code_objects/task_spec.rb +0 -92
  56. data/spec/unit/puppet-strings/yard/handlers/json/task_handler_spec.rb +0 -116
  57. data/spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb +0 -217
  58. data/spec/unit/puppet-strings/yard/handlers/puppet/data_type_alias_handler_spec.rb +0 -65
  59. data/spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb +0 -231
  60. data/spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb +0 -315
  61. data/spec/unit/puppet-strings/yard/handlers/ruby/data_type_handler_spec.rb +0 -309
  62. data/spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb +0 -746
  63. data/spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb +0 -158
  64. data/spec/unit/puppet-strings/yard/handlers/ruby/rsapi_handler_spec.rb +0 -235
  65. data/spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb +0 -311
  66. data/spec/unit/puppet-strings/yard/parsers/json/parser_spec.rb +0 -72
  67. data/spec/unit/puppet-strings/yard/parsers/json/task_statement_spec.rb +0 -56
  68. data/spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb +0 -251
  69. 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
-