puppet-strings 2.1.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +78 -4
  3. data/CONTRIBUTING.md +32 -2
  4. data/README.md +81 -17
  5. data/lib/puppet-strings.rb +13 -4
  6. data/lib/puppet-strings/describe.rb +68 -0
  7. data/lib/puppet-strings/json.rb +2 -38
  8. data/lib/puppet-strings/markdown.rb +3 -1
  9. data/lib/puppet-strings/markdown/base.rb +37 -16
  10. data/lib/puppet-strings/markdown/data_type.rb +34 -0
  11. data/lib/puppet-strings/markdown/data_types.rb +41 -0
  12. data/lib/puppet-strings/markdown/function.rb +2 -2
  13. data/lib/puppet-strings/markdown/resource_type.rb +19 -2
  14. data/lib/puppet-strings/markdown/table_of_contents.rb +1 -0
  15. data/lib/puppet-strings/markdown/templates/classes_and_defines.erb +12 -4
  16. data/lib/puppet-strings/markdown/templates/data_type.erb +93 -0
  17. data/lib/puppet-strings/markdown/templates/data_type_function.erb +67 -0
  18. data/lib/puppet-strings/markdown/templates/function.erb +36 -1
  19. data/lib/puppet-strings/markdown/templates/puppet_task.erb +1 -1
  20. data/lib/puppet-strings/markdown/templates/resource_type.erb +32 -12
  21. data/lib/puppet-strings/markdown/templates/table_of_contents.erb +6 -6
  22. data/lib/puppet-strings/tasks/generate.rb +10 -3
  23. data/lib/puppet-strings/version.rb +1 -1
  24. data/lib/puppet-strings/yard.rb +16 -0
  25. data/lib/puppet-strings/yard/code_objects.rb +2 -0
  26. data/lib/puppet-strings/yard/code_objects/class.rb +2 -2
  27. data/lib/puppet-strings/yard/code_objects/data_type.rb +100 -0
  28. data/lib/puppet-strings/yard/code_objects/data_type_alias.rb +58 -0
  29. data/lib/puppet-strings/yard/code_objects/defined_type.rb +2 -2
  30. data/lib/puppet-strings/yard/code_objects/function.rb +4 -4
  31. data/lib/puppet-strings/yard/code_objects/plan.rb +2 -2
  32. data/lib/puppet-strings/yard/code_objects/provider.rb +1 -1
  33. data/lib/puppet-strings/yard/code_objects/task.rb +1 -1
  34. data/lib/puppet-strings/yard/code_objects/type.rb +48 -6
  35. data/lib/puppet-strings/yard/handlers.rb +3 -0
  36. data/lib/puppet-strings/yard/handlers/puppet/data_type_alias_handler.rb +24 -0
  37. data/lib/puppet-strings/yard/handlers/ruby/base.rb +12 -1
  38. data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +393 -0
  39. data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +2 -12
  40. data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +1 -9
  41. data/lib/puppet-strings/yard/handlers/ruby/rsapi_handler.rb +3 -3
  42. data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +135 -0
  43. data/lib/puppet-strings/yard/handlers/ruby/type_extras_handler.rb +56 -0
  44. data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +9 -115
  45. data/lib/puppet-strings/yard/parsers/json/parser.rb +4 -2
  46. data/lib/puppet-strings/yard/parsers/puppet/parser.rb +14 -7
  47. data/lib/puppet-strings/yard/parsers/puppet/statement.rb +25 -0
  48. data/lib/puppet-strings/yard/tags.rb +2 -0
  49. data/lib/puppet-strings/yard/tags/enum_tag.rb +12 -0
  50. data/lib/puppet-strings/yard/tags/factory.rb +16 -0
  51. data/lib/puppet-strings/yard/tags/overload_tag.rb +2 -2
  52. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_data_type.erb +10 -0
  53. data/lib/puppet-strings/yard/templates/default/fulldoc/html/setup.rb +9 -0
  54. data/lib/puppet-strings/yard/templates/default/layout/html/objects.erb +2 -0
  55. data/lib/puppet-strings/yard/templates/default/layout/html/setup.rb +18 -1
  56. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/box_info.erb +10 -0
  57. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/header.erb +1 -0
  58. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/method_details_list.erb +6 -0
  59. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/note.erb +6 -0
  60. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/overview.erb +6 -0
  61. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/setup.rb +13 -0
  62. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/source.erb +12 -0
  63. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/summary.erb +4 -0
  64. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/todo.erb +6 -0
  65. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/alias_of.erb +10 -0
  66. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/box_info.erb +10 -0
  67. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/header.erb +1 -0
  68. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/note.erb +6 -0
  69. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/overview.erb +6 -0
  70. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/setup.rb +17 -0
  71. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/source.erb +12 -0
  72. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/summary.erb +4 -0
  73. data/lib/puppet-strings/yard/templates/default/puppet_data_type_alias/html/todo.erb +6 -0
  74. data/lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb +3 -1
  75. data/lib/puppet-strings/yard/templates/default/tags/html/enum.erb +17 -0
  76. data/lib/puppet-strings/yard/templates/default/tags/setup.rb +7 -0
  77. data/lib/puppet-strings/yard/util.rb +48 -0
  78. data/lib/puppet/face/strings.rb +68 -3
  79. metadata +36 -45
  80. data/Gemfile +0 -37
  81. data/HISTORY.md +0 -218
  82. data/JSON.md +0 -802
  83. data/Rakefile +0 -93
  84. data/codecov.yml +0 -3
  85. data/misc/ANNOUNCEMENT_TEMPLATE.md +0 -40
  86. data/spec/acceptance/emit_json_options.rb +0 -71
  87. data/spec/acceptance/generate_markdown_spec.rb +0 -49
  88. data/spec/acceptance/lib/util.rb +0 -163
  89. data/spec/acceptance/running_strings_generate.rb +0 -54
  90. data/spec/fixtures/acceptance/modules/test/functions/add.pp +0 -9
  91. data/spec/fixtures/acceptance/modules/test/lib/puppet/functions/4x_function.rb +0 -5
  92. data/spec/fixtures/acceptance/modules/test/lib/puppet/parser/functions/function3x.rb +0 -2
  93. data/spec/fixtures/acceptance/modules/test/lib/puppet/provider/server/linux.rb +0 -9
  94. data/spec/fixtures/acceptance/modules/test/lib/puppet/type/database.rb +0 -15
  95. data/spec/fixtures/acceptance/modules/test/manifests/init.pp +0 -27
  96. data/spec/fixtures/acceptance/modules/test/manifests/triple_nested_classes.pp +0 -27
  97. data/spec/fixtures/acceptance/modules/test/metadata.json +0 -6
  98. data/spec/fixtures/unit/json/output.json +0 -660
  99. data/spec/fixtures/unit/json/output_with_plan.json +0 -697
  100. data/spec/fixtures/unit/json/output_without_puppet_function.json +0 -480
  101. data/spec/fixtures/unit/markdown/output.md +0 -444
  102. data/spec/fixtures/unit/markdown/output_with_plan.md +0 -478
  103. data/spec/spec_helper.rb +0 -45
  104. data/spec/spec_helper_acceptance.rb +0 -28
  105. data/spec/unit/puppet-strings/json_spec.rb +0 -229
  106. data/spec/unit/puppet-strings/markdown/base_spec.rb +0 -146
  107. data/spec/unit/puppet-strings/markdown_spec.rb +0 -283
  108. data/spec/unit/puppet-strings/yard/code_objects/task_spec.rb +0 -92
  109. data/spec/unit/puppet-strings/yard/handlers/json/task_handler_spec.rb +0 -124
  110. data/spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb +0 -217
  111. data/spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb +0 -231
  112. data/spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb +0 -315
  113. data/spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb +0 -729
  114. data/spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb +0 -139
  115. data/spec/unit/puppet-strings/yard/handlers/ruby/rsapi_handler_spec.rb +0 -214
  116. data/spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb +0 -269
  117. data/spec/unit/puppet-strings/yard/parsers/json/parser_spec.rb +0 -70
  118. data/spec/unit/puppet-strings/yard/parsers/json/task_statement_spec.rb +0 -56
  119. data/spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb +0 -209
  120. 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,660 +0,0 @@
1
- {
2
- "puppet_classes": [
3
- {
4
- "name": "klass",
5
- "file": "(stdin)",
6
- "line": 7,
7
- "inherits": "foo::bar",
8
- "docstring": {
9
- "text": "A simple class.",
10
- "tags": [
11
- {
12
- "tag_name": "todo",
13
- "text": "Do a thing"
14
- },
15
- {
16
- "tag_name": "note",
17
- "text": "Some note"
18
- },
19
- {
20
- "tag_name": "param",
21
- "text": "First param.",
22
- "types": [
23
- "Integer"
24
- ],
25
- "name": "param1"
26
- },
27
- {
28
- "tag_name": "param",
29
- "text": "Second param.",
30
- "types": [
31
- "Any"
32
- ],
33
- "name": "param2"
34
- },
35
- {
36
- "tag_name": "param",
37
- "text": "Third param.",
38
- "types": [
39
- "String"
40
- ],
41
- "name": "param3"
42
- }
43
- ]
44
- },
45
- "defaults": {
46
- "param3": "hi"
47
- },
48
- "source": "class klass(Integer $param1, $param2, String $param3 = hi) inherits foo::bar {\n}"
49
- }
50
- ],
51
- "defined_types": [
52
- {
53
- "name": "dt",
54
- "file": "(stdin)",
55
- "line": 14,
56
- "docstring": {
57
- "text": "A simple defined type.",
58
- "tags": [
59
- {
60
- "tag_name": "param",
61
- "text": "First param.",
62
- "types": [
63
- "Integer"
64
- ],
65
- "name": "param1"
66
- },
67
- {
68
- "tag_name": "param",
69
- "text": "Second param.",
70
- "types": [
71
- "Any"
72
- ],
73
- "name": "param2"
74
- },
75
- {
76
- "tag_name": "param",
77
- "text": "Third param.",
78
- "types": [
79
- "String"
80
- ],
81
- "name": "param3"
82
- }
83
- ]
84
- },
85
- "defaults": {
86
- "param3": "hi"
87
- },
88
- "source": "define dt(Integer $param1, $param2, String $param3 = hi) {\n}"
89
- }
90
- ],
91
- "resource_types": [
92
- {
93
- "name": "apt_key",
94
- "file": "(stdin)",
95
- "line": 92,
96
- "docstring": {
97
- "text": "This type provides Puppet with the capabilities to manage GPG keys needed\nby apt to perform package validation. Apt has it's own GPG keyring that can\nbe manipulated through the `apt-key` command.\n**Autorequires**:\nIf Puppet is given the location of a key file which looks like an absolute\npath this type will autorequire that file.",
98
- "tags": [
99
- {
100
- "tag_name": "summary",
101
- "text": "Example resource type using the new API."
102
- },
103
- {
104
- "tag_name": "raise",
105
- "text": "SomeError"
106
- },
107
- {
108
- "tag_name": "example",
109
- "text": "apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F':\n source => 'http://apt.puppetlabs.com/pubkey.gpg'\n}",
110
- "name": "here's an example"
111
- }
112
- ]
113
- },
114
- "properties": [
115
- {
116
- "name": "ensure",
117
- "description": "Whether this apt key should be present or absent on the target system.",
118
- "data_type": "Enum[present, absent]"
119
- },
120
- {
121
- "name": "created",
122
- "description": "Date the key was created, in ISO format.",
123
- "data_type": "String"
124
- }
125
- ],
126
- "parameters": [
127
- {
128
- "name": "id",
129
- "description": "The ID of the key you want to manage.",
130
- "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/]]",
131
- "isnamevar": true
132
- }
133
- ]
134
- },
135
- {
136
- "name": "database",
137
- "file": "(stdin)",
138
- "line": 54,
139
- "docstring": {
140
- "text": "An example database server resource type."
141
- },
142
- "properties": [
143
- {
144
- "name": "ensure",
145
- "description": "What state the database should be in.",
146
- "values": [
147
- "present",
148
- "absent",
149
- "up",
150
- "down"
151
- ],
152
- "aliases": {
153
- "up": "present",
154
- "down": "absent"
155
- },
156
- "default": "up"
157
- },
158
- {
159
- "name": "file",
160
- "description": "The database file to use."
161
- },
162
- {
163
- "name": "log_level",
164
- "description": "The log level to use.",
165
- "values": [
166
- "debug",
167
- "warn",
168
- "error"
169
- ],
170
- "default": "warn"
171
- }
172
- ],
173
- "parameters": [
174
- {
175
- "name": "address",
176
- "description": "The database server name.",
177
- "isnamevar": true
178
- },
179
- {
180
- "name": "encryption_key",
181
- "description": "The encryption key to use."
182
- },
183
- {
184
- "name": "encrypt",
185
- "description": "Whether or not to encrypt the database.",
186
- "values": [
187
- "true",
188
- "false",
189
- "yes",
190
- "no"
191
- ],
192
- "default": "false"
193
- }
194
- ],
195
- "features": [
196
- {
197
- "name": "encryption",
198
- "description": "The provider supports encryption."
199
- }
200
- ]
201
- }
202
- ],
203
- "providers": [
204
- {
205
- "name": "linux",
206
- "type_name": "database",
207
- "file": "(stdin)",
208
- "line": 43,
209
- "docstring": {
210
- "text": "An example provider on Linux."
211
- },
212
- "confines": {
213
- "kernel": "Linux",
214
- "osfamily": "RedHat"
215
- },
216
- "features": [
217
- "implements_some_feature",
218
- "some_other_feature"
219
- ],
220
- "defaults": [
221
- [
222
- [
223
- "kernel",
224
- "Linux"
225
- ]
226
- ],
227
- [
228
- [
229
- "osfamily",
230
- "RedHat"
231
- ],
232
- [
233
- "operatingsystemmajrelease",
234
- "7"
235
- ]
236
- ]
237
- ],
238
- "commands": {
239
- "foo": "/usr/bin/foo"
240
- }
241
- }
242
- ],
243
- "puppet_functions": [
244
- {
245
- "name": "func",
246
- "file": "(stdin)",
247
- "line": 6,
248
- "type": "puppet",
249
- "signatures": [
250
- {
251
- "signature": "func(Integer $param1, Any $param2, String $param3 = hi)",
252
- "docstring": {
253
- "text": "A simple function.",
254
- "tags": [
255
- {
256
- "tag_name": "param",
257
- "text": "First param.",
258
- "types": [
259
- "Integer"
260
- ],
261
- "name": "param1"
262
- },
263
- {
264
- "tag_name": "param",
265
- "text": "Second param.",
266
- "types": [
267
- "Any"
268
- ],
269
- "name": "param2"
270
- },
271
- {
272
- "tag_name": "param",
273
- "text": "Third param.",
274
- "types": [
275
- "String"
276
- ],
277
- "name": "param3"
278
- },
279
- {
280
- "tag_name": "return",
281
- "text": "Returns nothing.",
282
- "types": [
283
- "Undef"
284
- ]
285
- }
286
- ]
287
- }
288
- }
289
- ],
290
- "docstring": {
291
- "text": "A simple function.",
292
- "tags": [
293
- {
294
- "tag_name": "param",
295
- "text": "First param.",
296
- "types": [
297
- "Integer"
298
- ],
299
- "name": "param1"
300
- },
301
- {
302
- "tag_name": "param",
303
- "text": "Second param.",
304
- "types": [
305
- "Any"
306
- ],
307
- "name": "param2"
308
- },
309
- {
310
- "tag_name": "param",
311
- "text": "Third param.",
312
- "types": [
313
- "String"
314
- ],
315
- "name": "param3"
316
- },
317
- {
318
- "tag_name": "return",
319
- "text": "Returns nothing.",
320
- "types": [
321
- "Undef"
322
- ]
323
- }
324
- ]
325
- },
326
- "defaults": {
327
- "param3": "hi"
328
- },
329
- "source": "function func(Integer $param1, $param2, String $param3 = hi) {\n}"
330
- },
331
- {
332
- "name": "func3x",
333
- "file": "(stdin)",
334
- "line": 1,
335
- "type": "ruby3x",
336
- "signatures": [
337
- {
338
- "signature": "func3x(String $first, Any $second)",
339
- "docstring": {
340
- "text": "An example 3.x function.",
341
- "tags": [
342
- {
343
- "tag_name": "param",
344
- "text": "The first parameter.",
345
- "types": [
346
- "String"
347
- ],
348
- "name": "first"
349
- },
350
- {
351
- "tag_name": "param",
352
- "text": "The second parameter.",
353
- "types": [
354
- "Any"
355
- ],
356
- "name": "second"
357
- },
358
- {
359
- "tag_name": "return",
360
- "text": "Returns nothing.",
361
- "types": [
362
- "Undef"
363
- ]
364
- }
365
- ]
366
- }
367
- }
368
- ],
369
- "docstring": {
370
- "text": "An example 3.x function.",
371
- "tags": [
372
- {
373
- "tag_name": "param",
374
- "text": "The first parameter.",
375
- "types": [
376
- "String"
377
- ],
378
- "name": "first"
379
- },
380
- {
381
- "tag_name": "param",
382
- "text": "The second parameter.",
383
- "types": [
384
- "Any"
385
- ],
386
- "name": "second"
387
- },
388
- {
389
- "tag_name": "return",
390
- "text": "Returns nothing.",
391
- "types": [
392
- "Undef"
393
- ]
394
- }
395
- ]
396
- },
397
- "source": "Puppet::Parser::Functions.newfunction(:func3x, doc: <<-DOC\nAn example 3.x function.\n@param [String] first The first parameter.\n@param second The second parameter.\n@return [Undef] Returns nothing.\nDOC\n) do |*args|\nend"
398
- },
399
- {
400
- "name": "func4x",
401
- "file": "(stdin)",
402
- "line": 11,
403
- "type": "ruby4x",
404
- "signatures": [
405
- {
406
- "signature": "func4x(Integer $param1, Any $param2, Optional[Array[String]] $param3)",
407
- "docstring": {
408
- "text": "The first overload.",
409
- "tags": [
410
- {
411
- "tag_name": "param",
412
- "text": "The first parameter.",
413
- "types": [
414
- "Integer"
415
- ],
416
- "name": "param1"
417
- },
418
- {
419
- "tag_name": "param",
420
- "text": "The second parameter.",
421
- "types": [
422
- "Any"
423
- ],
424
- "name": "param2"
425
- },
426
- {
427
- "tag_name": "param",
428
- "text": "The third parameter.",
429
- "types": [
430
- "Optional[Array[String]]"
431
- ],
432
- "name": "param3"
433
- },
434
- {
435
- "tag_name": "return",
436
- "text": "Returns nothing.",
437
- "types": [
438
- "Undef"
439
- ]
440
- }
441
- ]
442
- }
443
- },
444
- {
445
- "signature": "func4x(Boolean $param, Callable &$block)",
446
- "docstring": {
447
- "text": "",
448
- "tags": [
449
- {
450
- "tag_name": "param",
451
- "text": "The first parameter.",
452
- "types": [
453
- "Boolean"
454
- ],
455
- "name": "param"
456
- },
457
- {
458
- "tag_name": "param",
459
- "text": "The block parameter.",
460
- "types": [
461
- "Callable"
462
- ],
463
- "name": "&block"
464
- },
465
- {
466
- "tag_name": "return",
467
- "text": "Returns a string.",
468
- "types": [
469
- "String"
470
- ]
471
- }
472
- ]
473
- }
474
- }
475
- ],
476
- "docstring": {
477
- "text": "An example 4.x function.",
478
- "tags": [
479
- {
480
- "tag_name": "overload",
481
- "signature": "func4x(Integer $param1, Any $param2, Optional[Array[String]] $param3)",
482
- "docstring": {
483
- "text": "The first overload.",
484
- "tags": [
485
- {
486
- "tag_name": "param",
487
- "text": "The first parameter.",
488
- "types": [
489
- "Integer"
490
- ],
491
- "name": "param1"
492
- },
493
- {
494
- "tag_name": "param",
495
- "text": "The second parameter.",
496
- "types": [
497
- "Any"
498
- ],
499
- "name": "param2"
500
- },
501
- {
502
- "tag_name": "param",
503
- "text": "The third parameter.",
504
- "types": [
505
- "Optional[Array[String]]"
506
- ],
507
- "name": "param3"
508
- },
509
- {
510
- "tag_name": "return",
511
- "text": "Returns nothing.",
512
- "types": [
513
- "Undef"
514
- ]
515
- }
516
- ]
517
- },
518
- "name": "func4x"
519
- },
520
- {
521
- "tag_name": "overload",
522
- "signature": "func4x(Boolean $param, Callable &$block)",
523
- "docstring": {
524
- "text": "",
525
- "tags": [
526
- {
527
- "tag_name": "param",
528
- "text": "The first parameter.",
529
- "types": [
530
- "Boolean"
531
- ],
532
- "name": "param"
533
- },
534
- {
535
- "tag_name": "param",
536
- "text": "The block parameter.",
537
- "types": [
538
- "Callable"
539
- ],
540
- "name": "&block"
541
- },
542
- {
543
- "tag_name": "return",
544
- "text": "Returns a string.",
545
- "types": [
546
- "String"
547
- ]
548
- }
549
- ]
550
- },
551
- "name": "func4x"
552
- }
553
- ]
554
- },
555
- "source": "Puppet::Functions.create_function(:func4x) do\n # The first overload.\n # @param param1 The first parameter.\n # @param param2 The second parameter.\n # @param param3 The third parameter.\n # @return Returns nothing.\n dispatch :foo do\n param 'Integer', :param1\n param 'Any', :param2\n optional_param 'Array[String]', :param3\n return_type 'Undef'\n end\n\n # @param param The first parameter.\n # @param block The block parameter.\n # @return Returns a string.\n dispatch :other do\n param 'Boolean', :param\n block_param\n return_type 'String'\n end\nend"
556
- },
557
- {
558
- "name": "func4x_1",
559
- "file": "(stdin)",
560
- "line": 35,
561
- "type": "ruby4x",
562
- "signatures": [
563
- {
564
- "signature": "func4x_1(Integer $param1)",
565
- "docstring": {
566
- "text": "An example 4.x function with only one signature.",
567
- "tags": [
568
- {
569
- "tag_name": "param",
570
- "text": "The first parameter.",
571
- "types": [
572
- "Integer"
573
- ],
574
- "name": "param1"
575
- },
576
- {
577
- "tag_name": "return",
578
- "text": "Returns nothing.",
579
- "types": [
580
- "Undef"
581
- ]
582
- }
583
- ]
584
- }
585
- }
586
- ],
587
- "docstring": {
588
- "text": "An example 4.x function with only one signature.",
589
- "tags": [
590
- {
591
- "tag_name": "param",
592
- "text": "The first parameter.",
593
- "types": [
594
- "Integer"
595
- ],
596
- "name": "param1"
597
- },
598
- {
599
- "tag_name": "return",
600
- "text": "Returns nothing.",
601
- "types": [
602
- "Undef"
603
- ]
604
- }
605
- ]
606
- },
607
- "source": "Puppet::Functions.create_function(:func4x_1) do\n # @param param1 The first parameter.\n # @return [Undef] Returns nothing.\n dispatch :foobarbaz do\n param 'Integer', :param1\n end\nend"
608
- }
609
- ],
610
- "puppet_tasks": [
611
- {
612
- "name": "(stdin)",
613
- "file": "(stdin)",
614
- "line": 0,
615
- "docstring": {
616
- "text": "Allows you to backup your database to local file.",
617
- "tags": [
618
- {
619
- "name": "database",
620
- "tag_name": "param",
621
- "text": "Database to connect to",
622
- "types": [
623
- "Optional[String[1]]"
624
- ]
625
- },
626
- {
627
- "name": "user",
628
- "tag_name": "param",
629
- "text": "The user",
630
- "types": [
631
- "Optional[String[1]]"
632
- ]
633
- },
634
- {
635
- "name": "password",
636
- "tag_name": "param",
637
- "text": "The password",
638
- "types": [
639
- "Optional[String[1]]"
640
- ]
641
- },
642
- {
643
- "name": "sql",
644
- "tag_name": "param",
645
- "text": "Path to file you want backup to",
646
- "types": [
647
- "String[1]"
648
- ]
649
- }
650
- ]
651
- },
652
- "source": "{\n \"description\": \"Allows you to backup your database to local file.\",\n \"input_method\": \"stdin\",\n \"parameters\": {\n \"database\": {\n \"description\": \"Database to connect to\",\n \"type\": \"Optional[String[1]]\"\n },\n \"user\": {\n \"description\": \"The user\",\n \"type\": \"Optional[String[1]]\"\n },\n \"password\": {\n \"description\": \"The password\",\n \"type\": \"Optional[String[1]]\"\n },\n \"sql\": {\n \"description\": \"Path to file you want backup to\",\n \"type\": \"String[1]\"\n }\n }\n}\n",
653
- "supports_noop": false,
654
- "input_method": "stdin"
655
- }
656
- ],
657
- "puppet_plans": [
658
-
659
- ]
660
- }