puppet-strings 4.1.3 → 5.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f5cc43b3dfbc54e6a559b97f6b7bce4e5a8d6a94ff46f118095c7bcde517bbb
4
- data.tar.gz: 2dd5bac66f509884479026f24b154f81e13e78edef723b1f482036447f0d942c
3
+ metadata.gz: 2f1cc8fcb411239bdc8668d6b0d99ffc0edcb34d43f85f2ff523b515d286b0eb
4
+ data.tar.gz: 8ac1768f19063f04c3cc83ec13cbbc4aaaed343440a3d39df1d3211c0395286a
5
5
  SHA512:
6
- metadata.gz: b7203752a05e060ab1b92f9f2b952ab7cea1cb681ae7f1bd45368427f6202555bec2efb884f78f9ff27385fe6b931e037fd02234f9326073e26fbd72701e325c
7
- data.tar.gz: 6d0afed23ef6b0a60600d85f359375887303759b59fba5661644f26aa0cd3ca3dfc2f154dca94397531cd1d1a562560c78f46f4262d604a92ead1f68f2168e9b
6
+ metadata.gz: 8c82e3b9cf16a49a5624c1d6582115c3fa286a45f9b021b72da2b8d67d3e27327972ab6a2e4f4ef494c3b5e901f0ce2edd4848a20100b8d7037251f401282d80
7
+ data.tar.gz: 2dec8b8824ce510134e54059d7684791d704841927933b0bef1ef7802dbda389c8073294e1420294c413a6eac98f5e036be3f74fe39cc240475952ac2802cbc1
data/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ 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.1.0](https://github.com/puppetlabs/puppet-strings/tree/v5.1.0) - 2026-08-14
9
+
10
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v5.0.0...v5.1.0)
11
+
12
+ ### Added
13
+
14
+ - Add Ruby 4.0 / Puppet 9 support [#418](https://github.com/puppetlabs/puppet-strings/pull/418) ([LukasAud](https://github.com/LukasAud))
15
+ - Remove strict puppet dependency [#414](https://github.com/puppetlabs/puppet-strings/pull/414) ([binford2k](https://github.com/binford2k))
16
+
17
+ ## [v5.0.0](https://github.com/puppetlabs/puppet-strings/tree/v5.0.0) - 2025-06-09
18
+
19
+ [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v4.1.3...v5.0.0)
20
+
21
+ ### Changed
22
+
23
+ - (CAT-2281) Remove puppet 7 infrastructure [#407](https://github.com/puppetlabs/puppet-strings/pull/407) ([LukasAud](https://github.com/LukasAud))
24
+
25
+ ### Fixed
26
+
27
+ - Rake task allows for a different commit message [#408](https://github.com/puppetlabs/puppet-strings/pull/408) ([ghoneycutt](https://github.com/ghoneycutt))
28
+ - clarifies the puppet-strings usage [#405](https://github.com/puppetlabs/puppet-strings/pull/405) ([binford2k](https://github.com/binford2k))
29
+ - List puppet as runtime dependency [#404](https://github.com/puppetlabs/puppet-strings/pull/404) ([bastelfreak](https://github.com/bastelfreak))
30
+
8
31
  ## [v4.1.3](https://github.com/puppetlabs/puppet-strings/tree/v4.1.3) - 2024-09-05
9
32
 
10
33
  [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/v4.1.2...v4.1.3)
@@ -198,10 +221,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
198
221
  - (PDOC-265) Add examples to function reference docs [#188](https://github.com/puppetlabs/puppet-strings/pull/188) ([ekohl](https://github.com/ekohl))
199
222
  - (PDOC-252) Add describe features to puppet-strings face [#183](https://github.com/puppetlabs/puppet-strings/pull/183) ([kris-bosland](https://github.com/kris-bosland))
200
223
 
201
- ### Fixed
202
-
203
- - (PDOC-266) Silence 'unexpected construct regexp_literal' warning [#189](https://github.com/puppetlabs/puppet-strings/pull/189) ([seanmil](https://github.com/seanmil))
204
-
205
224
  ## [v2.1.0](https://github.com/puppetlabs/puppet-strings/tree/v2.1.0) - 2018-06-26
206
225
 
207
226
  [Full Changelog](https://github.com/puppetlabs/puppet-strings/compare/2.0.0...v2.1.0)
data/README.md CHANGED
@@ -11,8 +11,8 @@ Strings processes code and YARD-style code comments to create documentation in H
11
11
 
12
12
  ### Requirements
13
13
 
14
- * Ruby 2.7.0 or newer
15
- * Puppet 7.0.0 or newer
14
+ * Ruby 3.1.0 or newer
15
+ * Puppet 8.0.0 or newer
16
16
 
17
17
  ### Install Puppet Strings
18
18
 
@@ -57,15 +57,15 @@ JSON and Markdown output include the reference documentation only.
57
57
  Strings sends JSON output to either STDOUT or to a file.
58
58
  Markdown output is written to a REFERENCE.md file in the module's main directory.
59
59
 
60
- See the [Puppet Strings documentation](https://puppet.com/docs/puppet/latest/puppet_strings.html) for complete instructions for generating documentation with Strings.
60
+ See the [Puppet Strings documentation](https://help.puppet.com/core/current/Content/PuppetCore/puppet_strings.htm) for complete instructions for generating documentation with Strings.
61
61
 
62
- For code comment style guidelines and examples, see the [Puppet Strings style guide](https://puppet.com/docs/puppet/latest/puppet_strings_style.html).
62
+ For code comment style guidelines and examples, see the [Puppet Strings style guide](https://help.puppet.com/core/current/Content/PuppetCore/puppet_strings_style.htm).
63
63
 
64
64
  ### Additional Resources
65
65
 
66
66
  Here are a few other good resources for getting started with documentation:
67
67
 
68
- * [Module README Template](https://puppet.com/docs/puppet/latest/puppet_strings.html)
68
+ * [Module README Template](https://help.puppet.com/core/current/Content/PuppetCore/modules_readme.htm)
69
69
  * [YARD Getting Started Guide](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md)
70
70
  * [YARD Tags Overview](http://www.rubydoc.info/gems/yard/file/docs/Tags.md)
71
71
 
@@ -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
@@ -181,7 +181,7 @@ module PuppetStrings::Markdown
181
181
  def toc_info
182
182
  {
183
183
  name: name.to_s,
184
- link: link,
184
+ link:,
185
185
  desc: summary || @registry[:docstring][:text][0..140].tr("\n", ' '),
186
186
  private: private?
187
187
  }
@@ -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
- task :push do
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
- system "git commit -m '[strings] Generated Documentation Update at Revision #{git_sha}'"
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetStrings
4
- VERSION = '4.1.3'
4
+ VERSION = '5.1.0'
5
5
  end
@@ -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: signature, docstring: PuppetStrings::Yard::Util.docstring_to_hash(docstring, %i[param option enum return example]) }
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 tag.name == 'name' || tag.name == 'title'
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?/.freeze
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: 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
- (child.method_name.source == 'desc' || child.method_name.source == 'doc=') &&
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
- (child.method_name.source == 'desc' || child.method_name.source == 'doc=') &&
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?/.freeze
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 = +"#{PuppetStrings::Yard::Util.ast_to_text(type_expr.left_expr)}[" # alias_of should be mutable so we add a + to the string.
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, *args, &block)
79
- return object.send(method_name, *args, &block) if object.respond_to? 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 == :method ||
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 tag[:tag_name] == 'option' || tag[:tag_name] == 'enum'
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-strings
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 5.1.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: 2024-09-05 00:00:00.000000000 Z
11
+ date: 2026-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rgen
@@ -31,9 +31,6 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.9'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: 0.9.37
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
@@ -41,10 +38,7 @@ dependencies:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
40
  version: '0.9'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: 0.9.37
47
- description:
41
+ description:
48
42
  email: info@puppet.com
49
43
  executables: []
50
44
  extensions: []
@@ -232,7 +226,7 @@ homepage: https://github.com/puppetlabs/puppet-strings
232
226
  licenses:
233
227
  - Apache-2.0
234
228
  metadata: {}
235
- post_install_message:
229
+ post_install_message:
236
230
  rdoc_options: []
237
231
  require_paths:
238
232
  - lib
@@ -240,16 +234,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
234
  requirements:
241
235
  - - ">="
242
236
  - !ruby/object:Gem::Version
243
- version: 2.7.0
237
+ version: 3.1.0
244
238
  required_rubygems_version: !ruby/object:Gem::Requirement
245
239
  requirements:
246
240
  - - ">="
247
241
  - !ruby/object:Gem::Version
248
242
  version: '0'
249
- requirements:
250
- - puppet, >= 7.0.0
251
- rubygems_version: 3.1.6
252
- signing_key:
243
+ requirements: []
244
+ rubygems_version: 3.4.19
245
+ signing_key:
253
246
  specification_version: 4
254
247
  summary: Puppet documentation via YARD
255
248
  test_files: []