puppet-strings 2.5.0 → 2.6.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 +33 -6
- data/lib/puppet-strings.rb +2 -0
- data/lib/puppet-strings/describe.rb +2 -0
- data/lib/puppet-strings/json.rb +2 -0
- data/lib/puppet-strings/markdown.rb +11 -9
- 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/monkey_patches/display_object_command.rb +2 -0
- data/lib/puppet-strings/tasks.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/version.rb +3 -1
- data/lib/puppet-strings/yard.rb +3 -0
- data/lib/puppet-strings/yard/code_objects.rb +2 -0
- 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 +3 -0
- data/lib/puppet-strings/yard/handlers.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 +5 -2
- data/lib/puppet-strings/yard/handlers/ruby/type_handler.rb +12 -1
- data/lib/puppet-strings/yard/parsers.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 +12 -10
- data/lib/puppet-strings/yard/parsers/puppet/statement.rb +4 -0
- data/lib/puppet-strings/yard/tags.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/templates/default/puppet_function/html/setup.rb +1 -1
- data/lib/puppet-strings/yard/util.rb +4 -1
- 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
- metadata +5 -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
|
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/face/strings.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'puppet/face'
|
2
4
|
|
3
5
|
# Implements the 'puppet strings' interface.
|
@@ -57,6 +59,7 @@ Puppet::Face.define(:strings, '0.0.1') do
|
|
57
59
|
environment = Puppet.lookup(:current_environment)
|
58
60
|
environment.modules.each do |mod|
|
59
61
|
next unless modules.empty? || modules.include?(mod.name)
|
62
|
+
|
60
63
|
db = File.join(mod.path, '.yardoc')
|
61
64
|
patterns = PuppetStrings::DEFAULT_SEARCH_PATTERNS.map do |p|
|
62
65
|
File.join(mod.path, p)
|
@@ -145,7 +148,7 @@ Puppet::Face.define(:strings, '0.0.1') do
|
|
145
148
|
def check_required_features
|
146
149
|
raise RuntimeError, "The 'yard' gem must be installed in order to use this face." unless Puppet.features.yard?
|
147
150
|
raise RuntimeError, "The 'rgen' gem must be installed in order to use this face." unless Puppet.features.rgen?
|
148
|
-
raise RuntimeError, 'This face requires Ruby 1.9 or greater.' if RUBY_VERSION
|
151
|
+
raise RuntimeError, 'This face requires Ruby 1.9 or greater.' if RUBY_VERSION.match?(/^1\.8/)
|
149
152
|
end
|
150
153
|
|
151
154
|
# Builds the options to PuppetStrings.generate.
|
data/lib/puppet/feature/rgen.rb
CHANGED
data/lib/puppet/feature/yard.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.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -235,15 +235,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
235
235
|
requirements:
|
236
236
|
- - ">="
|
237
237
|
- !ruby/object:Gem::Version
|
238
|
-
version: 2.
|
238
|
+
version: 2.3.0
|
239
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
241
|
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
version: '0'
|
244
244
|
requirements:
|
245
|
-
- puppet, >=
|
246
|
-
rubygems_version: 3.
|
245
|
+
- puppet, >= 5.0.0
|
246
|
+
rubygems_version: 3.2.5
|
247
247
|
signing_key:
|
248
248
|
specification_version: 4
|
249
249
|
summary: Puppet documentation via YARD
|