puppet-strings 2.2.0 → 2.6.0

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