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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yard/tags/option_tag'
2
4
 
3
5
  # Implements an enum tag for describing enumerated value data types
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yard/tags/default_factory'
2
4
  require 'puppet-strings/yard/tags/enum_tag'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Implements an overload tag for Puppet functions
2
4
  #
3
5
  # This differs from Yard's overload tag in that the signatures are formatted according to Puppet language rules.
@@ -22,7 +24,7 @@ class PuppetStrings::Yard::Tags::OverloadTag < YARD::Tags::Tag
22
24
  args = @parameters.map do |parameter|
23
25
  name, default = parameter
24
26
  tag = tags.find { |t| t.name == name } if tags
25
- type = tag && tag.types ? "#{tag.type} " : 'Any '
27
+ type = tag&.types ? "#{tag.type} " : 'Any '
26
28
  prefix = "#{name[0]}" if name.start_with?('*', '&')
27
29
  name = name[1..-1] if prefix
28
30
  default = " = #{default}" if default
@@ -75,6 +77,7 @@ class PuppetStrings::Yard::Tags::OverloadTag < YARD::Tags::Tag
75
77
  # @return Returns what the method call on the object would return.
76
78
  def method_missing(method_name, *args, &block)
77
79
  return object.send(method_name, *args, &block) if object.respond_to? method_name
80
+
78
81
  super
79
82
  end
80
83
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/yard/code_objects'
2
4
 
3
5
  # Implements a parameter directive (e.g. #@!puppet.type.param) for documenting Puppet resource types.
@@ -5,14 +7,13 @@ class PuppetStrings::Yard::Tags::ParameterDirective < YARD::Tags::Directive
5
7
  # Called to invoke the directive.
6
8
  # @return [void]
7
9
  def call
8
- return unless object && object.respond_to?(:add_parameter)
10
+ return unless object&.respond_to?(:add_parameter)
11
+
9
12
  # Add a parameter to the resource
10
13
  parameter = PuppetStrings::Yard::CodeObjects::Type::Parameter.new(tag.name, tag.text)
11
- if tag.types
12
- tag.types.each do |value|
14
+ tag.types&.each do |value|
13
15
  parameter.add(value)
14
16
  end
15
- end
16
17
  object.add_parameter parameter
17
18
  end
18
19
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet-strings/yard/code_objects'
2
4
 
3
5
  # Implements a parameter directive (e.g. #@!puppet.type.property) for documenting Puppet resource types.
@@ -5,14 +7,13 @@ class PuppetStrings::Yard::Tags::PropertyDirective < YARD::Tags::Directive
5
7
  # Called to invoke the directive.
6
8
  # @return [void]
7
9
  def call
8
- return unless object && object.respond_to?(:add_property)
10
+ return unless object&.respond_to?(:add_property)
11
+
9
12
  # Add a property to the resource
10
13
  property = PuppetStrings::Yard::CodeObjects::Type::Property.new(tag.name, tag.text)
11
- if tag.types
12
- tag.types.each do |value|
14
+ tag.types&.each do |value|
13
15
  property.add(value)
14
16
  end
15
- end
16
17
  object.add_property property
17
18
  end
18
19
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Implements a summary tag for general purpose short descriptions
2
4
 
3
5
  class PuppetStrings::Yard::Tags::SummaryTag < YARD::Tags::Tag
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # The module for custom YARD tags.
2
4
  module PuppetStrings::Yard::Tags
3
5
  require 'puppet-strings/yard/tags/factory'
@@ -1,5 +1,5 @@
1
1
  # Initializes the template.
2
2
  # @return [void]
3
3
  def init
4
- sections :header, :box_info, :summary, :overview, :note, :todo, [T('tags'), :source]
4
+ sections :header, :box_info, :summary, :overview, [:note, :todo, T('tags'), :source]
5
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'puppet/util'
2
4
 
3
5
  # The module for various puppet-strings utility helpers.
@@ -24,8 +26,9 @@ module PuppetStrings::Yard::Util
24
26
  # @return [String] HTML document with links converted
25
27
  def self.github_to_yard_links(data)
26
28
  data.scan(/href\=\"\#(.+)\"/).each do |bad_link|
27
- data.gsub!("=\"##{bad_link.first}\"", "=\"#label-#{bad_link.first.capitalize.gsub('-', '+')}\"")
29
+ data = data.gsub("=\"##{bad_link.first}\"", "=\"#label-#{bad_link.first.capitalize.gsub('-', '+')}\"")
28
30
  end
31
+
29
32
  data
30
33
  end
31
34
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yard'
2
4
 
3
5
  # Module for YARD related functionality.
@@ -102,6 +104,7 @@ class YARD::CLI::Stats
102
104
 
103
105
  def stats_for_puppet_plans
104
106
  return unless PuppetStrings.puppet_5?
107
+
105
108
  output 'Puppet Plans', *type_statistics_all(:puppet_plan)
106
109
  end
107
110
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # The root module for Puppet Strings.
2
4
  module PuppetStrings
3
5
  # The glob patterns used to search for files to document.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-strings
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-16 00:00:00.000000000 Z
11
+ date: 2021-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -85,6 +85,7 @@ files:
85
85
  - lib/puppet-strings/tasks.rb
86
86
  - lib/puppet-strings/tasks/generate.rb
87
87
  - lib/puppet-strings/tasks/gh_pages.rb
88
+ - lib/puppet-strings/tasks/validate.rb
88
89
  - lib/puppet-strings/version.rb
89
90
  - lib/puppet-strings/yard.rb
90
91
  - lib/puppet-strings/yard/code_objects.rb
@@ -227,7 +228,7 @@ homepage: https://github.com/puppetlabs/puppet-strings
227
228
  licenses:
228
229
  - Apache-2.0
229
230
  metadata: {}
230
- post_install_message:
231
+ post_install_message:
231
232
  rdoc_options: []
232
233
  require_paths:
233
234
  - lib
@@ -235,16 +236,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
235
236
  requirements:
236
237
  - - ">="
237
238
  - !ruby/object:Gem::Version
238
- version: 2.1.0
239
+ version: 2.3.0
239
240
  required_rubygems_version: !ruby/object:Gem::Requirement
240
241
  requirements:
241
242
  - - ">="
242
243
  - !ruby/object:Gem::Version
243
244
  version: '0'
244
245
  requirements:
245
- - puppet, >= 4.0.0
246
- rubygems_version: 3.0.4
247
- signing_key:
246
+ - puppet, >= 5.0.0
247
+ rubygems_version: 3.1.6
248
+ signing_key:
248
249
  specification_version: 4
249
250
  summary: Puppet documentation via YARD
250
251
  test_files: []