puppet-strings 2.4.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +97 -5
  3. data/COMMITTERS.md +17 -17
  4. data/CONTRIBUTING.md +6 -6
  5. data/README.md +10 -10
  6. data/lib/puppet-strings.rb +4 -2
  7. data/lib/puppet-strings/describe.rb +2 -0
  8. data/lib/puppet-strings/json.rb +2 -0
  9. data/lib/puppet-strings/markdown.rb +12 -10
  10. data/lib/puppet-strings/markdown/base.rb +17 -3
  11. data/lib/puppet-strings/markdown/data_type.rb +18 -0
  12. data/lib/puppet-strings/markdown/data_types.rb +3 -1
  13. data/lib/puppet-strings/markdown/defined_type.rb +2 -0
  14. data/lib/puppet-strings/markdown/defined_types.rb +3 -1
  15. data/lib/puppet-strings/markdown/function.rb +9 -7
  16. data/lib/puppet-strings/markdown/functions.rb +3 -1
  17. data/lib/puppet-strings/markdown/puppet_class.rb +2 -0
  18. data/lib/puppet-strings/markdown/puppet_classes.rb +3 -1
  19. data/lib/puppet-strings/markdown/puppet_plan.rb +2 -0
  20. data/lib/puppet-strings/markdown/puppet_plans.rb +3 -1
  21. data/lib/puppet-strings/markdown/puppet_task.rb +2 -0
  22. data/lib/puppet-strings/markdown/puppet_tasks.rb +3 -1
  23. data/lib/puppet-strings/markdown/resource_type.rb +21 -2
  24. data/lib/puppet-strings/markdown/resource_types.rb +3 -1
  25. data/lib/puppet-strings/markdown/table_of_contents.rb +3 -1
  26. data/lib/puppet-strings/markdown/templates/classes_and_defines.erb +10 -6
  27. data/lib/puppet-strings/markdown/templates/data_type.erb +22 -7
  28. data/lib/puppet-strings/markdown/templates/data_type_function.erb +67 -0
  29. data/lib/puppet-strings/markdown/templates/function.erb +2 -1
  30. data/lib/puppet-strings/markdown/templates/puppet_task.erb +1 -1
  31. data/lib/puppet-strings/markdown/templates/resource_type.erb +19 -13
  32. data/lib/puppet-strings/markdown/templates/table_of_contents.erb +6 -6
  33. data/lib/puppet-strings/monkey_patches/display_object_command.rb +2 -0
  34. data/lib/puppet-strings/tasks.rb +2 -0
  35. data/lib/puppet-strings/tasks/generate.rb +2 -0
  36. data/lib/puppet-strings/tasks/gh_pages.rb +3 -0
  37. data/lib/puppet-strings/version.rb +3 -1
  38. data/lib/puppet-strings/yard.rb +3 -0
  39. data/lib/puppet-strings/yard/code_objects.rb +2 -0
  40. data/lib/puppet-strings/yard/code_objects/base.rb +2 -0
  41. data/lib/puppet-strings/yard/code_objects/class.rb +4 -2
  42. data/lib/puppet-strings/yard/code_objects/data_type.rb +30 -8
  43. data/lib/puppet-strings/yard/code_objects/data_type_alias.rb +2 -0
  44. data/lib/puppet-strings/yard/code_objects/defined_type.rb +4 -2
  45. data/lib/puppet-strings/yard/code_objects/function.rb +6 -3
  46. data/lib/puppet-strings/yard/code_objects/group.rb +3 -0
  47. data/lib/puppet-strings/yard/code_objects/plan.rb +4 -2
  48. data/lib/puppet-strings/yard/code_objects/provider.rb +6 -0
  49. data/lib/puppet-strings/yard/code_objects/task.rb +2 -0
  50. data/lib/puppet-strings/yard/code_objects/type.rb +50 -5
  51. data/lib/puppet-strings/yard/handlers.rb +2 -0
  52. data/lib/puppet-strings/yard/handlers/helpers.rb +2 -0
  53. data/lib/puppet-strings/yard/handlers/json/base.rb +2 -0
  54. data/lib/puppet-strings/yard/handlers/json/task_handler.rb +2 -0
  55. data/lib/puppet-strings/yard/handlers/puppet/base.rb +3 -0
  56. data/lib/puppet-strings/yard/handlers/puppet/class_handler.rb +2 -0
  57. data/lib/puppet-strings/yard/handlers/puppet/data_type_alias_handler.rb +2 -0
  58. data/lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb +2 -0
  59. data/lib/puppet-strings/yard/handlers/puppet/function_handler.rb +3 -1
  60. data/lib/puppet-strings/yard/handlers/puppet/plan_handler.rb +2 -0
  61. data/lib/puppet-strings/yard/handlers/ruby/base.rb +5 -0
  62. data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +223 -60
  63. data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +9 -7
  64. data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +13 -0
  65. data/lib/puppet-strings/yard/handlers/ruby/rsapi_handler.rb +4 -1
  66. data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +20 -6
  67. data/lib/puppet-strings/yard/handlers/ruby/type_extras_handler.rb +16 -6
  68. data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +18 -1
  69. data/lib/puppet-strings/yard/parsers.rb +2 -0
  70. data/lib/puppet-strings/yard/parsers/json/parser.rb +2 -0
  71. data/lib/puppet-strings/yard/parsers/json/task_statement.rb +2 -0
  72. data/lib/puppet-strings/yard/parsers/puppet/parser.rb +18 -14
  73. data/lib/puppet-strings/yard/parsers/puppet/statement.rb +4 -0
  74. data/lib/puppet-strings/yard/tags.rb +2 -0
  75. data/lib/puppet-strings/yard/tags/enum_tag.rb +2 -0
  76. data/lib/puppet-strings/yard/tags/factory.rb +2 -0
  77. data/lib/puppet-strings/yard/tags/overload_tag.rb +4 -1
  78. data/lib/puppet-strings/yard/tags/parameter_directive.rb +5 -4
  79. data/lib/puppet-strings/yard/tags/property_directive.rb +5 -4
  80. data/lib/puppet-strings/yard/tags/summary_tag.rb +2 -0
  81. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/method_details_list.erb +6 -0
  82. data/lib/puppet-strings/yard/templates/default/puppet_data_type/html/setup.rb +9 -1
  83. data/lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb +1 -1
  84. data/lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb +3 -1
  85. data/lib/puppet-strings/yard/util.rb +4 -1
  86. data/lib/puppet/application/strings.rb +2 -0
  87. data/lib/puppet/face/strings.rb +4 -1
  88. data/lib/puppet/feature/rgen.rb +2 -0
  89. data/lib/puppet/feature/yard.rb +2 -0
  90. metadata +11 -52
  91. data/CODEOWNERS +0 -1
  92. data/Gemfile +0 -53
  93. data/HISTORY.md +0 -218
  94. data/JSON.md +0 -832
  95. data/Rakefile +0 -160
  96. data/codecov.yml +0 -3
  97. data/misc/ANNOUNCEMENT_TEMPLATE.md +0 -40
  98. data/spec/acceptance/emit_json_options_spec.rb +0 -69
  99. data/spec/acceptance/generate_markdown_spec.rb +0 -47
  100. data/spec/acceptance/running_strings_generate_spec.rb +0 -88
  101. data/spec/fixtures/acceptance/modules/test/functions/add.pp +0 -9
  102. data/spec/fixtures/acceptance/modules/test/lib/puppet/functions/4x_function.rb +0 -5
  103. data/spec/fixtures/acceptance/modules/test/lib/puppet/parser/functions/function3x.rb +0 -2
  104. data/spec/fixtures/acceptance/modules/test/lib/puppet/provider/server/linux.rb +0 -9
  105. data/spec/fixtures/acceptance/modules/test/lib/puppet/type/database.rb +0 -15
  106. data/spec/fixtures/acceptance/modules/test/manifests/init.pp +0 -31
  107. data/spec/fixtures/acceptance/modules/test/manifests/triple_nested_classes.pp +0 -27
  108. data/spec/fixtures/acceptance/modules/test/metadata.json +0 -10
  109. data/spec/fixtures/acceptance/modules/test/types/elephant.pp +0 -2
  110. data/spec/fixtures/unit/markdown/output.md +0 -561
  111. data/spec/fixtures/unit/markdown/output_with_data_types.md +0 -606
  112. data/spec/fixtures/unit/markdown/output_with_plan.md +0 -595
  113. data/spec/spec_helper.rb +0 -49
  114. data/spec/spec_helper_acceptance.rb +0 -58
  115. data/spec/spec_helper_acceptance_local.rb +0 -10
  116. data/spec/unit/puppet-strings/describe_spec.rb +0 -141
  117. data/spec/unit/puppet-strings/json_spec.rb +0 -302
  118. data/spec/unit/puppet-strings/markdown/base_spec.rb +0 -146
  119. data/spec/unit/puppet-strings/markdown_spec.rb +0 -374
  120. data/spec/unit/puppet-strings/yard/code_objects/task_spec.rb +0 -92
  121. data/spec/unit/puppet-strings/yard/handlers/json/task_handler_spec.rb +0 -116
  122. data/spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb +0 -217
  123. data/spec/unit/puppet-strings/yard/handlers/puppet/data_type_alias_handler_spec.rb +0 -65
  124. data/spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb +0 -231
  125. data/spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb +0 -315
  126. data/spec/unit/puppet-strings/yard/handlers/ruby/data_type_handler_spec.rb +0 -309
  127. data/spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb +0 -746
  128. data/spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb +0 -158
  129. data/spec/unit/puppet-strings/yard/handlers/ruby/rsapi_handler_spec.rb +0 -235
  130. data/spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb +0 -311
  131. data/spec/unit/puppet-strings/yard/parsers/json/parser_spec.rb +0 -72
  132. data/spec/unit/puppet-strings/yard/parsers/json/task_statement_spec.rb +0 -56
  133. data/spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb +0 -251
  134. data/spec/unit/puppet-strings/yard/util_spec.rb +0 -48
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bfc095b6c7aa9124cfa44c79aa0404361fbe9b3971e58495aa8354f1b84163a
4
- data.tar.gz: 56c425e69b8bd4b1e9c6a0bb07a25ca806d880e6e9a865afa8137d12b5412442
3
+ metadata.gz: a2d5345c5e091cd9e41b404f7529168e8e10b737d26b3b1b9a5a5bfbf118e062
4
+ data.tar.gz: 0bddf9dac1b890e8b487e261fd5eec2b3df45eecbc400af22602c1aac29aa99e
5
5
  SHA512:
6
- metadata.gz: 0a0fcbc8af4653fb35166cad42488f21bf5f046092ef1434331c7d4ba03fa4ac2544c3e220859c9dc2de94b4a263caed7b35a6185df297bf6dbb631553601f9d
7
- data.tar.gz: 7cf9f63f1fd50af678f4b3891ed7ac9da3d5eda249de6df50dd10ac93eed078f1f7fab6b5ca6945e6e057e89ce55c227b4aba1aab84884e6d89b1f039677ed38
6
+ metadata.gz: 6399094f9117b6966c7b91f4ec6438f6877faf0b25ab7f2b322957f1cf81719ddae70357d32d252a7276f9795f9bce6305b8c999f1f853ec83dbd35131030d99
7
+ data.tar.gz: faef11c0d37eb368b8e36a6bc7743669a7ad184893c969317434711ae13e6513e033393eb9b64e33f6d6e16f9bd0ff46dc4a784ba0ec574d398896c5b2dea095
data/CHANGELOG.md CHANGED
@@ -3,7 +3,95 @@
3
3
  All significant changes to this repo will be summarized in this file.
4
4
 
5
5
 
6
- ## [v2.4.0](https://github.com/puppetlabs/puppet-strings/tree/v2.4.0) (2020-02-18)
6
+ ## [v2.8.0](https://github.com/puppetlabs/puppet-strings/tree/v2.8.0) (2021-07-19)
7
+
8
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.7.0...v2.8.0)
9
+
10
+ Added
11
+
12
+ - \(DOCUMENT-1232\) Add support for ensurable in types\_extras\_handler [\#281](https://github.com/puppetlabs/puppet-strings/pull/281) ([joshcooper](https://github.com/joshcooper))
13
+
14
+ **Merged pull requests:**
15
+
16
+ - \(FIXUP\) Check for nil before injecting provider param into Types [\#285](https://github.com/puppetlabs/puppet-strings/pull/285) ([scotje](https://github.com/scotje))
17
+ - README.md: update link to docs [\#276](https://github.com/puppetlabs/puppet-strings/pull/276) ([kenyon](https://github.com/kenyon))
18
+
19
+ ## [v2.7.0](https://github.com/puppetlabs/puppet-strings/tree/v2.7.0) (2021-05-17)
20
+
21
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.6.0...v2.7.0)
22
+
23
+ Added
24
+
25
+ - Add supported\_features to puppet strings input/output for types [\#228](https://github.com/puppetlabs/puppet-strings/issues/228)
26
+
27
+ Fixed
28
+
29
+ - `file` type is missing `ensure` in generated reference docs [\#230](https://github.com/puppetlabs/puppet-strings/issues/230)
30
+
31
+ **Closed issues:**
32
+
33
+ - class with "apply" attribute causes parser error [\#251](https://github.com/puppetlabs/puppet-strings/issues/251)
34
+
35
+ **Merged pull requests:**
36
+
37
+ - Update CODEOWNERS [\#272](https://github.com/puppetlabs/puppet-strings/pull/272) ([binford2k](https://github.com/binford2k))
38
+ - Only set tasks = true when parsing plans. [\#266](https://github.com/puppetlabs/puppet-strings/pull/266) ([binford2k](https://github.com/binford2k))
39
+
40
+ ## [v2.6.0](https://github.com/puppetlabs/puppet-strings/tree/v2.6.0) (2021-01-18)
41
+
42
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.5.0...v2.6.0)
43
+
44
+ Added
45
+
46
+ - Improved markdown templates [\#252](https://github.com/puppetlabs/puppet-strings/pull/252) ([kozl](https://github.com/kozl))
47
+
48
+ Fixed
49
+
50
+ - 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))
51
+ - Handle a missing description gracefully [\#260](https://github.com/puppetlabs/puppet-strings/pull/260) ([scotje](https://github.com/scotje))
52
+ - Fix ERB failure - parameters without descriptions [\#255](https://github.com/puppetlabs/puppet-strings/pull/255) ([trevor-vaughan](https://github.com/trevor-vaughan))
53
+ - puppet\_function template: fix tags, source [\#249](https://github.com/puppetlabs/puppet-strings/pull/249) ([raemer](https://github.com/raemer))
54
+ - Handle a missing description gracefully [\#246](https://github.com/puppetlabs/puppet-strings/pull/246) ([ekohl](https://github.com/ekohl))
55
+
56
+ Changed
57
+
58
+ - \(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))
59
+
60
+ **Closed issues:**
61
+
62
+ - Tags \(Parameter, Returns\) not generated in HTML output [\#248](https://github.com/puppetlabs/puppet-strings/issues/248)
63
+ - Can we get 2.5.0 released please [\#244](https://github.com/puppetlabs/puppet-strings/issues/244)
64
+ - Provider attribute is missing in generated types documentation [\#227](https://github.com/puppetlabs/puppet-strings/issues/227)
65
+
66
+ ## [v2.5.0](https://github.com/puppetlabs/puppet-strings/tree/v2.5.0) (2020-07-16)
67
+
68
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.4.0...v2.5.0)
69
+
70
+ Added
71
+
72
+ - \(GH-225\) Document functions in Puppet Datatypes [\#235](https://github.com/puppetlabs/puppet-strings/pull/235) ([glennsarti](https://github.com/glennsarti))
73
+ - Add checks to resource\_type handler and code objects [\#232](https://github.com/puppetlabs/puppet-strings/pull/232) ([scotje](https://github.com/scotje))
74
+ - \(\#227\) Inject `provider` into params list for types with providers [\#231](https://github.com/puppetlabs/puppet-strings/pull/231) ([scotje](https://github.com/scotje))
75
+
76
+ Fixed
77
+
78
+ - \(\#242\) Wrap names in backticks when rendering to markdown [\#243](https://github.com/puppetlabs/puppet-strings/pull/243) ([scotje](https://github.com/scotje))
79
+ - Eliminate trailing spaces w/o descriptions [\#224](https://github.com/puppetlabs/puppet-strings/pull/224) ([binford2k](https://github.com/binford2k))
80
+
81
+ **Closed issues:**
82
+
83
+ - text rendering as emojis in strings generated docs [\#242](https://github.com/puppetlabs/puppet-strings/issues/242)
84
+ - Puppet Classes not Listed in Left Frame Contents [\#241](https://github.com/puppetlabs/puppet-strings/issues/241)
85
+ - exec type in generated docs missing attributes `creates`, `onlyif` [\#229](https://github.com/puppetlabs/puppet-strings/issues/229)
86
+ - \[Feature\] Document functions in Puppet Datatypes [\#225](https://github.com/puppetlabs/puppet-strings/issues/225)
87
+ - Document usage [\#8](https://github.com/puppetlabs/puppet-strings/issues/8)
88
+ - Need a search box on the main page [\#1](https://github.com/puppetlabs/puppet-strings/issues/1)
89
+
90
+ **Merged pull requests:**
91
+
92
+ - Release prep for v2.5.0 [\#245](https://github.com/puppetlabs/puppet-strings/pull/245) ([scotje](https://github.com/scotje))
93
+
94
+ ## [v2.4.0](https://github.com/puppetlabs/puppet-strings/tree/v2.4.0) (2020-02-20)
7
95
 
8
96
  [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.3.1...v2.4.0)
9
97
 
@@ -13,6 +101,10 @@ Added
13
101
  - \(PDOC-295\) Add @enum tag support for Enum data types [\#215](https://github.com/puppetlabs/puppet-strings/pull/215) ([seanmil](https://github.com/seanmil))
14
102
  - Expanded default search glob for plans. [\#214](https://github.com/puppetlabs/puppet-strings/pull/214) ([Raskil](https://github.com/Raskil))
15
103
 
104
+ **Merged pull requests:**
105
+
106
+ - \(MAINT\) Release prep for 2.4.0 [\#221](https://github.com/puppetlabs/puppet-strings/pull/221) ([scotje](https://github.com/scotje))
107
+
16
108
  ## [v2.3.1](https://github.com/puppetlabs/puppet-strings/tree/v2.3.1) (2019-09-23)
17
109
 
18
110
  [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.3.0...v2.3.1)
@@ -178,7 +270,7 @@ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with t
178
270
  - Note: this means Markdown text in YARD comments and tags, not a change in the output of strings
179
271
  - New commandline options: --emit-json and --emit-json-stdout to generate JSON documentation **(PDOC-84)**
180
272
  - Runtime dependency on Puppet has been removed, allowing strings to function in Puppet Enterprise 3.8 **(PDOC-80)**
181
- - Note that the gem still requires puppet. We recommend that the strings gem be installed with puppet, as suggested in the [README](https://github.com/puppetlabs/puppet-strings/blob/master/README.md#installing-puppet-strings)
273
+ - Note that the gem still requires puppet. We recommend that the strings gem be installed with puppet, as suggested in the [README](https://github.com/puppetlabs/puppet-strings/blob/main/README.md#installing-puppet-strings)
182
274
  - New gemspec requirement on Ruby version 1.9.3, the oldest supported Ruby version
183
275
 
184
276
  ### BugFixes
@@ -198,8 +290,8 @@ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with t
198
290
  ### Features
199
291
  - Support for JSON output **(PDOC-23)**
200
292
  - Strings now has the ability to produce a JSON representation of a given puppet module
201
- - The details of the JSON schema can be found [here](https://github.com/puppetlabs/puppet-strings/blob/master/json_dom.md)
202
- - For details on how to generate JSON, see the [README](https://github.com/puppetlabs/puppet-strings/blob/master/README.md#running-puppet-strings)
293
+ - The details of the JSON schema can be found [here](https://github.com/puppetlabs/puppet-strings/blob/main/json_dom.md)
294
+ - For details on how to generate JSON, see the [README](https://github.com/puppetlabs/puppet-strings/blob/main/README.md#running-puppet-strings)
203
295
  - Migrate to ruby gems as a distribution method **(PDOC-28)**
204
296
  - This is the last release of strings that will be available as a puppet module
205
297
  - The 0.4.0 release will be released concurrently as a ruby gem
@@ -282,4 +374,4 @@ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with t
282
374
  - Strings will no longer crash when documenting 3x functions with less than two arguments passed into newfunction **(PDOC-27)**
283
375
 
284
376
 
285
- \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
377
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/COMMITTERS.md CHANGED
@@ -4,7 +4,7 @@ Committing changes to Strings
4
4
  We would like to make it easier for community members to contribute to strings
5
5
  using pull requests, even if it makes the task of reviewing and committing
6
6
  these changes a little harder. Pull requests are only ever based on a single
7
- branch. As a result contributors should target their changes at the master branch.
7
+ branch. As a result contributors should target their changes at the main branch.
8
8
  This makes the process of contributing a little easier for the contributor since
9
9
  they don't need to concern themselves with the question, "What branch do I base my changes
10
10
  on?" This is already called out in the [CONTRIBUTING.md](http://goo.gl/XRH2J).
@@ -17,7 +17,7 @@ effort to make sure the end users must opt-in to new behavior that is
17
17
  incompatible with previous behavior. We employ the use of [feature
18
18
  flags](http://stackoverflow.com/questions/7707383/what-is-a-feature-flag) as
19
19
  the primary way to achieve this user opt-in behavior. Finally, it is the
20
- responsibility of the committer to make sure the `master` branch
20
+ responsibility of the committer to make sure the `main` branch
21
21
  is clean and working at all times. Clean means that dead code is not
22
22
  allowed, everything needs to be usable in some manner at all points in time.
23
23
 
@@ -45,9 +45,9 @@ making the decision what base branch to merge the change set into.
45
45
 
46
46
  **base branch** - A branch in Git that contains an active history of changes
47
47
  and will eventually be released using semantic version guidelines. The branch
48
- named `master` will always exist as a base branch.
48
+ named `main` will always exist as a base branch.
49
49
 
50
- **master branch** - The branch where new functionality that and bug fixes are
50
+ **main branch** - The branch where new functionality that and bug fixes are
51
51
  merged.
52
52
 
53
53
  **security** - Where critical security fixes are merged. These change sets
@@ -70,7 +70,7 @@ This section provides a guide to help a committer decide the specific base
70
70
  branch that a change set should be merged into.
71
71
 
72
72
  The latest minor release of a major release is the only base branch that should
73
- be patched. These patches will be merged into `master` if they contain new
73
+ be patched. These patches will be merged into `main` if they contain new
74
74
  functionality and if they fix a critical bug. Older minor releases in a major release
75
75
  do not get patched.
76
76
 
@@ -87,7 +87,7 @@ security branch as the base branch. Please send all security related
87
87
  information or patches to security@puppet.com as per our [Security
88
88
  Policy](https://puppet.com/security/).
89
89
 
90
- The CI systems are configured to run against `master`. Over time, this branch
90
+ The CI systems are configured to run against `main`. Over time, this branch
91
91
  will refer to different versions, but its name will remain fixed to avoid having
92
92
  to update CI jobs and tasks as new versions are released.
93
93
 
@@ -108,7 +108,7 @@ branch:
108
108
  documentation being kept up to date?
109
109
  * Does the change set include clean code? (software code that is formatted
110
110
  correctly and in an organized manner so that another coder can easily read
111
- or modify it.) HINT: `git diff master --check`
111
+ or modify it.) HINT: `git diff main --check`
112
112
  * Does the change set conform to the contributing guide?
113
113
 
114
114
  Commit citizen guidelines:
@@ -118,13 +118,13 @@ This section aims to provide guidelines for being a good commit citizen by
118
118
  paying attention to our automated build tools.
119
119
 
120
120
  * Don’t push on a broken build. (A broken build is defined as a failing job
121
- in [Puppet Strings](https://jenkins.puppetlabs.com/job/platform_puppet-strings_unit-ruby_master/)
121
+ in [Puppet Strings](https://travis-ci.com/github/puppetlabs/puppet-strings)
122
122
  page.)
123
123
  * Watch the build until your changes have gone through green
124
124
  * Update the ticket status and target version. The target version field in
125
125
  our issue tracker should be updated to be the next release of Puppet. For
126
126
  example, if the most recent release of Puppet is 3.1.1 and you merge a
127
- backwards compatible change set into master, then the target version should
127
+ backwards compatible change set into main, then the target version should
128
128
  be 3.2.0 in the issue tracker.)
129
129
  * Ensure the pull request is closed (Hint: amend your merge commit to contain
130
130
  the string `closes #123` where 123 is the pull request number and github
@@ -135,7 +135,7 @@ Example Procedure
135
135
 
136
136
  This section helps a committer rebase and merge a contribution into the base branch.
137
137
 
138
- Suppose a contributor submits a pull request based on master. The change set
138
+ Suppose a contributor submits a pull request based on main. The change set
139
139
  fixes a bug reported against strings 0.1.0 which is the most recently released
140
140
  version of strings.
141
141
 
@@ -147,20 +147,20 @@ branch to track the remote branch.
147
147
  Branch jeffmccune-pdoc-34_fix_foo_error set up to track remote branch pdoc-34-fix_foo_error from jeffmccune.
148
148
  Switched to a new branch 'jeffmccune-pdoc-34_fix_foo_error'
149
149
 
150
- It's possible that more changes have been merged into master since the pull
150
+ It's possible that more changes have been merged into main since the pull
151
151
  request was submitted. In this case it may be necessary to rebase the branch
152
152
  that contains the changes:
153
153
 
154
- $ git rebase upstream/master
154
+ $ git rebase upstream/main
155
155
 
156
156
  After the branch has been checked out and rebased, the committer should ensure that
157
157
  the code review check list has been completed.
158
158
 
159
159
  Now that we have a topic branch containing the change set based on the most recent
160
- `master` branch, the committer merges in:
160
+ `main` branch, the committer merges in:
161
161
 
162
- $ git checkout master
163
- Switched to branch 'master'
162
+ $ git checkout main
163
+ Switched to branch 'main'
164
164
  $ git merge --no-ff --log jeffmccune-pdoc-34_fix_foo_error
165
165
  Merge made by the 'recursive' strategy.
166
166
  foo | 0
@@ -173,12 +173,12 @@ preserve the usefulness of `git branch --contains`. If there are any merge
173
173
  conflicts, they are to be resolved in the merge commit itself and not by
174
174
  re-writing (rebasing) the patches for one base branch, but not another.
175
175
 
176
- Once the change set has been merged into `master`, the committer pushes.
176
+ Once the change set has been merged into `main`, the committer pushes.
177
177
  Please note, the checklist should be complete at this point. It's helpful to make
178
178
  sure your local branches are up to date to avoid one of the branches failing to fast
179
179
  forward while the other succeeds.
180
180
 
181
- $ git push origin master:master
181
+ $ git push origin main:main
182
182
 
183
183
  That's it! The committer then updates the pull request, updates the issue in
184
184
  our issue tracker, and keeps an eye on the [build
data/CONTRIBUTING.md CHANGED
@@ -23,7 +23,7 @@ Before you submit your issue, take a minute to...
23
23
  reported.
24
24
 
25
25
  2. **Check if the issue has been fixed** — try to reproduce it using the
26
- latest `master` or release tag.
26
+ latest `main` or release tag.
27
27
 
28
28
  A good bug report shouldn't leave others needing to chase you up for more
29
29
  information. Please try to be as **detailed as possible** in your issue. What is
@@ -48,12 +48,12 @@ Example:
48
48
  ## Making Changes
49
49
 
50
50
  * Create a topic branch from where you want to base your work.
51
- * This is usually the master branch.
51
+ * This is usually the main branch.
52
52
  * Only target release branches if you are certain your fix must be on that
53
53
  branch.
54
- * To quickly create a topic branch based on master; `git checkout -b
55
- fix/master/my_contribution master`. Please avoid working directly on the
56
- `master` branch.
54
+ * To quickly create a topic branch based on main; `git checkout -b
55
+ fix/main/my_contribution main`. Please avoid working directly on the
56
+ `main` branch.
57
57
  * Make commits of logical units.
58
58
  * Check for unnecessary whitespace with `git diff --check` before committing.
59
59
  * Make sure your commit messages are in the proper format.
@@ -109,7 +109,7 @@ a ticket number.
109
109
 
110
110
  ## Cutting a release
111
111
 
112
- To cut a new release, from a current `master` checkout:
112
+ To cut a new release, from a current `main` checkout:
113
113
 
114
114
  * Start the release branch with `git checkout -b release-prep`
115
115
  * Update `lib/puppet-strings/version.rb` to the new version
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  Puppet Strings
2
2
  ==============
3
- [![Build Status](https://travis-ci.org/puppetlabs/puppet-strings.png?branch=master)](https://travis-ci.org/puppetlabs/puppet-strings) [![Gem Version](https://badge.fury.io/rb/puppet-strings.svg)](https://badge.fury.io/rb/puppet-strings)
3
+ [![Build Status](https://travis-ci.org/puppetlabs/puppet-strings.png?branch=main)](https://travis-ci.org/puppetlabs/puppet-strings) [![Gem Version](https://badge.fury.io/rb/puppet-strings.svg)](https://badge.fury.io/rb/puppet-strings)
4
4
 
5
5
  Puppet Strings generates documentation for Puppet code and extensions written in Puppet and Ruby. Strings processes code and YARD-style code comments to create documentation in HTML, Markdown, or JSON formats.
6
6
 
@@ -62,7 +62,7 @@ See the [Puppet Strings documentation](https://puppet.com/docs/puppet/latest/pup
62
62
 
63
63
  Here are a few other good resources for getting started with documentation:
64
64
 
65
- * [Module README Template](https://docs.puppet.com/puppet/latest/reference/modules_documentation.html)
65
+ * [Module README Template](https://puppet.com/docs/puppet/latest/puppet_strings.html)
66
66
  * [YARD Getting Started Guide](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md)
67
67
  * [YARD Tags Overview](http://www.rubydoc.info/gems/yard/file/docs/Tags.md)
68
68
 
@@ -70,7 +70,7 @@ Here are a few other good resources for getting started with documentation:
70
70
 
71
71
  We love contributions from the community!
72
72
 
73
- If you'd like to contribute to `puppet-strings`, check out [CONTRIBUTING.md](https://github.com/puppetlabs/puppet-strings/blob/master/CONTRIBUTING.md) to get information on the contribution process.
73
+ If you'd like to contribute to `puppet-strings`, check out [CONTRIBUTING.md](https://github.com/puppetlabs/puppet-strings/blob/main/CONTRIBUTING.md) to get information on the contribution process.
74
74
 
75
75
  ### Running Specs
76
76
 
@@ -98,14 +98,14 @@ An example of running the acceptance tests locally with Docker:
98
98
  3. Provision a docker container, in this case CentOS 7
99
99
 
100
100
  ``` text
101
- $ bundle exec rake litmus:provision[docker, centos:7]
101
+ $ bundle exec rake 'litmus:provision[docker, centos:7]'
102
102
  ```
103
103
 
104
104
  4. Install test items; Puppet Agent, our test module, and the puppet-strings gem built from this source code
105
105
 
106
106
  ``` text
107
- $ bundle exec rake litmus:install_agent[puppet6]
108
- $ bundle exec rake litmus:install_module_fixtures
107
+ $ bundle exec rake 'litmus:install_agent[puppet6]'
108
+ $ bundle exec rake 'litmus:install_modules_from_directory[./spec/fixtures/acceptance/modules]'
109
109
  $ bundle exec rake litmus:install_gems
110
110
  ```
111
111
 
@@ -141,9 +141,9 @@ Bug fixes and ongoing development will occur in minor releases for the current m
141
141
 
142
142
  [repo]: https://github.com/puppetlabs/puppet-strings
143
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
144
+ [LICENSE]: https://github.com/puppetlabs/puppet-strings/blob/main/LICENSE
145
+ [changelog]: https://github.com/puppetlabs/puppet-strings/blob/main/CHANGELOG.md
146
+ [contributing]: https://github.com/puppetlabs/puppet-strings/blob/main/CONTRIBUTING.md
147
+ [committers]: https://github.com/puppetlabs/puppet-strings/blob/main/COMMITTERS.md
148
148
  [Puppet community Slack]: https://slack.puppet.com
149
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.
@@ -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.
@@ -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
@@ -14,16 +16,16 @@ module PuppetStrings::Markdown
14
16
  # generates markdown documentation
15
17
  # @return [String] markdown doc
16
18
  def self.generate
17
- final = "# Reference\n"
18
- final << "<!-- DO NOT EDIT: This document was generated by Puppet Strings -->\n\n"
19
- final << PuppetStrings::Markdown::TableOfContents.render
20
- final << PuppetStrings::Markdown::PuppetClasses.render
21
- final << PuppetStrings::Markdown::DefinedTypes.render
22
- final << PuppetStrings::Markdown::ResourceTypes.render
23
- final << PuppetStrings::Markdown::Functions.render
24
- final << PuppetStrings::Markdown::DataTypes.render
25
- final << PuppetStrings::Markdown::PuppetTasks.render
26
- 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
27
29
 
28
30
  final
29
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)
@@ -169,10 +171,22 @@ module PuppetStrings::Markdown
169
171
  @tags.any? { |tag| tag[:tag_name] == 'api' && tag[:text] == 'private' }
170
172
  end
171
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
+
172
182
  # @return [String] full markdown rendering of a component
173
183
  def render(template)
174
- file = File.join(File.dirname(__FILE__),"templates/#{template}")
175
- 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
176
190
  end
177
191
 
178
192
  private