puppet-strings 4.1.3 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +2 -2
- data/lib/puppet/face/strings.rb +1 -1
- data/lib/puppet-strings/markdown/base.rb +1 -1
- data/lib/puppet-strings/tasks/gh_pages.rb +16 -2
- data/lib/puppet-strings/version.rb +1 -1
- data/lib/puppet-strings/yard/code_objects/function.rb +1 -1
- data/lib/puppet-strings/yard/handlers/puppet/base.rb +1 -1
- data/lib/puppet-strings/yard/handlers/ruby/base.rb +1 -1
- data/lib/puppet-strings/yard/handlers/ruby/data_type_handler.rb +1 -1
- data/lib/puppet-strings/yard/handlers/ruby/provider_handler.rb +1 -1
- data/lib/puppet-strings/yard/handlers/ruby/type_base.rb +1 -1
- data/lib/puppet-strings/yard/parsers/puppet/statement.rb +2 -2
- data/lib/puppet-strings/yard/tags/overload_tag.rb +2 -2
- data/lib/puppet-strings/yard/templates/default/tags/setup.rb +1 -7
- data/lib/puppet-strings/yard/util.rb +1 -1
- metadata +23 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15e623045d2f26993f1193bde5d1a00c6eff406dff7eb4e3e40b198f74dfa92c
|
4
|
+
data.tar.gz: f9428ce6e6ce52b7a7ce92a755c0c1592e5eb0cd5e96c82aa4fd829a7877b0e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fff9cbb435f70ff2d4d41c8956737c1a7adf1f2fb14110eb044a79e69d710e61b421828399b90c0ec4ee745d9c0ae0da5c4b538a9da1d89fbeb4f27822695988
|
7
|
+
data.tar.gz: 57fbf41d3236e9543a6313694ef3ecd01d96556ac93bb4f35cd4c9ea1f9d1267d47ba04f525fc9a07bf5cf1acd38b0ba23b9c2a24f008a8b1827e2c10c28eebb
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
|
6
6
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
|
7
7
|
|
8
|
+
## [v5.0.0](https://github.com/puppetlabs/puppet-strings/tree/v5.0.0) - 2025-06-09
|
9
|
+
|
10
|
+
[Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v4.1.3...v5.0.0)
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- (CAT-2281) Remove puppet 7 infrastructure [#407](https://github.com/puppetlabs/puppet-strings/pull/407) ([LukasAud](https://github.com/LukasAud))
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Rake task allows for a different commit message [#408](https://github.com/puppetlabs/puppet-strings/pull/408) ([ghoneycutt](https://github.com/ghoneycutt))
|
19
|
+
- clarifies the puppet-strings usage [#405](https://github.com/puppetlabs/puppet-strings/pull/405) ([binford2k](https://github.com/binford2k))
|
20
|
+
- List puppet as runtime dependency [#404](https://github.com/puppetlabs/puppet-strings/pull/404) ([bastelfreak](https://github.com/bastelfreak))
|
21
|
+
|
8
22
|
## [v4.1.3](https://github.com/puppetlabs/puppet-strings/tree/v4.1.3) - 2024-09-05
|
9
23
|
|
10
24
|
[Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v4.1.2...v4.1.3)
|
data/README.md
CHANGED
data/lib/puppet/face/strings.rb
CHANGED
@@ -4,7 +4,7 @@ require 'puppet/face'
|
|
4
4
|
|
5
5
|
# Implements the 'puppet strings' interface.
|
6
6
|
Puppet::Face.define(:strings, '0.0.1') do # rubocop:disable Metrics/BlockLength
|
7
|
-
summary 'Generate Puppet documentation with YARD.'
|
7
|
+
summary 'Generate Puppet module documentation with YARD.'
|
8
8
|
|
9
9
|
action(:generate) do
|
10
10
|
default
|
@@ -11,7 +11,9 @@ namespace :strings do
|
|
11
11
|
|
12
12
|
Dir.chdir('doc') do
|
13
13
|
system 'git checkout gh-pages'
|
14
|
+
exit 1 unless $?.success?
|
14
15
|
system 'git pull --rebase origin gh-pages'
|
16
|
+
exit 1 unless $?.success?
|
15
17
|
end
|
16
18
|
else
|
17
19
|
git_uri = `git config --get remote.origin.url`.strip
|
@@ -20,9 +22,13 @@ namespace :strings do
|
|
20
22
|
Dir.mkdir('doc')
|
21
23
|
Dir.chdir('doc') do
|
22
24
|
system 'git init'
|
25
|
+
exit 1 unless $?.success?
|
23
26
|
system "git remote add origin #{git_uri}"
|
27
|
+
exit 1 unless $?.success?
|
24
28
|
system 'git pull origin gh-pages'
|
29
|
+
exit 1 unless $?.success?
|
25
30
|
system 'git checkout -b gh-pages'
|
31
|
+
exit 1 unless $?.success?
|
26
32
|
end
|
27
33
|
end
|
28
34
|
end
|
@@ -35,15 +41,23 @@ namespace :strings do
|
|
35
41
|
end
|
36
42
|
end
|
37
43
|
|
38
|
-
|
44
|
+
# Task to push the gh-pages branch. Argument :msg_prefix is the beginning
|
45
|
+
# of the message and the actual commit will have "at Revision <git_sha>"
|
46
|
+
# appended.
|
47
|
+
task :push, [:msg_prefix] do |_t, args|
|
48
|
+
msg_prefix = args[:msg_prefix] || '[strings] Generated Documentation Update'
|
49
|
+
|
39
50
|
output = `git describe --long 2>/dev/null`
|
40
51
|
# If a project has never been tagged, fall back to latest SHA
|
41
52
|
git_sha = output.empty? ? `git log --pretty=format:'%H' -n 1` : output
|
42
53
|
|
43
54
|
Dir.chdir('doc') do
|
44
55
|
system 'git add .'
|
45
|
-
|
56
|
+
exit 1 unless $?.success?
|
57
|
+
system "git commit -m '#{msg_prefix} at Revision #{git_sha}'"
|
58
|
+
# Do not check status of commit, as it will error if there are no changes.
|
46
59
|
system 'git push origin gh-pages -f'
|
60
|
+
exit 1 unless $?.success?
|
47
61
|
end
|
48
62
|
end
|
49
63
|
|
@@ -94,7 +94,7 @@ class PuppetStrings::Yard::CodeObjects::Function < PuppetStrings::Yard::CodeObje
|
|
94
94
|
hash[:signatures] << { signature: o.signature, docstring: PuppetStrings::Yard::Util.docstring_to_hash(o.docstring, %i[param option enum return example]) }
|
95
95
|
end
|
96
96
|
else
|
97
|
-
hash[:signatures] << { signature
|
97
|
+
hash[:signatures] << { signature:, docstring: PuppetStrings::Yard::Util.docstring_to_hash(docstring, %i[param option enum return example]) }
|
98
98
|
end
|
99
99
|
|
100
100
|
hash[:docstring] = PuppetStrings::Yard::Util.docstring_to_hash(docstring)
|
@@ -21,7 +21,7 @@ class PuppetStrings::Yard::Handlers::Puppet::Base < YARD::Handlers::Base
|
|
21
21
|
tags.each do |tag|
|
22
22
|
next if statement.parameters.find { |p| tag.name == p.name }
|
23
23
|
|
24
|
-
log.warn "The @param tag for parameter '#{tag.name}' has no matching parameter at #{statement.file}:#{statement.line}." unless
|
24
|
+
log.warn "The @param tag for parameter '#{tag.name}' has no matching parameter at #{statement.file}:#{statement.line}." unless %w[name title].include?(tag.name)
|
25
25
|
end
|
26
26
|
|
27
27
|
# Assign the types for the parameter
|
@@ -6,7 +6,7 @@ require 'ripper'
|
|
6
6
|
class PuppetStrings::Yard::Handlers::Ruby::Base < YARD::Handlers::Ruby::Base
|
7
7
|
# A regular expression for detecting the start of a Ruby heredoc.
|
8
8
|
# Note: the first character of the heredoc start may have been cut off by YARD.
|
9
|
-
HEREDOC_START = /^<?<[-~]?['"]?(\w+)['"]?[^\n]*\n
|
9
|
+
HEREDOC_START = /^<?<[-~]?['"]?(\w+)['"]?[^\n]*\n?/
|
10
10
|
|
11
11
|
protected
|
12
12
|
|
@@ -237,7 +237,7 @@ class PuppetStrings::Yard::Handlers::Ruby::DataTypeHandler < PuppetStrings::Yard
|
|
237
237
|
default = value['value'] unless value['value'].nil?
|
238
238
|
end
|
239
239
|
data_type = [data_type] unless data_type.nil? || data_type.is_a?(Array)
|
240
|
-
params_hash[key] = { types: data_type, default:
|
240
|
+
params_hash[key] = { types: data_type, default: }
|
241
241
|
end
|
242
242
|
|
243
243
|
params_hash
|
@@ -61,7 +61,7 @@ class PuppetStrings::Yard::Handlers::Ruby::ProviderHandler < PuppetStrings::Yard
|
|
61
61
|
# Look for a call to a dispatch method with a block
|
62
62
|
next unless
|
63
63
|
child.method_name &&
|
64
|
-
|
64
|
+
['desc', 'doc='].include?(child.method_name.source) &&
|
65
65
|
child.parameters(false).count == 1
|
66
66
|
|
67
67
|
docstring = node_as_string(child.parameters[0])
|
@@ -34,7 +34,7 @@ class PuppetStrings::Yard::Handlers::Ruby::TypeBase < PuppetStrings::Yard::Handl
|
|
34
34
|
elsif child.is_a?(YARD::Parser::Ruby::MethodCallNode)
|
35
35
|
# Look for a call to a dispatch method with a block
|
36
36
|
next unless child.method_name &&
|
37
|
-
|
37
|
+
['desc', 'doc='].include?(child.method_name.source) &&
|
38
38
|
child.parameters(false).count == 1
|
39
39
|
|
40
40
|
docstring = node_as_string(child.parameters[0])
|
@@ -7,7 +7,7 @@ module PuppetStrings::Yard::Parsers::Puppet
|
|
7
7
|
# Represents the base Puppet language statement.
|
8
8
|
class Statement
|
9
9
|
# The pattern for parsing docstring comments.
|
10
|
-
COMMENT_REGEX = /^\s*#+\s
|
10
|
+
COMMENT_REGEX = /^\s*#+\s?/
|
11
11
|
|
12
12
|
attr_reader :source, :file, :line, :docstring, :comments_range
|
13
13
|
|
@@ -170,7 +170,7 @@ module PuppetStrings::Yard::Parsers::Puppet
|
|
170
170
|
case type_expr
|
171
171
|
when Puppet::Pops::Model::AccessExpression
|
172
172
|
# TODO: I don't like rebuilding the source from the AST, but AccessExpressions don't expose the original source
|
173
|
-
@alias_of =
|
173
|
+
@alias_of = "#{PuppetStrings::Yard::Util.ast_to_text(type_expr.left_expr)}[" # alias_of should be mutable so we add a + to the string.
|
174
174
|
@alias_of << type_expr.keys.map { |key| PuppetStrings::Yard::Util.ast_to_text(key) }.join(', ')
|
175
175
|
@alias_of << ']'
|
176
176
|
else
|
@@ -75,8 +75,8 @@ class PuppetStrings::Yard::Tags::OverloadTag < YARD::Tags::Tag
|
|
75
75
|
# @param [Array] args The args passed to the method.
|
76
76
|
# @param block The block passed to the method.
|
77
77
|
# @return Returns what the method call on the object would return.
|
78
|
-
def method_missing(method_name,
|
79
|
-
return object.send(method_name,
|
78
|
+
def method_missing(method_name, ...)
|
79
|
+
return object.send(method_name, ...) if object.respond_to? method_name
|
80
80
|
|
81
81
|
super
|
82
82
|
end
|
@@ -4,13 +4,7 @@
|
|
4
4
|
# @return [Array<YARD::Tag>] Returns the parameter tags if the object should have parameters.
|
5
5
|
def param
|
6
6
|
tag(:param) if
|
7
|
-
object.type
|
8
|
-
object.type == :puppet_class ||
|
9
|
-
object.type == :puppet_data_type ||
|
10
|
-
object.type == :puppet_defined_type ||
|
11
|
-
object.type == :puppet_function ||
|
12
|
-
object.type == :puppet_task ||
|
13
|
-
object.type == :puppet_plan
|
7
|
+
%i[method puppet_class puppet_data_type puppet_defined_type puppet_function puppet_task puppet_plan].include?(object.type)
|
14
8
|
end
|
15
9
|
|
16
10
|
# Renders the overload section.
|
@@ -40,7 +40,7 @@ module PuppetStrings::Yard::Util
|
|
40
40
|
|
41
41
|
tag = { tag_name: t.tag_name }
|
42
42
|
# grab nested information for @option and @enum tags
|
43
|
-
if
|
43
|
+
if %w[option enum].include?(tag[:tag_name])
|
44
44
|
tag[:opt_name] = t.pair.name
|
45
45
|
tag[:opt_text] = t.pair.text
|
46
46
|
tag[:opt_types] = t.pair.types if t.pair.types
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-strings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.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: 2025-06-09 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: 8.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 8.0.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rgen
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,9 +45,6 @@ dependencies:
|
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '0.9'
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 0.9.37
|
37
48
|
type: :runtime
|
38
49
|
prerelease: false
|
39
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -41,10 +52,7 @@ dependencies:
|
|
41
52
|
- - "~>"
|
42
53
|
- !ruby/object:Gem::Version
|
43
54
|
version: '0.9'
|
44
|
-
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 0.9.37
|
47
|
-
description:
|
55
|
+
description:
|
48
56
|
email: info@puppet.com
|
49
57
|
executables: []
|
50
58
|
extensions: []
|
@@ -232,7 +240,7 @@ homepage: https://github.com/puppetlabs/puppet-strings
|
|
232
240
|
licenses:
|
233
241
|
- Apache-2.0
|
234
242
|
metadata: {}
|
235
|
-
post_install_message:
|
243
|
+
post_install_message:
|
236
244
|
rdoc_options: []
|
237
245
|
require_paths:
|
238
246
|
- lib
|
@@ -240,16 +248,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
248
|
requirements:
|
241
249
|
- - ">="
|
242
250
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
251
|
+
version: 3.1.0
|
244
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
253
|
requirements:
|
246
254
|
- - ">="
|
247
255
|
- !ruby/object:Gem::Version
|
248
256
|
version: '0'
|
249
|
-
requirements:
|
250
|
-
|
251
|
-
|
252
|
-
signing_key:
|
257
|
+
requirements: []
|
258
|
+
rubygems_version: 3.3.27
|
259
|
+
signing_key:
|
253
260
|
specification_version: 4
|
254
261
|
summary: Puppet documentation via YARD
|
255
262
|
test_files: []
|