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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9556dd124a1f5f4dfcaf4457232efbea310988d8
4
- data.tar.gz: 3ef01d946f16d66c1d3af2c32345a90364ef57c6
2
+ SHA256:
3
+ metadata.gz: 9aa1aa13861fd95a237ca2abd1ef890dfbcba1b7757c2dd609d648b803df7a33
4
+ data.tar.gz: 55d8b1903917fcd24fbb53dbe1433449a75eb88544071fdf0e2bf2d0eeb2fe11
5
5
  SHA512:
6
- metadata.gz: 516ae9d909f068fc6c25cbb0f8839b06a16509201bfb7081f0f9ee985088a740780495ce00d50ac5d1c12560ac6d35fad7d2234dc31fc206ad79aa3ce8d5ddbb
7
- data.tar.gz: eb5ec2204cac028fa9a27d7c5536694e3f07669d854e7323dba6d03d7cfeff369b92358ee19d4db9cb43fcc44df0f57540b1b41080eca6f1e21fc759e1c8d011
6
+ metadata.gz: 394ad674391503b4a894857035fbe190678bba4b264d6093935005b22322beda448fb38470ba92acedb191e1faec8dab01ccd0cc14ba807ca5b39cc6bff6b2fc
7
+ data.tar.gz: 420511c57607c8d76eb2d3e8b6417a84d3ac4247c3fc64ddd83a23fa50aba570b1e984e1a67a3c56c929c4ac8aeebf84726cd14e39ad689405ee8726281ae1dd
@@ -3,6 +3,91 @@
3
3
  All significant changes to this repo will be summarized in this file.
4
4
 
5
5
 
6
+ ## [v2.6.0](https://github.com/puppetlabs/puppet-strings/tree/v2.6.0) (2021-01-18)
7
+
8
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.5.0...v2.6.0)
9
+
10
+ Added
11
+
12
+ - Improved markdown templates [\#252](https://github.com/puppetlabs/puppet-strings/pull/252) ([kozl](https://github.com/kozl))
13
+
14
+ Fixed
15
+
16
+ - Do not fail in case return tag has no type specified [\#268](https://github.com/puppetlabs/puppet-strings/pull/268) ([tiandrey](https://github.com/tiandrey))
17
+ - Handle a missing description gracefully [\#260](https://github.com/puppetlabs/puppet-strings/pull/260) ([scotje](https://github.com/scotje))
18
+ - Fix ERB failure - parameters without descriptions [\#255](https://github.com/puppetlabs/puppet-strings/pull/255) ([trevor-vaughan](https://github.com/trevor-vaughan))
19
+ - puppet\_function template: fix tags, source [\#249](https://github.com/puppetlabs/puppet-strings/pull/249) ([raemer](https://github.com/raemer))
20
+
21
+ Changed
22
+
23
+ - \(MAINT\) Drop Ruby 2.1.x and Puppet 4.x compatibility [\#253](https://github.com/puppetlabs/puppet-strings/pull/253) ([scotje](https://github.com/scotje))
24
+
25
+ **Closed issues:**
26
+
27
+ - Tags \(Parameter, Returns\) not generated in HTML output [\#248](https://github.com/puppetlabs/puppet-strings/issues/248)
28
+ - Can we get 2.5.0 released please [\#244](https://github.com/puppetlabs/puppet-strings/issues/244)
29
+ - Add supported\_features to puppet strings input/output for types [\#228](https://github.com/puppetlabs/puppet-strings/issues/228)
30
+ - Provider attribute is missing in generated types documentation [\#227](https://github.com/puppetlabs/puppet-strings/issues/227)
31
+
32
+ ## [v2.5.0](https://github.com/puppetlabs/puppet-strings/tree/v2.5.0) (2020-07-16)
33
+
34
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.4.0...v2.5.0)
35
+
36
+ Added
37
+
38
+ - \(GH-225\) Document functions in Puppet Datatypes [\#235](https://github.com/puppetlabs/puppet-strings/pull/235) ([glennsarti](https://github.com/glennsarti))
39
+ - \(\#227\) Inject `provider` into params list for types with providers [\#231](https://github.com/puppetlabs/puppet-strings/pull/231) ([scotje](https://github.com/scotje))
40
+
41
+ Fixed
42
+
43
+ - \(\#242\) Wrap names in backticks when rendering to markdown [\#243](https://github.com/puppetlabs/puppet-strings/pull/243) ([scotje](https://github.com/scotje))
44
+ - Eliminate trailing spaces w/o descriptions [\#224](https://github.com/puppetlabs/puppet-strings/pull/224) ([binford2k](https://github.com/binford2k))
45
+
46
+ **Closed issues:**
47
+
48
+ - text rendering as emojis in strings generated docs [\#242](https://github.com/puppetlabs/puppet-strings/issues/242)
49
+ - Puppet Classes not Listed in Left Frame Contents [\#241](https://github.com/puppetlabs/puppet-strings/issues/241)
50
+ - exec type in generated docs missing attributes `creates`, `onlyif` [\#229](https://github.com/puppetlabs/puppet-strings/issues/229)
51
+ - \[Feature\] Document functions in Puppet Datatypes [\#225](https://github.com/puppetlabs/puppet-strings/issues/225)
52
+ - Document usage [\#8](https://github.com/puppetlabs/puppet-strings/issues/8)
53
+ - Need a search box on the main page [\#1](https://github.com/puppetlabs/puppet-strings/issues/1)
54
+
55
+ **Merged pull requests:**
56
+
57
+ - Release prep for v2.5.0 [\#245](https://github.com/puppetlabs/puppet-strings/pull/245) ([scotje](https://github.com/scotje))
58
+
59
+ ## [v2.4.0](https://github.com/puppetlabs/puppet-strings/tree/v2.4.0) (2020-02-20)
60
+
61
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.3.1...v2.4.0)
62
+
63
+ Added
64
+
65
+ - Add checks to resource\_type handler and code objects [\#232](https://github.com/puppetlabs/puppet-strings/pull/232) ([scotje](https://github.com/scotje))
66
+ - Add missing HTML output support for enum tag [\#218](https://github.com/puppetlabs/puppet-strings/pull/218) ([seanmil](https://github.com/seanmil))
67
+ - \(PDOC-295\) Add @enum tag support for Enum data types [\#215](https://github.com/puppetlabs/puppet-strings/pull/215) ([seanmil](https://github.com/seanmil))
68
+ - Expanded default search glob for plans. [\#214](https://github.com/puppetlabs/puppet-strings/pull/214) ([Raskil](https://github.com/Raskil))
69
+
70
+ **Merged pull requests:**
71
+
72
+ - \(MAINT\) Release prep for 2.4.0 [\#221](https://github.com/puppetlabs/puppet-strings/pull/221) ([scotje](https://github.com/scotje))
73
+
74
+ ## [v2.3.1](https://github.com/puppetlabs/puppet-strings/tree/v2.3.1) (2019-09-23)
75
+
76
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.3.0...v2.3.1)
77
+
78
+ Fixed
79
+
80
+ - \(maint\) Use parameters method instead of json\['parameters'\] [\#211](https://github.com/puppetlabs/puppet-strings/pull/211) ([lucywyman](https://github.com/lucywyman))
81
+ - \(PDOC-285\) Fix data\_type\_handler for errors and numbers [\#209](https://github.com/puppetlabs/puppet-strings/pull/209) ([glennsarti](https://github.com/glennsarti))
82
+
83
+ ## [v2.3.0](https://github.com/puppetlabs/puppet-strings/tree/v2.3.0) (2019-07-17)
84
+
85
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.2.0...v2.3.0)
86
+
87
+ Added
88
+
89
+ - Add Puppet Data Type documentation [\#199](https://github.com/puppetlabs/puppet-strings/pull/199) ([glennsarti](https://github.com/glennsarti))
90
+
6
91
  ## [v2.2.0](https://github.com/puppetlabs/puppet-strings/tree/v2.2.0) (2019-04-05)
7
92
 
8
93
  [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.1.0...v2.2.0)
@@ -16,6 +101,7 @@ Added
16
101
 
17
102
  Fixed
18
103
 
104
+ - \(PDOC-283\) Fix namespaced symbols [\#205](https://github.com/puppetlabs/puppet-strings/pull/205) ([glennsarti](https://github.com/glennsarti))
19
105
  - \(PDOC-266\) Silence 'unexpected construct regexp\_literal' warning [\#189](https://github.com/puppetlabs/puppet-strings/pull/189) ([seanmil](https://github.com/seanmil))
20
106
 
21
107
  ## [v2.1.0](https://github.com/puppetlabs/puppet-strings/tree/v2.1.0) (2018-06-26)
@@ -251,4 +337,4 @@ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with t
251
337
  - Strings will no longer crash when documenting 3x functions with less than two arguments passed into newfunction **(PDOC-27)**
252
338
 
253
339
 
254
- \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
340
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
@@ -7,13 +7,44 @@ that we can have a chance of keeping on top of things.
7
7
 
8
8
  ## Getting Started
9
9
 
10
- * Make sure you have a [Jira account](http://tickets.puppetlabs.com)
11
10
  * Make sure you have a [GitHub account](https://github.com/signup/free)
12
11
  * Submit a ticket for your issue, assuming one does not already exist.
13
12
  * Clearly describe the issue including steps to reproduce when it is a bug.
14
13
  * Make sure you fill in the earliest version that you know has the issue.
15
14
  * Fork the repository on GitHub
16
15
 
16
+ ## Submit an issue
17
+
18
+ We use GitHub Issues for issue tracking on puppet-strings.
19
+
20
+ Before you submit your issue, take a minute to...
21
+
22
+ 1. **Use the GitHub issue search** — check if the issue has already been
23
+ reported.
24
+
25
+ 2. **Check if the issue has been fixed** — try to reproduce it using the
26
+ latest `master` or release tag.
27
+
28
+ A good bug report shouldn't leave others needing to chase you up for more
29
+ information. Please try to be as **detailed as possible** in your issue. What is
30
+ your environment? What steps will reproduce the issue?
31
+
32
+ Example:
33
+
34
+ > Short and descriptive example issue title
35
+ >
36
+ > A summary of the issue with details about the environment it occurs in (Ruby version, Puppet version, Strings version, etc). If
37
+ > suitable, include the steps required to reproduce the bug.
38
+ >
39
+ > 1. This is the first step
40
+ > 2. This is the second step
41
+ > 3. Further steps, etc.
42
+ >
43
+ > Any other information you want to share that is relevant to the issue being
44
+ > reported. This might include the lines of code that you have identified as
45
+ > causing the bug, and potential solutions (and your opinions on their
46
+ > merits).
47
+
17
48
  ## Making Changes
18
49
 
19
50
  * Create a topic branch from where you want to base your work.
@@ -98,7 +129,6 @@ To cut a new release, from a current `master` checkout:
98
129
  # Additional Resources
99
130
 
100
131
  * [More information on contributing](http://links.puppet.com/contribute-to-puppet)
101
- * [Bug tracker (Jira)](http://tickets.puppet.com)
102
132
  * [Contributor License Agreement](http://links.puppet.com/cla)
103
133
  * [General GitHub documentation](http://help.github.com/)
104
134
  * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
data/README.md CHANGED
@@ -8,36 +8,43 @@ Puppet Strings generates documentation for Puppet code and extensions written in
8
8
  | | |
9
9
  | -------------- |---------------------------------------------------------------- |
10
10
  | *Code* | [GitHub][repo] |
11
- | *Issues* | [Puppet JIRA Tracker][JIRA] |
11
+ | *Issues* | [GitHub issues][issues] |
12
12
  | *License* | [Apache 2.0][LICENSE] |
13
13
  | *Change log* | [CHANGELOG.md][changelog] |
14
14
  | *Contributing* | [CONTRIBUTING.md][contributing] and [COMMITTERS.md][committers] |
15
15
 
16
- [repo]: https://github.com/puppetlabs/puppet-strings
17
- [JIRA]: https://tickets.puppetlabs.com/browse/PDOC
18
- [LICENSE]: https://github.com/puppetlabs/puppet-strings/blob/master/LICENSE
19
- [changelog]: https://github.com/puppetlabs/puppet-strings/blob/master/CHANGELOG.md
20
- [contributing]: https://github.com/puppetlabs/puppet-strings/blob/master/CONTRIBUTING.md
21
- [committers]: https://github.com/puppetlabs/puppet-strings/blob/master/COMMITTERS.md
22
-
23
16
  ## Installing Puppet Strings
24
17
 
25
18
  ### Requirements
26
19
 
27
20
  * Ruby 2.1.9 or newer
28
- * Puppet 4.0 or newer
29
- * The `yard` Ruby gem
21
+ * Puppet 4.0.0 or newer
30
22
 
31
23
  ### Install Puppet Strings
32
24
 
33
- 1. Install the YARD gem by running `gem install yard`
34
- 1. Install the `puppet-strings` gem by running `gem install puppet-strings`
35
- 1. **Optional**: Set YARD options for Strings
25
+ Installation instructions vary slightly depending on how you have installed Puppet:
26
+
27
+ #### Installing Puppet Strings with [`puppet-agent`](https://puppet.com/docs/puppet/6.4/about_agent.html#what-puppet-agent-and-puppetserver-are) package
28
+
29
+ Install the `puppet-strings` gem into the `puppet-agent` environment:
30
+
31
+ ```
32
+ sudo /opt/puppetlabs/puppet/bin/gem install puppet-strings
33
+ ```
34
+
35
+ #### Installing Puppet Strings with standalone `puppet` gem
36
36
 
37
- To use YARD options with Puppet Strings, specify a `yardopts` file in the same directory in which you run `puppet strings`. Puppet Strings supports the Markdown format and automatically sets the YARD `markup` option to `markdown`.
37
+ Install the `puppet-strings` gem into the same Ruby installation where you have installed the `puppet` gem:
38
38
 
39
- To see a list of available YARD options, run `yard help doc`. For details about YARD options configuration, see the [YARD docs](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#config).
39
+ ```
40
+ gem install puppet-strings
41
+ ```
40
42
 
43
+ ### Configure Puppet Strings (Optional)
44
+
45
+ To use YARD options with Puppet Strings, specify a `.yardopts` file in the same directory in which you run `puppet strings`. Puppet Strings supports the Markdown format and automatically sets the YARD `markup` option to `markdown`.
46
+
47
+ To see a list of available YARD options, run `yard help doc`. For details about YARD options configuration, see the [YARD docs](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#config).
41
48
 
42
49
  ## Generating documentation with Puppet Strings
43
50
 
@@ -74,12 +81,69 @@ To run specs, run the `spec` rake task:
74
81
  $ bundle install --path .bundle/gems
75
82
  $ bundle exec rake spec
76
83
 
84
+ ### Running Acceptance Tests
85
+
86
+ We are experimenting with a new tool for running acceptance tests. It's name is [puppet_litmus](https://github.com/puppetlabs/puppet_litmus) and replaces beaker as the test runner.
87
+
88
+ An example of running the acceptance tests locally with Docker:
89
+
90
+ 1. Ensure [Docker](https://www.docker.com/products/docker-desktop) is installed and running.
91
+
92
+ 2. Install Ruby gems. This step can be skipped if you have already followed the [Running Specs](#running-specs) instructions
93
+
94
+ ``` text
95
+ $ bundle install --path .bundle/gems
96
+ ```
97
+
98
+ 3. Provision a docker container, in this case CentOS 7
99
+
100
+ ``` text
101
+ $ bundle exec rake litmus:provision[docker, centos:7]
102
+ ```
103
+
104
+ 4. Install test items; Puppet Agent, our test module, and the puppet-strings gem built from this source code
105
+
106
+ ``` text
107
+ $ bundle exec rake litmus:install_agent[puppet6]
108
+ $ bundle exec rake litmus:install_module_fixtures
109
+ $ bundle exec rake litmus:install_gems
110
+ ```
111
+
112
+ 5. Run the acceptance tests. These tests can be run more than once without the need to run the provisioning steps again
113
+
114
+ ``` text
115
+ $ bundle exec rake litmus:acceptance:parallel
116
+ ```
117
+
118
+ 6. Remove any test containers
119
+
120
+ ``` text
121
+ $ bundle exec rake litmus:tear_down
122
+ ```
123
+
124
+ The [Litmus Wiki](https://github.com/puppetlabs/puppet_litmus/wiki) contains more indepth information about Litmus. There is also a tutorial on using Litmus with an example [Puppet Module](https://github.com/puppetlabs/puppet_litmus/wiki/Tutorial:-use-Litmus-to-execute-acceptance-tests-with-a-sample-module-(MoTD)#install-the-necessary-gems-for-the-module)
125
+
126
+
127
+ An example of run the acceptance tests follow the instructions [here].
128
+
77
129
  ## Support
78
130
 
79
- Please log tickets and issues in our [JIRA tracker][JIRA]. A [mailing list](https://groups.google.com/forum/?fromgroups#!forum/puppet-users) is available for asking questions and getting help from others.
131
+ Please log issues in [GitHub issues][issues]. Check out [CONTRIBUTING.md][contributing] for tips on writing _the best_ issues.
80
132
 
81
- There is also an active #puppet channel on the Freenode IRC network.
133
+ A [mailing list](https://groups.google.com/forum/?fromgroups#!forum/puppet-users) is available for asking questions and getting help from others.
134
+
135
+ There is also an active community on the [Puppet community Slack][] in the #forge-modules channel.
82
136
 
83
137
  We use semantic version numbers for our releases and recommend that users upgrade to patch releases and minor releases as they become available.
84
138
 
85
139
  Bug fixes and ongoing development will occur in minor releases for the current major version. Security fixes will be ported to a previous major version on a best-effort basis, until the previous major version is no longer maintained.
140
+
141
+
142
+ [repo]: https://github.com/puppetlabs/puppet-strings
143
+ [issues]: https://github.com/puppetlabs/puppet-strings/issues
144
+ [LICENSE]: https://github.com/puppetlabs/puppet-strings/blob/master/LICENSE
145
+ [changelog]: https://github.com/puppetlabs/puppet-strings/blob/master/CHANGELOG.md
146
+ [contributing]: https://github.com/puppetlabs/puppet-strings/blob/master/CONTRIBUTING.md
147
+ [committers]: https://github.com/puppetlabs/puppet-strings/blob/master/COMMITTERS.md
148
+ [Puppet community Slack]: https://slack.puppet.com
149
+
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # The root module for Puppet Strings.
2
4
  module PuppetStrings
3
5
  # The glob patterns used to search for files to document.
@@ -7,7 +9,7 @@ module PuppetStrings
7
9
  types/**/*.pp
8
10
  lib/**/*.rb
9
11
  tasks/*.json
10
- plans/*.pp
12
+ plans/**/*.pp
11
13
  ).freeze
12
14
 
13
15
  # Generates documentation.
@@ -27,8 +29,9 @@ module PuppetStrings
27
29
 
28
30
  # Format the arguments to YARD
29
31
  args = ['doc']
32
+ args << '--no-progress'
30
33
  args << '--debug' if options[:debug]
31
- args << '--backtrace' if options[:backtrace]
34
+ args << '--backtrace' if options[:debug]
32
35
  args << "-m#{options[:markup] || 'markdown'}"
33
36
 
34
37
  file = nil
@@ -42,7 +45,6 @@ module PuppetStrings
42
45
  args << '-n'
43
46
  args << '-q' unless file
44
47
  args << '--no-stats' unless file
45
- args << '--no-progress' unless file
46
48
  end
47
49
 
48
50
  yard_args = options[:yard_args]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require 'puppet-strings/json'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
 
3
5
  # The module for JSON related functionality.
@@ -8,6 +10,8 @@ module PuppetStrings::Json
8
10
  def self.render(file = nil)
9
11
  document = {
10
12
  puppet_classes: YARD::Registry.all(:puppet_class).sort_by!(&:name).map!(&:to_hash),
13
+ data_types: YARD::Registry.all(:puppet_data_type).sort_by!(&:name).map!(&:to_hash),
14
+ data_type_aliases: YARD::Registry.all(:puppet_data_type_alias).sort_by!(&:name).map!(&:to_hash),
11
15
  defined_types: YARD::Registry.all(:puppet_defined_type).sort_by!(&:name).map!(&:to_hash),
12
16
  resource_types: YARD::Registry.all(:puppet_type).sort_by!(&:name).map!(&:to_hash),
13
17
  providers: YARD::Registry.all(:puppet_provider).sort_by!(&:name).map!(&:to_hash),
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/json'
2
4
 
3
5
  # module for parsing Yard Registries and generating markdown
@@ -5,6 +7,7 @@ module PuppetStrings::Markdown
5
7
  require_relative 'markdown/puppet_classes'
6
8
  require_relative 'markdown/functions'
7
9
  require_relative 'markdown/defined_types'
10
+ require_relative 'markdown/data_types'
8
11
  require_relative 'markdown/resource_types'
9
12
  require_relative 'markdown/puppet_tasks'
10
13
  require_relative 'markdown/puppet_plans'
@@ -13,15 +16,16 @@ module PuppetStrings::Markdown
13
16
  # generates markdown documentation
14
17
  # @return [String] markdown doc
15
18
  def self.generate
16
- final = "# Reference\n"
17
- final << "<!-- DO NOT EDIT: This document was generated by Puppet Strings -->\n\n"
18
- final << PuppetStrings::Markdown::TableOfContents.render
19
- final << PuppetStrings::Markdown::PuppetClasses.render
20
- final << PuppetStrings::Markdown::DefinedTypes.render
21
- final << PuppetStrings::Markdown::ResourceTypes.render
22
- final << PuppetStrings::Markdown::Functions.render
23
- final << PuppetStrings::Markdown::PuppetTasks.render
24
- final << PuppetStrings::Markdown::PuppetPlans.render
19
+ final = "# Reference\n\n"
20
+ final += "<!-- DO NOT EDIT: This document was generated by Puppet Strings -->\n\n"
21
+ final += PuppetStrings::Markdown::TableOfContents.render
22
+ final += PuppetStrings::Markdown::PuppetClasses.render
23
+ final += PuppetStrings::Markdown::DefinedTypes.render
24
+ final += PuppetStrings::Markdown::ResourceTypes.render
25
+ final += PuppetStrings::Markdown::Functions.render
26
+ final += PuppetStrings::Markdown::DataTypes.render
27
+ final += PuppetStrings::Markdown::PuppetTasks.render
28
+ final += PuppetStrings::Markdown::PuppetPlans.render
25
29
 
26
30
  final
27
31
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings'
2
4
  require 'puppet-strings/json'
3
5
  require 'puppet-strings/yard'
@@ -68,7 +70,7 @@ module PuppetStrings::Markdown
68
70
 
69
71
  # @return [String] top-level name
70
72
  def name
71
- @registry[:name].to_s unless @registry[:name].nil?
73
+ @registry[:name]&.to_s
72
74
  end
73
75
 
74
76
  # @return [String] 'Overview' text (untagged text)
@@ -111,6 +113,11 @@ module PuppetStrings::Markdown
111
113
  select_tags('option')
112
114
  end
113
115
 
116
+ # @return [Array] enum tag hashes
117
+ def enums
118
+ select_tags('enum')
119
+ end
120
+
114
121
  # @param parameter_name
115
122
  # parameter name to match to option tags
116
123
  # @return [Array] option tag hashes that have a parent parameter_name
@@ -119,6 +126,14 @@ module PuppetStrings::Markdown
119
126
  opts_for_p unless opts_for_p.nil? || opts_for_p.length.zero?
120
127
  end
121
128
 
129
+ # @param parameter_name
130
+ # parameter name to match to enum tags
131
+ # @return [Array] enum tag hashes that have a parent parameter_name
132
+ def enums_for_param(parameter_name)
133
+ enums_for_p = enums.select { |e| e[:parent] == parameter_name } unless enums.nil?
134
+ enums_for_p unless enums_for_p.nil? || enums_for_p.length.zero?
135
+ end
136
+
122
137
  # @return [Hash] any defaults found for the component
123
138
  def defaults
124
139
  @registry[:defaults] unless @registry[:defaults].nil?
@@ -156,10 +171,22 @@ module PuppetStrings::Markdown
156
171
  @tags.any? { |tag| tag[:tag_name] == 'api' && tag[:text] == 'private' }
157
172
  end
158
173
 
174
+ def word_wrap(text, line_width: 120, break_sequence: "\n")
175
+ return unless text
176
+
177
+ text.split("\n").collect! do |line|
178
+ line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1#{break_sequence}").strip : line
179
+ end * break_sequence
180
+ end
181
+
159
182
  # @return [String] full markdown rendering of a component
160
183
  def render(template)
161
- file = File.join(File.dirname(__FILE__),"templates/#{template}")
162
- ERB.new(File.read(file), nil, '-').result(binding)
184
+ begin
185
+ file = File.join(File.dirname(__FILE__),"templates/#{template}")
186
+ ERB.new(File.read(file), nil, '-').result(binding)
187
+ rescue StandardError => e
188
+ fail "Processing #{@registry[:file]}:#{@registry[:line]} with #{file} => #{e}"
189
+ end
163
190
  end
164
191
 
165
192
  private