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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +90 -4
- data/COMMITTERS.md +17 -17
- data/CONTRIBUTING.md +6 -6
- data/README.md +10 -10
- data/lib/puppet/application/strings.rb +2 -0
- data/lib/puppet/face/strings.rb +4 -1
- data/lib/puppet/feature/rgen.rb +2 -0
- data/lib/puppet/feature/yard.rb +2 -0
- data/lib/puppet-strings/describe.rb +2 -0
- data/lib/puppet-strings/json.rb +2 -0
- data/lib/puppet-strings/markdown/base.rb +11 -3
- data/lib/puppet-strings/markdown/data_type.rb +2 -0
- data/lib/puppet-strings/markdown/data_types.rb +3 -1
- data/lib/puppet-strings/markdown/defined_type.rb +2 -0
- data/lib/puppet-strings/markdown/defined_types.rb +3 -1
- data/lib/puppet-strings/markdown/function.rb +9 -7
- data/lib/puppet-strings/markdown/functions.rb +3 -1
- data/lib/puppet-strings/markdown/puppet_class.rb +2 -0
- data/lib/puppet-strings/markdown/puppet_classes.rb +3 -1
- data/lib/puppet-strings/markdown/puppet_plan.rb +2 -0
- data/lib/puppet-strings/markdown/puppet_plans.rb +3 -1
- data/lib/puppet-strings/markdown/puppet_task.rb +2 -0
- data/lib/puppet-strings/markdown/puppet_tasks.rb +3 -1
- data/lib/puppet-strings/markdown/resource_type.rb +2 -0
- data/lib/puppet-strings/markdown/resource_types.rb +3 -1
- data/lib/puppet-strings/markdown/table_of_contents.rb +3 -1
- data/lib/puppet-strings/markdown/templates/classes_and_defines.erb +7 -3
- data/lib/puppet-strings/markdown/templates/data_type.erb +12 -4
- data/lib/puppet-strings/markdown/templates/data_type_function.erb +1 -1
- data/lib/puppet-strings/markdown/templates/function.erb +1 -1
- data/lib/puppet-strings/markdown/templates/puppet_task.erb +1 -1
- data/lib/puppet-strings/markdown/templates/resource_type.erb +8 -2
- data/lib/puppet-strings/markdown.rb +11 -9
- data/lib/puppet-strings/monkey_patches/display_object_command.rb +2 -0
- data/lib/puppet-strings/tasks/generate.rb +2 -0
- data/lib/puppet-strings/tasks/gh_pages.rb +3 -0
- data/lib/puppet-strings/tasks/validate.rb +42 -0
- data/lib/puppet-strings/tasks.rb +3 -0
- data/lib/puppet-strings/version.rb +3 -1
- data/lib/puppet-strings/yard/code_objects/base.rb +2 -0
- data/lib/puppet-strings/yard/code_objects/class.rb +4 -2
- data/lib/puppet-strings/yard/code_objects/data_type.rb +4 -2
- data/lib/puppet-strings/yard/code_objects/data_type_alias.rb +2 -0
- data/lib/puppet-strings/yard/code_objects/defined_type.rb +4 -2
- data/lib/puppet-strings/yard/code_objects/function.rb +6 -3
- data/lib/puppet-strings/yard/code_objects/group.rb +3 -0
- data/lib/puppet-strings/yard/code_objects/plan.rb +4 -2
- data/lib/puppet-strings/yard/code_objects/provider.rb +6 -0
- data/lib/puppet-strings/yard/code_objects/task.rb +2 -0
- data/lib/puppet-strings/yard/code_objects/type.rb +6 -1
- data/lib/puppet-strings/yard/code_objects.rb +2 -0
- data/lib/puppet-strings/yard/handlers/helpers.rb +2 -0
- data/lib/puppet-strings/yard/handlers/json/base.rb +2 -0
- data/lib/puppet-strings/yard/handlers/json/task_handler.rb +2 -0
- data/lib/puppet-strings/yard/handlers/puppet/base.rb +3 -0
- data/lib/puppet-strings/yard/handlers/puppet/class_handler.rb +2 -0
- data/lib/puppet-strings/yard/handlers/puppet/data_type_alias_handler.rb +2 -0
- data/lib/puppet-strings/yard/handlers/puppet/defined_type_handler.rb +2 -0
- data/lib/puppet-strings/yard/handlers/puppet/function_handler.rb +3 -1
- data/lib/puppet-strings/yard/handlers/puppet/plan_handler.rb +2 -0
- data/lib/puppet-strings/yard/handlers/ruby/base.rb +5 -0
- data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +33 -17
- data/lib/puppet-strings/yard/handlers/ruby/function_handler.rb +9 -7
- data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +13 -0
- data/lib/puppet-strings/yard/handlers/ruby/rsapi_handler.rb +4 -1
- data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +14 -6
- data/lib/puppet-strings/yard/handlers/ruby/type_extras_handler.rb +15 -5
- data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +12 -1
- data/lib/puppet-strings/yard/handlers.rb +2 -0
- data/lib/puppet-strings/yard/parsers/json/parser.rb +2 -0
- data/lib/puppet-strings/yard/parsers/json/task_statement.rb +2 -0
- data/lib/puppet-strings/yard/parsers/puppet/parser.rb +18 -14
- data/lib/puppet-strings/yard/parsers/puppet/statement.rb +4 -0
- data/lib/puppet-strings/yard/parsers.rb +2 -0
- data/lib/puppet-strings/yard/tags/enum_tag.rb +2 -0
- data/lib/puppet-strings/yard/tags/factory.rb +2 -0
- data/lib/puppet-strings/yard/tags/overload_tag.rb +4 -1
- data/lib/puppet-strings/yard/tags/parameter_directive.rb +5 -4
- data/lib/puppet-strings/yard/tags/property_directive.rb +5 -4
- data/lib/puppet-strings/yard/tags/summary_tag.rb +2 -0
- data/lib/puppet-strings/yard/tags.rb +2 -0
- data/lib/puppet-strings/yard/templates/default/puppet_function/html/setup.rb +1 -1
- data/lib/puppet-strings/yard/util.rb +4 -1
- data/lib/puppet-strings/yard.rb +3 -0
- data/lib/puppet-strings.rb +2 -0
- metadata +9 -8
@@ -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
|
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
|
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
|
-
|
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
|
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
|
-
|
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
|
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
|
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
|
|
data/lib/puppet-strings/yard.rb
CHANGED
@@ -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
|
|
data/lib/puppet-strings.rb
CHANGED
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.
|
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:
|
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.
|
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, >=
|
246
|
-
rubygems_version: 3.
|
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: []
|