puppet-strings 2.5.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +90 -4
  3. data/COMMITTERS.md +17 -17
  4. data/CONTRIBUTING.md +6 -6
  5. data/README.md +10 -10
  6. data/lib/puppet/application/strings.rb +2 -0
  7. data/lib/puppet/face/strings.rb +4 -1
  8. data/lib/puppet/feature/rgen.rb +2 -0
  9. data/lib/puppet/feature/yard.rb +2 -0
  10. data/lib/puppet-strings/describe.rb +2 -0
  11. data/lib/puppet-strings/json.rb +2 -0
  12. data/lib/puppet-strings/markdown/base.rb +11 -3
  13. data/lib/puppet-strings/markdown/data_type.rb +2 -0
  14. data/lib/puppet-strings/markdown/data_types.rb +3 -1
  15. data/lib/puppet-strings/markdown/defined_type.rb +2 -0
  16. data/lib/puppet-strings/markdown/defined_types.rb +3 -1
  17. data/lib/puppet-strings/markdown/function.rb +9 -7
  18. data/lib/puppet-strings/markdown/functions.rb +3 -1
  19. data/lib/puppet-strings/markdown/puppet_class.rb +2 -0
  20. data/lib/puppet-strings/markdown/puppet_classes.rb +3 -1
  21. data/lib/puppet-strings/markdown/puppet_plan.rb +2 -0
  22. data/lib/puppet-strings/markdown/puppet_plans.rb +3 -1
  23. data/lib/puppet-strings/markdown/puppet_task.rb +2 -0
  24. data/lib/puppet-strings/markdown/puppet_tasks.rb +3 -1
  25. data/lib/puppet-strings/markdown/resource_type.rb +2 -0
  26. data/lib/puppet-strings/markdown/resource_types.rb +3 -1
  27. data/lib/puppet-strings/markdown/table_of_contents.rb +3 -1
  28. data/lib/puppet-strings/markdown/templates/classes_and_defines.erb +7 -3
  29. data/lib/puppet-strings/markdown/templates/data_type.erb +12 -4
  30. data/lib/puppet-strings/markdown/templates/data_type_function.erb +1 -1
  31. data/lib/puppet-strings/markdown/templates/function.erb +1 -1
  32. data/lib/puppet-strings/markdown/templates/puppet_task.erb +1 -1
  33. data/lib/puppet-strings/markdown/templates/resource_type.erb +8 -2
  34. data/lib/puppet-strings/markdown.rb +11 -9
  35. data/lib/puppet-strings/monkey_patches/display_object_command.rb +2 -0
  36. data/lib/puppet-strings/tasks/generate.rb +2 -0
  37. data/lib/puppet-strings/tasks/gh_pages.rb +3 -0
  38. data/lib/puppet-strings/tasks/validate.rb +42 -0
  39. data/lib/puppet-strings/tasks.rb +3 -0
  40. data/lib/puppet-strings/version.rb +3 -1
  41. data/lib/puppet-strings/yard/code_objects/base.rb +2 -0
  42. data/lib/puppet-strings/yard/code_objects/class.rb +4 -2
  43. data/lib/puppet-strings/yard/code_objects/data_type.rb +4 -2
  44. data/lib/puppet-strings/yard/code_objects/data_type_alias.rb +2 -0
  45. data/lib/puppet-strings/yard/code_objects/defined_type.rb +4 -2
  46. data/lib/puppet-strings/yard/code_objects/function.rb +6 -3
  47. data/lib/puppet-strings/yard/code_objects/group.rb +3 -0
  48. data/lib/puppet-strings/yard/code_objects/plan.rb +4 -2
  49. data/lib/puppet-strings/yard/code_objects/provider.rb +6 -0
  50. data/lib/puppet-strings/yard/code_objects/task.rb +2 -0
  51. data/lib/puppet-strings/yard/code_objects/type.rb +6 -1
  52. data/lib/puppet-strings/yard/code_objects.rb +2 -0
  53. data/lib/puppet-strings/yard/handlers/helpers.rb +2 -0
  54. data/lib/puppet-strings/yard/handlers/json/base.rb +2 -0
  55. data/lib/puppet-strings/yard/handlers/json/task_handler.rb +2 -0
  56. data/lib/puppet-strings/yard/handlers/puppet/base.rb +3 -0
  57. data/lib/puppet-strings/yard/handlers/puppet/class_handler.rb +2 -0
  58. data/lib/puppet-strings/yard/handlers/puppet/data_type_alias_handler.rb +2 -0
  59. data/lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb +2 -0
  60. data/lib/puppet-strings/yard/handlers/puppet/function_handler.rb +3 -1
  61. data/lib/puppet-strings/yard/handlers/puppet/plan_handler.rb +2 -0
  62. data/lib/puppet-strings/yard/handlers/ruby/base.rb +5 -0
  63. data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +33 -17
  64. data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +9 -7
  65. data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +13 -0
  66. data/lib/puppet-strings/yard/handlers/ruby/rsapi_handler.rb +4 -1
  67. data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +14 -6
  68. data/lib/puppet-strings/yard/handlers/ruby/type_extras_handler.rb +15 -5
  69. data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +12 -1
  70. data/lib/puppet-strings/yard/handlers.rb +2 -0
  71. data/lib/puppet-strings/yard/parsers/json/parser.rb +2 -0
  72. data/lib/puppet-strings/yard/parsers/json/task_statement.rb +2 -0
  73. data/lib/puppet-strings/yard/parsers/puppet/parser.rb +18 -14
  74. data/lib/puppet-strings/yard/parsers/puppet/statement.rb +4 -0
  75. data/lib/puppet-strings/yard/parsers.rb +2 -0
  76. data/lib/puppet-strings/yard/tags/enum_tag.rb +2 -0
  77. data/lib/puppet-strings/yard/tags/factory.rb +2 -0
  78. data/lib/puppet-strings/yard/tags/overload_tag.rb +4 -1
  79. data/lib/puppet-strings/yard/tags/parameter_directive.rb +5 -4
  80. data/lib/puppet-strings/yard/tags/property_directive.rb +5 -4
  81. data/lib/puppet-strings/yard/tags/summary_tag.rb +2 -0
  82. data/lib/puppet-strings/yard/tags.rb +2 -0
  83. data/lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb +1 -1
  84. data/lib/puppet-strings/yard/util.rb +4 -1
  85. data/lib/puppet-strings/yard.rb +3 -0
  86. data/lib/puppet-strings.rb +2 -0
  87. metadata +9 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 543437ac3fd3177245de47e563235b3f99194299f1c1cf14132bed3850de5056
4
- data.tar.gz: 4aaa21554b916ca541ae3ce04a21ab34912375499347a816292858915aa803cf
3
+ metadata.gz: 9397d83c2092aed842ea468c79012270659c27b5c9ad85e1a67f614ca3fef2a2
4
+ data.tar.gz: 65bc26d31881eefbb6de381a29afe1de4274bfeb2f1748969af60f9e30dcb9fe
5
5
  SHA512:
6
- metadata.gz: c73e04ec0c084f0000751eaa618ed5daa0efcfebf101e1d63832ab46403d0eff01ab628c028eae368097d2b3500c2e869d292c0fa07ad4eb68392773125b3ddf
7
- data.tar.gz: 2a40adbd4874289129cecca5164f65ce3021a83a7cc3559bd6a6b28e3154020e1a9cd5a076c119827072feb47e2f6fe562924cfd63158f4c3e924ba132e0ddcd
6
+ metadata.gz: a20053eca0ac726c86ea1b21596f1c66a98f9a28679ee00c4d9b64afe30d3f9fa9ce9d67bec6dd28ef9ff4c5c70f8f0b075d43c5d07c87c382265433bda13993
7
+ data.tar.gz: a476bfcc359d3e2603902f080a7d54f4e80b04d18b470dc0e8980c20cc7b4452e44ea7e344db4bf7702ce5c3b9aa7745d52d75e5cadc5991313d596de97f0d4a
data/CHANGELOG.md CHANGED
@@ -3,7 +3,89 @@
3
3
  All significant changes to this repo will be summarized in this file.
4
4
 
5
5
 
6
- ## [v2.5.0](https://github.com/puppetlabs/puppet-strings/tree/v2.5.0) (2020-07-15)
6
+ ## [v2.9.0](https://github.com/puppetlabs/puppet-strings/tree/v2.9.0) (2021-11-29)
7
+
8
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.8.0...v2.9.0)
9
+
10
+ Added
11
+
12
+ - Add strings:validate:reference task [\#293](https://github.com/puppetlabs/puppet-strings/issues/293)
13
+
14
+ Fixed
15
+
16
+ - Fix rare undefined method `any?' for nil:NilClass error [\#289](https://github.com/puppetlabs/puppet-strings/pull/289) ([sanfrancrisko](https://github.com/sanfrancrisko))
17
+
18
+ **Closed issues:**
19
+
20
+ - Error: undefined method `any?' for nil:NilClass when generating documentation [\#287](https://github.com/puppetlabs/puppet-strings/issues/287)
21
+ - Update changelog with recent commits [\#283](https://github.com/puppetlabs/puppet-strings/issues/283)
22
+ - Please document the `author` tag [\#256](https://github.com/puppetlabs/puppet-strings/issues/256)
23
+
24
+ **Merged pull requests:**
25
+
26
+ - Implement a strings:validate:reference task [\#291](https://github.com/puppetlabs/puppet-strings/pull/291) ([ekohl](https://github.com/ekohl))
27
+
28
+ ## [v2.8.0](https://github.com/puppetlabs/puppet-strings/tree/v2.8.0) (2021-07-19)
29
+
30
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.7.0...v2.8.0)
31
+
32
+ Added
33
+
34
+ - \(DOCUMENT-1232\) Add support for ensurable in types\_extras\_handler [\#281](https://github.com/puppetlabs/puppet-strings/pull/281) ([joshcooper](https://github.com/joshcooper))
35
+
36
+ **Merged pull requests:**
37
+
38
+ - \(FIXUP\) Check for nil before injecting provider param into Types [\#285](https://github.com/puppetlabs/puppet-strings/pull/285) ([scotje](https://github.com/scotje))
39
+ - README.md: update link to docs [\#276](https://github.com/puppetlabs/puppet-strings/pull/276) ([kenyon](https://github.com/kenyon))
40
+
41
+ ## [v2.7.0](https://github.com/puppetlabs/puppet-strings/tree/v2.7.0) (2021-05-17)
42
+
43
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.6.0...v2.7.0)
44
+
45
+ Added
46
+
47
+ - Add supported\_features to puppet strings input/output for types [\#228](https://github.com/puppetlabs/puppet-strings/issues/228)
48
+
49
+ Fixed
50
+
51
+ - `file` type is missing `ensure` in generated reference docs [\#230](https://github.com/puppetlabs/puppet-strings/issues/230)
52
+
53
+ **Closed issues:**
54
+
55
+ - class with "apply" attribute causes parser error [\#251](https://github.com/puppetlabs/puppet-strings/issues/251)
56
+
57
+ **Merged pull requests:**
58
+
59
+ - Update CODEOWNERS [\#272](https://github.com/puppetlabs/puppet-strings/pull/272) ([binford2k](https://github.com/binford2k))
60
+ - Only set tasks = true when parsing plans. [\#266](https://github.com/puppetlabs/puppet-strings/pull/266) ([binford2k](https://github.com/binford2k))
61
+
62
+ ## [v2.6.0](https://github.com/puppetlabs/puppet-strings/tree/v2.6.0) (2021-01-18)
63
+
64
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.5.0...v2.6.0)
65
+
66
+ Added
67
+
68
+ - Improved markdown templates [\#252](https://github.com/puppetlabs/puppet-strings/pull/252) ([kozl](https://github.com/kozl))
69
+
70
+ Fixed
71
+
72
+ - 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))
73
+ - Handle a missing description gracefully [\#260](https://github.com/puppetlabs/puppet-strings/pull/260) ([scotje](https://github.com/scotje))
74
+ - Fix ERB failure - parameters without descriptions [\#255](https://github.com/puppetlabs/puppet-strings/pull/255) ([trevor-vaughan](https://github.com/trevor-vaughan))
75
+ - puppet\_function template: fix tags, source [\#249](https://github.com/puppetlabs/puppet-strings/pull/249) ([raemer](https://github.com/raemer))
76
+ - Handle a missing description gracefully [\#246](https://github.com/puppetlabs/puppet-strings/pull/246) ([ekohl](https://github.com/ekohl))
77
+
78
+ Changed
79
+
80
+ - \(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))
81
+
82
+ **Closed issues:**
83
+
84
+ - Tags \(Parameter, Returns\) not generated in HTML output [\#248](https://github.com/puppetlabs/puppet-strings/issues/248)
85
+ - Can we get 2.5.0 released please [\#244](https://github.com/puppetlabs/puppet-strings/issues/244)
86
+ - Provider attribute is missing in generated types documentation [\#227](https://github.com/puppetlabs/puppet-strings/issues/227)
87
+
88
+ ## [v2.5.0](https://github.com/puppetlabs/puppet-strings/tree/v2.5.0) (2020-07-16)
7
89
 
8
90
  [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.4.0...v2.5.0)
9
91
 
@@ -27,6 +109,10 @@ Fixed
27
109
  - Document usage [\#8](https://github.com/puppetlabs/puppet-strings/issues/8)
28
110
  - Need a search box on the main page [\#1](https://github.com/puppetlabs/puppet-strings/issues/1)
29
111
 
112
+ **Merged pull requests:**
113
+
114
+ - Release prep for v2.5.0 [\#245](https://github.com/puppetlabs/puppet-strings/pull/245) ([scotje](https://github.com/scotje))
115
+
30
116
  ## [v2.4.0](https://github.com/puppetlabs/puppet-strings/tree/v2.4.0) (2020-02-20)
31
117
 
32
118
  [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v2.3.1...v2.4.0)
@@ -206,7 +292,7 @@ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with t
206
292
  - Note: this means Markdown text in YARD comments and tags, not a change in the output of strings
207
293
  - New commandline options: --emit-json and --emit-json-stdout to generate JSON documentation **(PDOC-84)**
208
294
  - Runtime dependency on Puppet has been removed, allowing strings to function in Puppet Enterprise 3.8 **(PDOC-80)**
209
- - 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)
295
+ - 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)
210
296
  - New gemspec requirement on Ruby version 1.9.3, the oldest supported Ruby version
211
297
 
212
298
  ### BugFixes
@@ -226,8 +312,8 @@ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with t
226
312
  ### Features
227
313
  - Support for JSON output **(PDOC-23)**
228
314
  - Strings now has the ability to produce a JSON representation of a given puppet module
229
- - The details of the JSON schema can be found [here](https://github.com/puppetlabs/puppet-strings/blob/master/json_dom.md)
230
- - For details on how to generate JSON, see the [README](https://github.com/puppetlabs/puppet-strings/blob/master/README.md#running-puppet-strings)
315
+ - The details of the JSON schema can be found [here](https://github.com/puppetlabs/puppet-strings/blob/main/json_dom.md)
316
+ - For details on how to generate JSON, see the [README](https://github.com/puppetlabs/puppet-strings/blob/main/README.md#running-puppet-strings)
231
317
  - Migrate to ruby gems as a distribution method **(PDOC-28)**
232
318
  - This is the last release of strings that will be available as a puppet module
233
319
  - The 0.4.0 release will be released concurrently as a ruby gem
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
  require 'puppet/application/face_base'
2
4
 
3
5
  # Implements the 'puppet strings' application.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet/face'
2
4
 
3
5
  # Implements the 'puppet strings' interface.
@@ -57,6 +59,7 @@ Puppet::Face.define(:strings, '0.0.1') do
57
59
  environment = Puppet.lookup(:current_environment)
58
60
  environment.modules.each do |mod|
59
61
  next unless modules.empty? || modules.include?(mod.name)
62
+
60
63
  db = File.join(mod.path, '.yardoc')
61
64
  patterns = PuppetStrings::DEFAULT_SEARCH_PATTERNS.map do |p|
62
65
  File.join(mod.path, p)
@@ -145,7 +148,7 @@ Puppet::Face.define(:strings, '0.0.1') do
145
148
  def check_required_features
146
149
  raise RuntimeError, "The 'yard' gem must be installed in order to use this face." unless Puppet.features.yard?
147
150
  raise RuntimeError, "The 'rgen' gem must be installed in order to use this face." unless Puppet.features.rgen?
148
- raise RuntimeError, 'This face requires Ruby 1.9 or greater.' if RUBY_VERSION =~ /^1\.8/
151
+ raise RuntimeError, 'This face requires Ruby 1.9 or greater.' if RUBY_VERSION.match?(/^1\.8/)
149
152
  end
150
153
 
151
154
  # Builds the options to PuppetStrings.generate.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet/util/feature'
2
4
 
3
5
  Puppet.features.add(:rgen, :libs => ['rgen/metamodel_builder', 'rgen/ecore/ecore'])
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet/util/feature'
2
4
 
3
5
  Puppet.features.add(:yard, :libs => ['yard'])
@@ -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'
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)
@@ -170,6 +172,8 @@ module PuppetStrings::Markdown
170
172
  end
171
173
 
172
174
  def word_wrap(text, line_width: 120, break_sequence: "\n")
175
+ return unless text
176
+
173
177
  text.split("\n").collect! do |line|
174
178
  line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1#{break_sequence}").strip : line
175
179
  end * break_sequence
@@ -177,8 +181,12 @@ module PuppetStrings::Markdown
177
181
 
178
182
  # @return [String] full markdown rendering of a component
179
183
  def render(template)
180
- file = File.join(File.dirname(__FILE__),"templates/#{template}")
181
- 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
182
190
  end
183
191
 
184
192
  private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'data_type'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -22,7 +24,7 @@ module PuppetStrings::Markdown
22
24
  def self.render
23
25
  final = in_dtypes.length > 0 ? "## Data types\n\n" : ""
24
26
  in_dtypes.each do |type|
25
- final << type.render unless type.private?
27
+ final += type.render unless type.private?
26
28
  end
27
29
  final
28
30
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'defined_type'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_dtypes.length > 0 ? "## Defined types\n\n" : ""
21
23
  in_dtypes.each do |type|
22
- final << type.render unless type.private?
24
+ final += type.render unless type.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,23 +21,23 @@ module PuppetStrings::Markdown
19
21
 
20
22
  def type
21
23
  t = @registry[:type]
22
- if t =~ /ruby4x/
24
+ if /ruby4x/.match?(t)
23
25
  "Ruby 4.x API"
24
- elsif t =~ /ruby3/
26
+ elsif /ruby3/.match?(t)
25
27
  "Ruby 3.x API"
26
- elsif t =~ /ruby/
28
+ elsif /ruby/.match?(t)
27
29
  "Ruby"
28
30
  else
29
31
  "Puppet Language"
30
32
  end
31
33
  end
32
34
 
33
- def error_type(r) # rubocop:disable Naming/UncommunicativeMethodParamName
34
- "`#{r.split(' ')[0]}`"
35
+ def error_type(type)
36
+ "`#{type.split(' ')[0]}`"
35
37
  end
36
38
 
37
- def error_text(r) # rubocop:disable Naming/UncommunicativeMethodParamName
38
- "#{r.split(' ').drop(1).join(' ')}"
39
+ def error_text(text)
40
+ "#{text.split(' ').drop(1).join(' ')}"
39
41
  end
40
42
  end
41
43
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'function'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_functions.length > 0 ? "## Functions\n\n" : ""
21
23
  in_functions.each do |func|
22
- final << func.render unless func.private?
24
+ final += func.render unless func.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'puppet_class'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_classes.length > 0 ? "## Classes\n\n" : ""
21
23
  in_classes.each do |klass|
22
- final << klass.render unless klass.private?
24
+ final += klass.render unless klass.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'puppet_plan'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_plans.length > 0 ? "## Plans\n\n" : ""
21
23
  in_plans.each do |plan|
22
- final << plan.render unless plan.private?
24
+ final += plan.render unless plan.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'puppet_task'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -16,7 +18,7 @@ module PuppetStrings::Markdown
16
18
  def self.render
17
19
  final = in_tasks.length > 0 ? "## Tasks\n\n" : ""
18
20
  in_tasks.each do |task|
19
- final << task.render unless task.private?
21
+ final += task.render unless task.private?
20
22
  end
21
23
  final
22
24
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/markdown/base'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'resource_type'
2
4
 
3
5
  module PuppetStrings::Markdown
@@ -19,7 +21,7 @@ module PuppetStrings::Markdown
19
21
  def self.render
20
22
  final = in_rtypes.length > 0 ? "## Resource types\n\n" : ""
21
23
  in_rtypes.each do |type|
22
- final << type.render unless type.private?
24
+ final += type.render unless type.private?
23
25
  end
24
26
  final
25
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PuppetStrings::Markdown
2
4
  module TableOfContents
3
5
  def self.render
@@ -16,7 +18,7 @@ module PuppetStrings::Markdown
16
18
  priv = r.contains_private?
17
19
 
18
20
  template = File.join(File.dirname(__FILE__),"templates/table_of_contents.erb")
19
- final << ERB.new(File.read(template), nil, '-').result(binding)
21
+ final += ERB.new(File.read(template), nil, '-').result(binding)
20
22
  end
21
23
  final
22
24
  end