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
metadata CHANGED
@@ -1,120 +1,143 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-strings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.99.0
5
5
  platform: ruby
6
6
  authors:
7
- - Puppet Labs
7
+ - Puppet Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: puppet
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 3.7.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: 3.7.0
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: yard
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: '0.8'
19
+ version: 0.9.5
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: '0.8'
26
+ version: 0.9.5
41
27
  description: Puppet documentation via YARD
42
- email: info@puppetlabs.com
28
+ email: info@puppet.com
43
29
  executables: []
44
30
  extensions: []
45
- extra_rdoc_files: []
31
+ extra_rdoc_files:
32
+ - CHANGELOG.md
33
+ - COMMITTERS.md
34
+ - CONTRIBUTING.md
35
+ - LICENSE
36
+ - README.md
46
37
  files:
47
- - lib/puppet-strings/rake_tasks.rb
38
+ - CHANGELOG.md
39
+ - COMMITTERS.md
40
+ - CONTRIBUTING.md
41
+ - Gemfile
42
+ - JSON.md
43
+ - LICENSE
44
+ - README.md
45
+ - Rakefile
46
+ - lib/puppet-strings.rb
47
+ - lib/puppet-strings/json.rb
48
+ - lib/puppet-strings/tasks.rb
49
+ - lib/puppet-strings/tasks/generate.rb
50
+ - lib/puppet-strings/tasks/gh_pages.rb
51
+ - lib/puppet-strings/yard.rb
52
+ - lib/puppet-strings/yard/code_objects.rb
53
+ - lib/puppet-strings/yard/code_objects/base.rb
54
+ - lib/puppet-strings/yard/code_objects/class.rb
55
+ - lib/puppet-strings/yard/code_objects/defined_type.rb
56
+ - lib/puppet-strings/yard/code_objects/function.rb
57
+ - lib/puppet-strings/yard/code_objects/group.rb
58
+ - lib/puppet-strings/yard/code_objects/provider.rb
59
+ - lib/puppet-strings/yard/code_objects/type.rb
60
+ - lib/puppet-strings/yard/handlers.rb
61
+ - lib/puppet-strings/yard/handlers/puppet/base.rb
62
+ - lib/puppet-strings/yard/handlers/puppet/class_handler.rb
63
+ - lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb
64
+ - lib/puppet-strings/yard/handlers/puppet/function_handler.rb
65
+ - lib/puppet-strings/yard/handlers/ruby/base.rb
66
+ - lib/puppet-strings/yard/handlers/ruby/function_handler.rb
67
+ - lib/puppet-strings/yard/handlers/ruby/provider_handler.rb
68
+ - lib/puppet-strings/yard/handlers/ruby/type_handler.rb
69
+ - lib/puppet-strings/yard/parsers.rb
70
+ - lib/puppet-strings/yard/parsers/puppet/parser.rb
71
+ - lib/puppet-strings/yard/parsers/puppet/statement.rb
72
+ - lib/puppet-strings/yard/tags.rb
73
+ - lib/puppet-strings/yard/tags/overload_tag.rb
74
+ - lib/puppet-strings/yard/tags/parameter_directive.rb
75
+ - lib/puppet-strings/yard/tags/property_directive.rb
76
+ - lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_class.erb
77
+ - lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_defined_type.erb
78
+ - lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_function.erb
79
+ - lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb
80
+ - lib/puppet-strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb
81
+ - lib/puppet-strings/yard/templates/default/fulldoc/html/setup.rb
82
+ - lib/puppet-strings/yard/templates/default/layout/html/objects.erb
83
+ - lib/puppet-strings/yard/templates/default/layout/html/setup.rb
84
+ - lib/puppet-strings/yard/templates/default/puppet_class/html/box_info.erb
85
+ - lib/puppet-strings/yard/templates/default/puppet_class/html/header.erb
86
+ - lib/puppet-strings/yard/templates/default/puppet_class/html/overview.erb
87
+ - lib/puppet-strings/yard/templates/default/puppet_class/html/setup.rb
88
+ - lib/puppet-strings/yard/templates/default/puppet_class/html/source.erb
89
+ - lib/puppet-strings/yard/templates/default/puppet_defined_type/html/box_info.erb
90
+ - lib/puppet-strings/yard/templates/default/puppet_defined_type/html/header.erb
91
+ - lib/puppet-strings/yard/templates/default/puppet_defined_type/html/overview.erb
92
+ - lib/puppet-strings/yard/templates/default/puppet_defined_type/html/setup.rb
93
+ - lib/puppet-strings/yard/templates/default/puppet_defined_type/html/source.erb
94
+ - lib/puppet-strings/yard/templates/default/puppet_function/html/box_info.erb
95
+ - lib/puppet-strings/yard/templates/default/puppet_function/html/header.erb
96
+ - lib/puppet-strings/yard/templates/default/puppet_function/html/overview.erb
97
+ - lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb
98
+ - lib/puppet-strings/yard/templates/default/puppet_function/html/source.erb
99
+ - lib/puppet-strings/yard/templates/default/puppet_provider/html/box_info.erb
100
+ - lib/puppet-strings/yard/templates/default/puppet_provider/html/collection.erb
101
+ - lib/puppet-strings/yard/templates/default/puppet_provider/html/features.erb
102
+ - lib/puppet-strings/yard/templates/default/puppet_provider/html/header.erb
103
+ - lib/puppet-strings/yard/templates/default/puppet_provider/html/overview.erb
104
+ - lib/puppet-strings/yard/templates/default/puppet_provider/html/setup.rb
105
+ - lib/puppet-strings/yard/templates/default/puppet_type/html/box_info.erb
106
+ - lib/puppet-strings/yard/templates/default/puppet_type/html/features.erb
107
+ - lib/puppet-strings/yard/templates/default/puppet_type/html/header.erb
108
+ - lib/puppet-strings/yard/templates/default/puppet_type/html/overview.erb
109
+ - lib/puppet-strings/yard/templates/default/puppet_type/html/parameters.erb
110
+ - lib/puppet-strings/yard/templates/default/puppet_type/html/setup.rb
111
+ - lib/puppet-strings/yard/templates/default/tags/html/puppet_overload.erb
112
+ - lib/puppet-strings/yard/templates/default/tags/setup.rb
48
113
  - lib/puppet/application/strings.rb
49
114
  - lib/puppet/face/strings.rb
50
115
  - lib/puppet/feature/rgen.rb
51
116
  - lib/puppet/feature/yard.rb
52
- - lib/puppet_x/puppetlabs/strings.rb
53
- - lib/puppet_x/puppetlabs/strings/actions.rb
54
- - lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb
55
- - lib/puppet_x/puppetlabs/strings/pops/yard_transformer.rb
56
- - lib/puppet_x/puppetlabs/strings/util.rb
57
- - lib/puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object.rb
58
- - lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb
59
- - lib/puppet_x/puppetlabs/strings/yard/code_objects/method_object.rb
60
- - lib/puppet_x/puppetlabs/strings/yard/code_objects/provider_object.rb
61
- - lib/puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object.rb
62
- - lib/puppet_x/puppetlabs/strings/yard/code_objects/type_object.rb
63
- - lib/puppet_x/puppetlabs/strings/yard/core_ext/yard.rb
64
- - lib/puppet_x/puppetlabs/strings/yard/handlers/base.rb
65
- - lib/puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler.rb
66
- - lib/puppet_x/puppetlabs/strings/yard/handlers/heredoc_helper.rb
67
- - lib/puppet_x/puppetlabs/strings/yard/handlers/host_class_handler.rb
68
- - lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb
69
- - lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb
70
- - lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb
71
- - lib/puppet_x/puppetlabs/strings/yard/handlers/type_handler.rb
72
- - lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb
73
- - lib/puppet_x/puppetlabs/strings/yard/monkey_patches.rb
74
- - lib/puppet_x/puppetlabs/strings/yard/parser.rb
75
- - lib/puppet_x/puppetlabs/strings/yard/tags/directives.rb
76
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/docstring.erb
77
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/header.erb
78
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/parameter_details.erb
79
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/setup.rb
80
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb
81
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_class.erb
82
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_manifest.erb
83
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb
84
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb
85
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb
86
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/setup.rb
87
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/box_info.erb
88
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/setup.rb
89
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/subclasses.erb
90
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/setup.rb
91
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/html_helper.rb
92
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/layout/html/setup.rb
93
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/html/header.erb
94
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/setup.rb
95
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/text/header.erb
96
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/command_details.erb
97
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/confine_details.erb
98
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/default_details.erb
99
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/docstring.erb
100
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/feature_details.erb
101
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/header.erb
102
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/setup.rb
103
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/setup.rb
104
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/box_info.erb
105
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/header.erb
106
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_details_list.erb
107
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb
108
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/setup.rb
109
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb
110
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/template_helper.rb
111
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/docstring.erb
112
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/header.erb
113
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/parameter_details.erb
114
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/provider_details.erb
115
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/setup.rb
116
- - lib/puppet_x/puppetlabs/strings/yard/templates/default/type/setup.rb
117
- homepage: https://github.com/puppetlabs/puppetlabs-strings
117
+ - spec/acceptance/emit_json_options.rb
118
+ - spec/acceptance/lib/util.rb
119
+ - spec/acceptance/running_strings_generate.rb
120
+ - spec/fixtures/acceptance/modules/test/functions/add.pp
121
+ - spec/fixtures/acceptance/modules/test/lib/puppet/functions/4x_function.rb
122
+ - spec/fixtures/acceptance/modules/test/lib/puppet/parser/functions/function3x.rb
123
+ - spec/fixtures/acceptance/modules/test/lib/puppet/provider/server/linux.rb
124
+ - spec/fixtures/acceptance/modules/test/lib/puppet/type/database.rb
125
+ - spec/fixtures/acceptance/modules/test/manifests/init.pp
126
+ - spec/fixtures/acceptance/modules/test/manifests/triple_nested_classes.pp
127
+ - spec/fixtures/acceptance/modules/test/metadata.json
128
+ - spec/fixtures/unit/json/output.json
129
+ - spec/fixtures/unit/json/output_without_puppet_function.json
130
+ - spec/spec_helper.rb
131
+ - spec/spec_helper_acceptance.rb
132
+ - spec/unit/puppet-strings/json_spec.rb
133
+ - spec/unit/puppet-strings/yard/handlers/puppet/class_handler_spec.rb
134
+ - spec/unit/puppet-strings/yard/handlers/puppet/defined_type_handler_spec.rb
135
+ - spec/unit/puppet-strings/yard/handlers/puppet/function_handler_spec.rb
136
+ - spec/unit/puppet-strings/yard/handlers/ruby/function_handler_spec.rb
137
+ - spec/unit/puppet-strings/yard/handlers/ruby/provider_handler_spec.rb
138
+ - spec/unit/puppet-strings/yard/handlers/ruby/type_handler_spec.rb
139
+ - spec/unit/puppet-strings/yard/parsers/puppet/parser_spec.rb
140
+ homepage: https://github.com/puppetlabs/puppet-strings
118
141
  licenses:
119
142
  - Apache-2.0
120
143
  metadata: {}
@@ -126,17 +149,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
149
  requirements:
127
150
  - - ">="
128
151
  - !ruby/object:Gem::Version
129
- version: '0'
152
+ version: 1.9.3
130
153
  required_rubygems_version: !ruby/object:Gem::Requirement
131
154
  requirements:
132
155
  - - ">="
133
156
  - !ruby/object:Gem::Version
134
157
  version: '0'
135
- requirements: []
158
+ requirements:
159
+ - puppet, >= 3.7.0
136
160
  rubyforge_project:
137
- rubygems_version: 2.4.5
161
+ rubygems_version: 2.2.3
138
162
  signing_key:
139
163
  specification_version: 4
140
164
  summary: Puppet documentation via YARD
141
165
  test_files: []
142
- has_rdoc:
@@ -1,18 +0,0 @@
1
- require 'rake'
2
- require 'rake/tasklib'
3
- require 'puppet/face'
4
- require 'puppet_x/puppetlabs/strings/util'
5
-
6
- namespace :strings do
7
- desc 'Generate Puppet documentation with YARD.'
8
- task :generate do
9
- PuppetX::PuppetLabs::Strings::Util.generate([
10
- {emit_json: 'strings.json'}
11
- ])
12
- end
13
-
14
- desc 'Serve YARD documentation for modules.'
15
- task :serve do
16
- PuppetX::PuppetLabs::Strings::Util.serve
17
- end
18
- end
@@ -1,64 +0,0 @@
1
- require 'puppet'
2
- require 'puppet/pops'
3
- require 'puppet/util/docs'
4
- require 'yard'
5
-
6
- module PuppetX
7
- end
8
-
9
- # Nothing to see here except forward declarations.
10
- module PuppetX::PuppetLabs
11
- module Strings
12
- # This submodule contains bits that operate on the Pops module produced by
13
- # the Future parser.
14
- module Pops
15
- require 'puppet_x/puppetlabs/strings/pops/yard_statement'
16
- require 'puppet_x/puppetlabs/strings/pops/yard_transformer'
17
- end
18
-
19
- # This submodule contains bits that interface with the YARD plugin system.
20
- module YARD
21
- require 'puppet_x/puppetlabs/strings/yard/monkey_patches'
22
- require 'puppet_x/puppetlabs/strings/yard/parser'
23
-
24
- module Tags
25
- require 'puppet_x/puppetlabs/strings/yard/tags/directives'
26
- end
27
-
28
- # This submodule contains code objects which are used to represent relevant
29
- # aspects of puppet code in YARD's Registry
30
- module CodeObjects
31
- require 'puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object'
32
- require 'puppet_x/puppetlabs/strings/yard/code_objects/method_object'
33
- require 'puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object'
34
- require 'puppet_x/puppetlabs/strings/yard/code_objects/host_class_object'
35
- require 'puppet_x/puppetlabs/strings/yard/code_objects/type_object'
36
- require 'puppet_x/puppetlabs/strings/yard/code_objects/provider_object'
37
- end
38
-
39
- # This submodule contains handlers which are used to extract relevant data about
40
- # puppet code from the ASTs produced by the Ruby and Puppet parsers
41
- module Handlers
42
- # This utility library contains some tools for working with Puppet docstrings
43
- require 'puppet_x/puppetlabs/strings/yard/handlers/base'
44
- require 'puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler'
45
- require 'puppet_x/puppetlabs/strings/yard/handlers/host_class_handler'
46
- require 'puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler'
47
- require 'puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler'
48
- require 'puppet_x/puppetlabs/strings/yard/handlers/type_handler'
49
- require 'puppet_x/puppetlabs/strings/yard/handlers/provider_handler'
50
- end
51
-
52
- ::YARD::Parser::SourceParser.register_parser_type(:puppet,
53
- PuppetX::PuppetLabs::Strings::YARD::PuppetParser,
54
- ['pp'])
55
- ::YARD::Handlers::Processor.register_handler_namespace(:puppet,
56
- PuppetX::PuppetLabs::Strings::YARD::Handlers)
57
-
58
- # FIXME: Might not be the best idea to have the template code on the Ruby
59
- # LOAD_PATH as the contents of this directory really aren't library code.
60
- ::YARD::Templates::Engine.register_template_path(
61
- File.join(File.dirname(__FILE__), 'strings', 'yard', 'templates'))
62
- end
63
- end
64
- end
@@ -1,92 +0,0 @@
1
- require 'puppet_x/puppetlabs/strings'
2
-
3
- class PuppetX::PuppetLabs::Strings::Actions
4
-
5
- # Creates a new instance of the Actions class by determining
6
- # whether or not debug and backtrace arguments should be sent
7
- # to YARD
8
- def initialize(puppet_debug, puppet_backtrace)
9
- @debug = puppet_debug
10
- @backtrace = puppet_backtrace
11
- end
12
-
13
- # Holds the name of a module and the file path to its YARD index
14
- ModuleIndex = Struct.new(:name, :index_path)
15
-
16
-
17
- # Maps things like the Puppet `--debug` flag to YARD options.
18
- def merge_puppet_args!(yard_args)
19
- yard_args.unshift '--debug' if @debug
20
- yard_args.unshift '--backtrace' if @backtrace
21
-
22
- yard_args
23
- end
24
-
25
- # Builds doc indices (.yardoc directories) for modules.
26
- # Currently lacks the fine-grained control over where these
27
- # indices are created and just dumps them in the module roots.
28
- #
29
- # @return [Array<Module>] the modules to be documented
30
- #
31
- # @param [Array<String>] module_names a list of the module source files
32
- # @param [Array<String>] module_sourcefiles default list of module files
33
- def index_documentation_for_modules(module_names, module_sourcefiles)
34
- # NOTE: The return value of the `module` Face seems to have changed in
35
- # 3.6.x. This part of the code will blow up if run under an earlier
36
- # version of Puppet.
37
- modules = Puppet::Face[:module, :current].list
38
- module_list = modules[:modules_by_path].values.flatten
39
-
40
- module_list.select! {|m| module_names.include? m.name} unless module_names.empty?
41
-
42
- # Invoke `yardoc` with -n so that it doesn't generate any HTML output but
43
- # does build a `.yardoc` index that other tools can generate output from.
44
- yard_args = %w[--no-stats -n] + module_sourcefiles
45
- merge_puppet_args!(yard_args)
46
-
47
- module_list.each do |m|
48
- Dir.chdir(m.path) do
49
- YARD::CLI::Yardoc.run(*yard_args)
50
-
51
- # Clear the global Registry so that objects from one module don't
52
- # bleed into the next.
53
- YARD::Registry.clear
54
- end
55
- end
56
- end
57
-
58
- # Extracts the needed information of the modules we're documenting
59
- #
60
- # @return [Array<ModuleIndex>] An array of representation of the modules
61
- # to produce documentation for. Each ModuleIndex contains the module name
62
- # and the path to its YARD index
63
- #
64
- # @param [Array<String>] module_list a list of the module source files
65
- def generate_module_tuples(module_list)
66
- module_list.map do |mod|
67
- name = (mod.forge_name || mod.name).gsub('/', '-')
68
- yard_index = File.join(mod.path, '.yardoc')
69
-
70
- ModuleIndex.new(name, yard_index)
71
- end
72
- end
73
-
74
- # Hands off the needed information to YARD so it may
75
- # serve the documentation
76
- #
77
- # @param [Array<String>] yard_args a list of all the arguments to pass to YARD
78
- def serve_documentation(*yard_args)
79
- merge_puppet_args!(yard_args)
80
- YARD::CLI::Server.run(*yard_args)
81
- end
82
-
83
- # Hands off the needed information to YARD so it may
84
- # generate the documentation
85
- #
86
- # @param [Array<String>] yard_args a list of all the arguments to pass to YARD
87
- def generate_documentation(*yard_args)
88
- merge_puppet_args!(yard_args)
89
- YARD::CLI::Yardoc.run(*yard_args)
90
- end
91
- end
92
-
@@ -1,79 +0,0 @@
1
- require 'ostruct'
2
-
3
- # An adapter class that conforms a Pops model instance + adapters to the
4
- # interface expected by YARD handlers.
5
- #
6
- # FIXME: Inhertiting from OpenStruct is a bit of a hack. It allows attributes
7
- # to be declared as needed but in the long run understandibility of the code
8
- # would be improved by having a concrete model.
9
- class PuppetX::PuppetLabs::Strings::Pops::YARDStatement < OpenStruct
10
- attr_reader :pops_obj, :comments
11
-
12
- def initialize(pops_obj)
13
- # Initialize OpenStruct
14
- super({})
15
-
16
- unless pops_obj.is_a? Puppet::Pops::Model::PopsObject
17
- raise ArgumentError, "A YARDStatement can only be initialized from a PopsObject. Got a: #{pops_obj.class}"
18
- end
19
-
20
- @pops_obj = pops_obj
21
- @pos_adapter = Puppet::Pops::Adapters::SourcePosAdapter.adapt(@pops_obj)
22
- # FIXME: Perhaps this should be a seperate adapter?
23
- @comments = extract_comments
24
- end
25
-
26
- def type
27
- pops_obj.class
28
- end
29
-
30
- def line
31
- @line ||= @pos_adapter.line
32
- end
33
-
34
- def source
35
- @source ||= @pos_adapter.extract_text
36
- end
37
-
38
- # FIXME: I don't know quite what these are supposed to do, but they show up
39
- # quite often in the YARD handler code. Figure out whether they are
40
- # necessary.
41
- alias_method :show, :source
42
- def comments_hash_flag; nil end
43
- def comments_range; nil end
44
-
45
- private
46
- # TODO: This stuff should probably be part of a separate class/adapter.
47
- COMMENT_PATTERN = /^\s*#.*\n/
48
-
49
- def extract_comments
50
- comments = []
51
- program = pops_obj.eAllContainers.find {|c| c.is_a?(Puppet::Pops::Model::Program) }
52
- # FIXME: Horribly inefficient. Multiple copies. Generator pattern would
53
- # be much better.
54
- source_text = program.source_text.lines.to_a
55
-
56
- source_text.slice(0, line-1).reverse.each do |line|
57
- if COMMENT_PATTERN.match(line)
58
- # FIXME: The gsub trims comments, but is extremely optimistic: It
59
- # assumes only one space separates the comment body from the
60
- # comment character.
61
- # NOTE: We cannot just trim any amount of whitespace as indentation
62
- # is sometimes significant in markdown. We would need a real parser.
63
-
64
- # Comments which begin with some whitespace, a hash and then some
65
- # tabs and spaces should be scrubbed. Comments which just have a
66
- # solitary hash then a newline should keep that newline since newlines
67
- # are significant in markdown.
68
- comments.unshift line.gsub(/^\s*#[\t ]/, '').gsub(/^\s*#\n/, "\n")
69
- else
70
- # No comment found on this line. We must be done piecing together a
71
- # comment block.
72
- break
73
- end
74
- end
75
-
76
- # Stick everything back together.
77
- comments.join
78
- end
79
- end