puppet-strings 0.4.0 → 0.99.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +122 -0
  3. data/COMMITTERS.md +185 -0
  4. data/CONTRIBUTING.md +89 -0
  5. data/Gemfile +38 -0
  6. data/JSON.md +511 -0
  7. data/LICENSE +13 -0
  8. data/README.md +416 -0
  9. data/Rakefile +49 -0
  10. data/lib/puppet-strings.rb +63 -0
  11. data/lib/puppet-strings/json.rb +49 -0
  12. data/lib/puppet-strings/tasks.rb +10 -0
  13. data/lib/puppet-strings/tasks/generate.rb +23 -0
  14. data/lib/puppet-strings/tasks/gh_pages.rb +43 -0
  15. data/lib/puppet-strings/yard.rb +96 -0
  16. data/lib/puppet-strings/yard/code_objects.rb +8 -0
  17. data/lib/puppet-strings/yard/code_objects/base.rb +14 -0
  18. data/lib/puppet-strings/yard/code_objects/class.rb +59 -0
  19. data/lib/puppet-strings/yard/code_objects/defined_type.rb +58 -0
  20. data/lib/puppet-strings/yard/code_objects/function.rb +93 -0
  21. data/lib/puppet-strings/yard/code_objects/group.rb +30 -0
  22. data/lib/puppet-strings/yard/code_objects/provider.rb +93 -0
  23. data/lib/puppet-strings/yard/code_objects/type.rb +146 -0
  24. data/lib/puppet-strings/yard/handlers.rb +16 -0
  25. data/lib/puppet-strings/yard/handlers/puppet/base.rb +44 -0
  26. data/lib/puppet-strings/yard/handlers/puppet/class_handler.rb +23 -0
  27. data/lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb +23 -0
  28. data/lib/puppet-strings/yard/handlers/puppet/function_handler.rb +42 -0
  29. data/lib/puppet-strings/yard/handlers/ruby/base.rb +38 -0
  30. data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +357 -0
  31. data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +113 -0
  32. data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +194 -0
  33. data/lib/puppet-strings/yard/parsers.rb +7 -0
  34. data/lib/puppet-strings/yard/parsers/puppet/parser.rb +70 -0
  35. data/lib/puppet-strings/yard/parsers/puppet/statement.rb +146 -0
  36. data/lib/puppet-strings/yard/tags.rb +6 -0
  37. data/lib/puppet-strings/yard/tags/overload_tag.rb +109 -0
  38. data/lib/puppet-strings/yard/tags/parameter_directive.rb +24 -0
  39. data/lib/puppet-strings/yard/tags/property_directive.rb +24 -0
  40. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_class.erb +9 -0
  41. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_defined_type.erb +9 -0
  42. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_function.erb +10 -0
  43. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb +10 -0
  44. data/lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb +9 -0
  45. data/lib/puppet-strings/yard/templates/default/fulldoc/html/setup.rb +64 -0
  46. data/lib/puppet-strings/yard/templates/default/layout/html/objects.erb +35 -0
  47. data/lib/puppet-strings/yard/templates/default/layout/html/setup.rb +172 -0
  48. data/lib/puppet-strings/yard/templates/default/puppet_class/html/box_info.erb +26 -0
  49. data/lib/puppet-strings/yard/templates/default/puppet_class/html/header.erb +1 -0
  50. data/lib/puppet-strings/yard/templates/default/puppet_class/html/overview.erb +6 -0
  51. data/lib/puppet-strings/yard/templates/default/puppet_class/html/setup.rb +14 -0
  52. data/lib/puppet-strings/yard/templates/default/puppet_class/html/source.erb +12 -0
  53. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/box_info.erb +10 -0
  54. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/header.erb +1 -0
  55. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/overview.erb +6 -0
  56. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/setup.rb +5 -0
  57. data/lib/puppet-strings/yard/templates/default/puppet_defined_type/html/source.erb +12 -0
  58. data/lib/puppet-strings/yard/templates/default/puppet_function/html/box_info.erb +14 -0
  59. data/lib/puppet-strings/yard/templates/default/puppet_function/html/header.erb +1 -0
  60. data/lib/puppet-strings/yard/templates/default/puppet_function/html/overview.erb +18 -0
  61. data/lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb +5 -0
  62. data/lib/puppet-strings/yard/templates/default/puppet_function/html/source.erb +12 -0
  63. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/box_info.erb +14 -0
  64. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/collection.erb +10 -0
  65. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/features.erb +12 -0
  66. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/header.erb +1 -0
  67. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/overview.erb +6 -0
  68. data/lib/puppet-strings/yard/templates/default/puppet_provider/html/setup.rb +29 -0
  69. data/lib/puppet-strings/yard/templates/default/puppet_type/html/box_info.erb +20 -0
  70. data/lib/puppet-strings/yard/templates/default/puppet_type/html/features.erb +13 -0
  71. data/lib/puppet-strings/yard/templates/default/puppet_type/html/header.erb +1 -0
  72. data/lib/puppet-strings/yard/templates/default/puppet_type/html/overview.erb +6 -0
  73. data/lib/puppet-strings/yard/templates/default/puppet_type/html/parameters.erb +35 -0
  74. data/lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb +32 -0
  75. data/lib/puppet-strings/yard/templates/default/tags/html/puppet_overload.erb +12 -0
  76. data/lib/puppet-strings/yard/templates/default/tags/setup.rb +15 -0
  77. data/lib/puppet/application/strings.rb +1 -0
  78. data/lib/puppet/face/strings.rb +80 -39
  79. data/spec/acceptance/emit_json_options.rb +41 -0
  80. data/spec/acceptance/lib/util.rb +15 -0
  81. data/spec/acceptance/running_strings_generate.rb +54 -0
  82. data/spec/fixtures/acceptance/modules/test/functions/add.pp +9 -0
  83. data/spec/fixtures/acceptance/modules/test/lib/puppet/functions/4x_function.rb +5 -0
  84. data/spec/fixtures/acceptance/modules/test/lib/puppet/parser/functions/function3x.rb +2 -0
  85. data/spec/fixtures/acceptance/modules/test/lib/puppet/provider/server/linux.rb +9 -0
  86. data/spec/fixtures/acceptance/modules/test/lib/puppet/type/database.rb +15 -0
  87. data/spec/fixtures/acceptance/modules/test/manifests/init.pp +27 -0
  88. data/spec/fixtures/acceptance/modules/test/manifests/triple_nested_classes.pp +27 -0
  89. data/spec/fixtures/acceptance/modules/test/metadata.json +6 -0
  90. data/spec/fixtures/unit/json/output.json +348 -0
  91. data/spec/fixtures/unit/json/output_without_puppet_function.json +301 -0
  92. data/spec/spec_helper.rb +21 -0
  93. data/spec/spec_helper_acceptance.rb +27 -0
  94. data/spec/unit/puppet-strings/json_spec.rb +136 -0
  95. data/spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb +155 -0
  96. data/spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb +155 -0
  97. data/spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb +169 -0
  98. data/spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb +613 -0
  99. data/spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb +90 -0
  100. data/spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb +214 -0
  101. data/spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb +171 -0
  102. metadata +115 -92
  103. data/lib/puppet-strings/rake_tasks.rb +0 -18
  104. data/lib/puppet_x/puppetlabs/strings.rb +0 -64
  105. data/lib/puppet_x/puppetlabs/strings/actions.rb +0 -92
  106. data/lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb +0 -79
  107. data/lib/puppet_x/puppetlabs/strings/pops/yard_transformer.rb +0 -47
  108. data/lib/puppet_x/puppetlabs/strings/util.rb +0 -65
  109. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object.rb +0 -33
  110. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb +0 -22
  111. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/method_object.rb +0 -62
  112. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/provider_object.rb +0 -24
  113. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object.rb +0 -48
  114. data/lib/puppet_x/puppetlabs/strings/yard/code_objects/type_object.rb +0 -42
  115. data/lib/puppet_x/puppetlabs/strings/yard/core_ext/yard.rb +0 -40
  116. data/lib/puppet_x/puppetlabs/strings/yard/handlers/base.rb +0 -13
  117. data/lib/puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler.rb +0 -31
  118. data/lib/puppet_x/puppetlabs/strings/yard/handlers/heredoc_helper.rb +0 -80
  119. data/lib/puppet_x/puppetlabs/strings/yard/handlers/host_class_handler.rb +0 -42
  120. data/lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb +0 -95
  121. data/lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb +0 -54
  122. data/lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb +0 -234
  123. data/lib/puppet_x/puppetlabs/strings/yard/handlers/type_handler.rb +0 -295
  124. data/lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb +0 -85
  125. data/lib/puppet_x/puppetlabs/strings/yard/monkey_patches.rb +0 -68
  126. data/lib/puppet_x/puppetlabs/strings/yard/parser.rb +0 -30
  127. data/lib/puppet_x/puppetlabs/strings/yard/tags/directives.rb +0 -9
  128. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/docstring.erb +0 -34
  129. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/header.erb +0 -5
  130. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/parameter_details.erb +0 -6
  131. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/setup.rb +0 -1
  132. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb +0 -49
  133. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_class.erb +0 -2
  134. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_manifest.erb +0 -1
  135. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb +0 -21
  136. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb +0 -1
  137. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb +0 -1
  138. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/setup.rb +0 -82
  139. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/box_info.erb +0 -22
  140. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/setup.rb +0 -1
  141. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/subclasses.erb +0 -4
  142. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/setup.rb +0 -21
  143. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/html_helper.rb +0 -139
  144. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/layout/html/setup.rb +0 -18
  145. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/html/header.erb +0 -17
  146. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/setup.rb +0 -21
  147. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/text/header.erb +0 -2
  148. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/command_details.erb +0 -8
  149. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/confine_details.erb +0 -10
  150. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/default_details.erb +0 -10
  151. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/docstring.erb +0 -34
  152. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/feature_details.erb +0 -10
  153. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/header.erb +0 -5
  154. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/setup.rb +0 -1
  155. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/setup.rb +0 -50
  156. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/box_info.erb +0 -11
  157. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/header.erb +0 -5
  158. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_details_list.erb +0 -53
  159. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb +0 -20
  160. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/setup.rb +0 -1
  161. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb +0 -91
  162. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/template_helper.rb +0 -192
  163. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/docstring.erb +0 -34
  164. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/header.erb +0 -5
  165. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/parameter_details.erb +0 -12
  166. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/provider_details.erb +0 -10
  167. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/setup.rb +0 -1
  168. data/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/setup.rb +0 -55
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c5d45a8489fb4754aebb00abe3afb2e85b4e75c
4
- data.tar.gz: cb074d7c812e50b1a1ffbbe42cafde1a909fb125
3
+ metadata.gz: a6a68c372004eb1cf650ae8542c16dd019614ec1
4
+ data.tar.gz: b4e29585c10fa54c4ad5a141a0c04ac22f642739
5
5
  SHA512:
6
- metadata.gz: 5bc48f92940b474aeddff28cad23338216db262815dec6abfc275aaf39f7c458a9d2a4d160c5131898724310e4ef75fe657f597164b80ede62fd9066d616ec9e
7
- data.tar.gz: 9ce5ee6be34c1727855f9c1f99bb2049146b3434ab4bc5b51579d698cd15e531b70ae3a466beb77b08599ff0439cbf6c2e077c4556cb3d01448e5dd5adaf0a20
6
+ metadata.gz: 8e2d046b43f397bd7f6580e7312edb4f1a7e58de320927af653bcf2c0f830b4260a0473616c8817f98561cf38ea997951ebe96b1697e4507a3041546168a9d28
7
+ data.tar.gz: c5828dc16270f1e2a51f77ff2be199c322b2c5d7e95eb72178bf9151998b0e804ac1efde40e22c279f3541b1e3fb50c11fa7b2c43c2bbcd54c07169f4cf71385
@@ -0,0 +1,122 @@
1
+ ##2016-10-10 - Release 0.99.0
2
+
3
+ ###Summary
4
+
5
+ This release includes a complete rewrite of strings, fixing many bugs from previous versions and generally improving the user experience. This release is intended to be the last stop before the strings major version 1.0 is released, and nearly all of the functionality of the major release is included.
6
+
7
+ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with the fix version of [0.99.0](https://tickets.puppetlabs.com/issues/?filter=22705).
8
+
9
+ ###Features
10
+ - Complete overhaul, including code cleanup, bug fixes and new functionality **(PDOC-63)**
11
+ - Documentation has been split into sections based on type: puppet 3x API functions, puppet 4x API functions, ruby classes, puppet language functions, types, and providers
12
+ - New JSON schema organized to reflect the separation of types
13
+ - Support for custom functions written in the puppet language
14
+ - Support for puppet function overloads via the create_function 4.x API
15
+ - YARD bumped to latest version, 0.9.5
16
+ - Markdown is now the default format for parsing docstring text **(PDOC-86)**
17
+ - Note: this means Markdown text in YARD comments and tags, not a change in the output of strings
18
+ - New commandline options: --emit-json and --emit-json-stdout to generate JSON documentation **(PDOC-84)**
19
+ - Runtime dependency on Puppet has been removed, allowing strings to function in Puppet Enterprise 3.8 **(PDOC-80)**
20
+ - 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)
21
+ - New gemspec requirement on Ruby version 1.9.3, the oldest supported Ruby version
22
+
23
+ ###BugFixes
24
+
25
+ - Prevents a blizzard of errors when documenting Puppet Core source and some puppet modules **(PDOC-63)**
26
+ - As this is a complete rewrite, many known and unknown bugs from the original code were fixed along the way
27
+ - Allow strings to be installed in PE 3.8 without overwriting existing puppet and facter installations with newer gems
28
+
29
+ ##2016-03-30 - Release 0.4.0
30
+
31
+ ###Summary
32
+
33
+ This release adds JSON output support for strings, fixes a major bug that prevented strings from working with the 4.4.0 release of puppet, and is the last version of strings that will be released as a module.
34
+
35
+ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with the fix version of [0.4.0](https://tickets.puppetlabs.com/issues/?filter=18810).
36
+
37
+ ###Features
38
+ - Support for JSON output **(PDOC-23)**
39
+ - Strings now has the ability to produce a JSON representation of a given puppet module
40
+ - The details of the JSON schema can be found [here](https://github.com/puppetlabs/puppet-strings/blob/master/json_dom.md)
41
+ - For details on how to generate JSON, see the [README](https://github.com/puppetlabs/puppet-strings/blob/master/README.md#running-puppet-strings)
42
+ - Migrate to ruby gems as a distribution method **(PDOC-28)**
43
+ - This is the last release of strings that will be available as a puppet module
44
+ - The 0.4.0 release will be released concurrently as a ruby gem
45
+ - After this release, all updates will only be available via the gem
46
+
47
+ ###Bugfixes
48
+
49
+ - Fix issue that prevented strings from running with Puppet 4.4.0 **(PDOC-75)**
50
+
51
+ ##2015-09-22 - Release 0.3.1
52
+
53
+ ###Summary
54
+
55
+ This is a minor bug fix release.
56
+
57
+ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with the fix version of [0.3.1](https://tickets.puppetlabs.com/issues/?filter=15530).
58
+
59
+ ###Bugfixes
60
+
61
+ - Prevent strings from printing unnecessary quotes in error messages **(PDOC-57)**
62
+ - Issue correct type check warnings for defined types **(PDOC-56)**
63
+ - Allow providers, types, and defines to have the same name **(PDOC-54)**
64
+
65
+ ##2015-09-21 - Release 0.3.0
66
+
67
+ ###Summary
68
+
69
+ This release includes support for Puppet Types and Providers, as well as
70
+ type checking Puppet 4x functions and defined types.
71
+
72
+ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with
73
+ the fix version of [0.3.0](https://tickets.puppetlabs.com/issues/?filter=15529).
74
+
75
+ ####Features
76
+
77
+ - Support for Puppet Types and Providers **(PDOC-35)**
78
+ - Type check Puppet 4x functions and defined types where possible and warn the user when types don't match.
79
+ - Type check defined types **(PDOC-21)**
80
+ - Type check Puppet 4x functions **(PDOC-38)** **(PDOC-19)** **(PDOC-37)**
81
+ - Output type info in generated HTML **(PDOC-19)**
82
+ - Improved warnings and logging.
83
+ - Create a consistent style for warnings. **(PDOC-49)**
84
+ - All warnings get printed on stderr.
85
+ - Yard warnings are redirected to a log file **(PDOC-38)**
86
+ - Prevent duplicate warnings **(PDOC-38)**
87
+ - Improved README installation and usage instructions.
88
+ - Installation instructions using Puppet **(PDOC-33)**
89
+
90
+
91
+ ####Bugfixes
92
+
93
+ - Fix markdown list processing **(PDOC-30)**
94
+ - Fix namespacing for nested classes and defined types **(PDOC-20)**
95
+
96
+
97
+ ##2015-03-17 - Release 0.2.0
98
+
99
+ ###Summary
100
+
101
+ This release includes improvements to the HTML output generated by strings and a few bug fixes.
102
+ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with the fix version of [0.2.0](https://tickets.puppetlabs.com/issues/?filter=13760).
103
+
104
+ [PDOC JIRA]: https://tickets.puppetlabs.com/browse/PDOC
105
+
106
+ ####Features
107
+ - Custom YARD templates for classes and defined types **(PDOC-17)**
108
+ - Improved HMTL output that is more appropriate for Puppet code (especially for parameters)
109
+ - Support for the explicit list of YARD tags we will be supporting initially (@param, @return, @since, @example)
110
+ - Our own custom YARD templates which can be easily extended and tweaked
111
+
112
+ - Custom YARD templates for 3.x and 4.x functions **(PDOC-24)**
113
+ - Improved HMTL output that is more appropriate for listing several functions on one webpage in addition to being more consistent with the HTML produced for classes and defined types.
114
+ - Support for the explicit list of YARD tags we will be supporting initially (@param, @return, @since, @example)
115
+ - Our own custom YARD templates which can be easily extended and tweaked
116
+ - Addition of RubCop Travis CI job to ensure code quality and consistency **(PDOC-8)**
117
+
118
+ ####Bugfixes
119
+ - Puppet namespaces are no longer mangled for nested classes and defined types **(PDOC-25)**
120
+ - Strings is now compatible with the renaming of the Puppetx/puppetx namespace to PuppetX/puppet_x **(PDOC-26)**
121
+ - Strings will no longer crash when documenting 3x functions with less than two arguments passed into newfunction **(PDOC-27)**
122
+
@@ -0,0 +1,185 @@
1
+ Committing changes to Strings
2
+ ====
3
+
4
+ We would like to make it easier for community members to contribute to strings
5
+ using pull requests, even if it makes the task of reviewing and committing
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.
8
+ This makes the process of contributing a little easier for the contributor since
9
+ they don't need to concern themselves with the question, "What branch do I base my changes
10
+ on?" This is already called out in the [CONTRIBUTING.md](http://goo.gl/XRH2J).
11
+
12
+ Therefore, it is the responsibility of the committer to re-base the change set
13
+ on the appropriate branch which should receive the contribution.
14
+
15
+ It is also the responsibility of the committer to review the change set in an
16
+ effort to make sure the end users must opt-in to new behavior that is
17
+ incompatible with previous behavior. We employ the use of [feature
18
+ flags](http://stackoverflow.com/questions/7707383/what-is-a-feature-flag) as
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
21
+ is clean and working at all times. Clean means that dead code is not
22
+ allowed, everything needs to be usable in some manner at all points in time.
23
+
24
+ The rest of this document addresses the concerns of the committer. This
25
+ document will help guide the committer decide which branch to base, or re-base
26
+ a contribution on top of. This document also describes our branch management
27
+ strategy, which is closely related to the decision of what branch to commit
28
+ changes into.
29
+
30
+ Terminology
31
+ ====
32
+
33
+ Many of these terms have more than one meaning. For the purposes of this
34
+ document, the following terms refer to specific things.
35
+
36
+ **contributor** - A person who makes a change to strings and submits a change
37
+ set in the form of a pull request.
38
+
39
+ **change set** - A set of discrete patches which combined together form a
40
+ contribution. A change set takes the form of Git commits and is submitted to
41
+ strings in the form of a pull request.
42
+
43
+ **committer** - A person responsible for reviewing a pull request and then
44
+ making the decision what base branch to merge the change set into.
45
+
46
+ **base branch** - A branch in Git that contains an active history of changes
47
+ and will eventually be released using semantic version guidelines. The branch
48
+ named `master` will always exist as a base branch.
49
+
50
+ **master branch** - The branch where new functionality that and bug fixes are
51
+ merged.
52
+
53
+ **security** - Where critical security fixes are merged. These change sets
54
+ will then be merged into release branches independently from one another. (i.e.
55
+ no merging up). Please do not submit pull requests against the security branch
56
+ and instead report all security related issues to security@puppet.com as
57
+ per our security policy published at
58
+ [https://puppet.com/security/](https://puppet.com/security/).
59
+
60
+ Committer Guide
61
+ ====
62
+
63
+ This section provides a guide to follow while committing change sets to strings
64
+ base branches.
65
+
66
+ How to decide what release(s) should be patched
67
+ ---
68
+
69
+ This section provides a guide to help a committer decide the specific base
70
+ branch that a change set should be merged into.
71
+
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
74
+ functionality and if they fix a critical bug. Older minor releases in a major release
75
+ do not get patched.
76
+
77
+ Before the switch to [semantic versions](http://semver.org/) committers did not
78
+ have to think about the difference between minor and major releases.
79
+ Committing to the latest minor release of a major release is a policy intended
80
+ to limit the number of active base branches that must be managed.
81
+
82
+ Security patches are handled as a special case. Security patches may be
83
+ applied to earlier minor releases of a major release, but the patches should
84
+ first be merged into the `security` branch. Security patches should be merged
85
+ by Puppet Labs staff members. Pull requests should not be submitted with the
86
+ security branch as the base branch. Please send all security related
87
+ information or patches to security@puppet.com as per our [Security
88
+ Policy](https://puppet.com/security/).
89
+
90
+ The CI systems are configured to run against `master`. Over time, this branch
91
+ will refer to different versions, but its name will remain fixed to avoid having
92
+ to update CI jobs and tasks as new versions are released.
93
+
94
+ Code review checklist
95
+ ---
96
+
97
+ This section aims to provide a checklist of things to look for when reviewing a
98
+ pull request and determining if the change set should be merged into a base
99
+ branch:
100
+
101
+ * All tests pass
102
+ * Are there any platform gotchas? (Does a change make an assumption about
103
+ platform specific behavior that is incompatible with other platforms? e.g.
104
+ Windows paths vs. POSIX paths.)
105
+ * Is the change backwards compatible? (It should be)
106
+ * Are there YARD docs for API changes?
107
+ * Does the change set also require documentation changes? If so is the
108
+ documentation being kept up to date?
109
+ * Does the change set include clean code? (software code that is formatted
110
+ correctly and in an organized manner so that another coder can easily read
111
+ or modify it.) HINT: `git diff master --check`
112
+ * Does the change set conform to the contributing guide?
113
+
114
+ Commit citizen guidelines:
115
+ ---
116
+
117
+ This section aims to provide guidelines for being a good commit citizen by
118
+ paying attention to our automated build tools.
119
+
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/)
122
+ page.)
123
+ * Watch the build until your changes have gone through green
124
+ * Update the ticket status and target version. The target version field in
125
+ our issue tracker should be updated to be the next release of Puppet. For
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
128
+ be 3.2.0 in the issue tracker.)
129
+ * Ensure the pull request is closed (Hint: amend your merge commit to contain
130
+ the string `closes #123` where 123 is the pull request number and github
131
+ will automatically close the pull request when the branch is pushed.)
132
+
133
+ Example Procedure
134
+ ====
135
+
136
+ This section helps a committer rebase and merge a contribution into the base branch.
137
+
138
+ Suppose a contributor submits a pull request based on master. The change set
139
+ fixes a bug reported against strings 0.1.0 which is the most recently released
140
+ version of strings.
141
+
142
+ First, the committer pulls down the branch using the `hub` gem. This tool
143
+ automates the process of adding the remote repository and creating a local
144
+ branch to track the remote branch.
145
+
146
+ $ hub checkout https://github.com/puppetlabs/puppet-strings/pull/123
147
+ Branch jeffmccune-pdoc-34_fix_foo_error set up to track remote branch pdoc-34-fix_foo_error from jeffmccune.
148
+ Switched to a new branch 'jeffmccune-pdoc-34_fix_foo_error'
149
+
150
+ It's possible that more changes have been merged into master since the pull
151
+ request was submitted. In this case it may be necessary to rebase the branch
152
+ that contains the changes:
153
+
154
+ $ git rebase upstream/master
155
+
156
+ After the branch has been checked out and rebased, the committer should ensure that
157
+ the code review check list has been completed.
158
+
159
+ Now that we have a topic branch containing the change set based on the most recent
160
+ `master` branch, the committer merges in:
161
+
162
+ $ git checkout master
163
+ Switched to branch 'master'
164
+ $ git merge --no-ff --log jeffmccune-pdoc-34_fix_foo_error
165
+ Merge made by the 'recursive' strategy.
166
+ foo | 0
167
+ 1 file changed, 0 insertions(+), 0 deletions(-)
168
+ create mode 100644 foo
169
+
170
+ Once the change set has been merged into one base branch, the change set should
171
+ not be modified in order to keep the history clean, avoid "double" commits, and
172
+ preserve the usefulness of `git branch --contains`. If there are any merge
173
+ conflicts, they are to be resolved in the merge commit itself and not by
174
+ re-writing (rebasing) the patches for one base branch, but not another.
175
+
176
+ Once the change set has been merged into `master`, the committer pushes.
177
+ Please note, the checklist should be complete at this point. It's helpful to make
178
+ sure your local branches are up to date to avoid one of the branches failing to fast
179
+ forward while the other succeeds.
180
+
181
+ $ git push origin master:master
182
+
183
+ That's it! The committer then updates the pull request, updates the issue in
184
+ our issue tracker, and keeps an eye on the [build
185
+ status](http://jenkins.puppetlabs.com).
@@ -0,0 +1,89 @@
1
+ # How to contribute
2
+
3
+ Third-party patches are essential for keeping strings great. We want to keep it
4
+ as easy as possible to contribute changes that get things working in your
5
+ environment. There are a few guidelines that we need contributors to follow so
6
+ that we can have a chance of keeping on top of things.
7
+
8
+ ## Getting Started
9
+
10
+ * Make sure you have a [Jira account](http://tickets.puppetlabs.com)
11
+ * Make sure you have a [GitHub account](https://github.com/signup/free)
12
+ * Submit a ticket for your issue, assuming one does not already exist.
13
+ * Clearly describe the issue including steps to reproduce when it is a bug.
14
+ * Make sure you fill in the earliest version that you know has the issue.
15
+ * Fork the repository on GitHub
16
+
17
+ ## Making Changes
18
+
19
+ * Create a topic branch from where you want to base your work.
20
+ * This is usually the master branch.
21
+ * Only target release branches if you are certain your fix must be on that
22
+ branch.
23
+ * To quickly create a topic branch based on master; `git checkout -b
24
+ fix/master/my_contribution master`. Please avoid working directly on the
25
+ `master` branch.
26
+ * Make commits of logical units.
27
+ * Check for unnecessary whitespace with `git diff --check` before committing.
28
+ * Make sure your commit messages are in the proper format.
29
+
30
+ ````
31
+ (PDOC-123) Make the example in CONTRIBUTING imperative and concrete
32
+
33
+ Without this patch applied the example commit message in the CONTRIBUTING
34
+ document is not a concrete example. This is a problem because the
35
+ contributor is left to imagine what the commit message should look like
36
+ based on a description rather than an example. This patch fixes the
37
+ problem by making the example concrete and imperative.
38
+
39
+ The first line is a real life imperative statement with a ticket number
40
+ from our issue tracker. The body describes the behavior without the patch,
41
+ why this is a problem, and how the patch fixes the problem when applied.
42
+ ````
43
+
44
+ * Make sure you have added the necessary tests for your changes.
45
+ * Run _all_ the tests to assure nothing else was accidentally broken.
46
+
47
+ ## Making Trivial Changes
48
+
49
+ ### Documentation
50
+
51
+ For changes of a trivial nature to comments and documentation, it is not
52
+ always necessary to create a new ticket in Jira. In this case, it is
53
+ appropriate to start the first line of a commit with '(doc)' instead of
54
+ a ticket number.
55
+
56
+ ````
57
+ (doc) Add documentation commit example to CONTRIBUTING
58
+
59
+ There is no example for contributing a documentation commit
60
+ to the Puppet repository. This is a problem because the contributor
61
+ is left to assume how a commit of this nature may appear.
62
+
63
+ The first line is a real life imperative statement with '(doc)' in
64
+ place of what would have been the ticket number in a
65
+ non-documentation related commit. The body describes the nature of
66
+ the new documentation or comments added.
67
+ ````
68
+
69
+ ## Submitting Changes
70
+
71
+ * Sign the [Contributor License Agreement](http://links.puppet.com/cla).
72
+ * Push your changes to a topic branch in your fork of the repository.
73
+ * Submit a pull request to the repository in the puppetlabs organization.
74
+ * Update your Jira ticket to mark that you have submitted code and are ready for it to be reviewed (Status: Ready for Merge).
75
+ * Include a link to the pull request in the ticket.
76
+ * The core team looks at Pull Requests on a regular basis in a weekly triage
77
+ meeting that we hold in a public Google Hangout. The hangout is announced in
78
+ the weekly status updates that are sent to the puppet-dev list.
79
+ * After feedback has been given we expect responses within two weeks. After two
80
+ weeks will may close the pull request if it isn't showing any activity.
81
+
82
+ # Additional Resources
83
+
84
+ * [More information on contributing](http://links.puppet.com/contribute-to-puppet)
85
+ * [Bug tracker (Jira)](http://tickets.puppetlabs.com)
86
+ * [Contributor License Agreement](http://links.puppet.com/cla)
87
+ * [General GitHub documentation](http://help.github.com/)
88
+ * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
89
+ * #puppet-dev IRC channel on freenode.org
data/Gemfile ADDED
@@ -0,0 +1,38 @@
1
+ source ENV['GEM_SOURCE'] || "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'rgen'
6
+ gem 'redcarpet'
7
+ gem 'yard', '~> 0.9.5'
8
+
9
+ puppetversion = ENV['PUPPET_VERSION']
10
+
11
+ if puppetversion
12
+ gem 'puppet', puppetversion
13
+ else
14
+ gem 'puppet'
15
+ end
16
+
17
+ group :test do
18
+ gem "rspec", "~> 3.1"
19
+ gem 'mocha'
20
+ gem 'puppetlabs_spec_helper'
21
+ gem 'serverspec'
22
+ gem 'rubocop', '~> 0.41.0'
23
+ end
24
+
25
+ group :acceptance do
26
+ gem 'beaker', '< 3.0'
27
+ gem 'beaker-rspec'
28
+ gem 'beaker-hostgenerator'
29
+ end
30
+
31
+ group :development do
32
+ gem 'pry'
33
+ if RUBY_VERSION[0..2] == '1.9'
34
+ gem 'pry-debugger'
35
+ elsif RUBY_VERSION[0] == '2'
36
+ gem 'pry-byebug'
37
+ end
38
+ end