openvox-strings 5.0.0 → 6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f8faeecab951abd8059486388fbddcc093314713c17c1a87f30764be80e4af3
4
- data.tar.gz: c24f48e95451329e8367e5ffbf3835d901ef90678eb9af06e0b9d263ab6c1936
3
+ metadata.gz: 71629243bf4a78e83bf6dabc87a583eaca9878d5a12942f31fd301ffe5ad9628
4
+ data.tar.gz: 3c5953fccf4cf2db7df3535e07f45cd2848795e1f11e922ca98fa78d0117a49c
5
5
  SHA512:
6
- metadata.gz: e63adf1b7018dfeeccab03b660cdd9b97ead8f0a2184c7be8b1db88aece067885725a812fc72f436a510593b5f203c9e37f50fcd2d7b27e08e736db6fc2bb06e
7
- data.tar.gz: e124ea8d92900e5000dd00e126ddc13fed4d9b098e6771305e21cb3806988920a712d83557216e0a3013018fc9bea0f269edc16a8df001c2d0bde55fe82b41de
6
+ metadata.gz: 32603da312ed6bb016dea6b3d071811bed3d65ba6c5f56d6a26379ff3a7b469f5a9c8104ce5f991a7a20728d670328b7839251285e0ae2d56e261904ceb1ed1c
7
+ data.tar.gz: 2e6f7b566171d572ff5120164acbc26b5650b653f1659aff2b3d31b20c18969daf61dd5520a40764307c54ef83229e4b1efc52f632ca91e4eda75b0b5e7ff0cd
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [v6.0.0](https://github.com/voxpupuli/openvox-strings/tree/v6.0.0) (2025-08-13)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/openvox-strings/compare/v5.0.0...v6.0.0)
8
+
9
+ **Breaking changes:**
10
+
11
+ - Require Ruby 3.2 or newer [\#13](https://github.com/voxpupuli/openvox-strings/pull/13) ([bastelfreak](https://github.com/bastelfreak))
12
+
13
+ **Implemented enhancements:**
14
+
15
+ - Allow rgen 0.10.x [\#10](https://github.com/voxpupuli/openvox-strings/pull/10) ([smortex](https://github.com/smortex))
16
+
5
17
  ## [v5.0.0](https://github.com/voxpupuli/openvox-strings/tree/v5.0.0) (2025-06-10)
6
18
 
7
19
  [Full Changelog](https://github.com/voxpupuli/openvox-strings/compare/v4.1.3...v5.0.0)
@@ -15,6 +27,10 @@ All notable changes to this project will be documented in this file.
15
27
  - Rake task allows for a different commit message [\#4](https://github.com/voxpupuli/openvox-strings/pull/4) ([bastelfreak](https://github.com/bastelfreak))
16
28
  - Add Ruby 2.7/3.0 support [\#3](https://github.com/voxpupuli/openvox-strings/pull/3) ([bastelfreak](https://github.com/bastelfreak))
17
29
 
30
+ **Merged pull requests:**
31
+
32
+ - dependabot: check for github actions and bundler [\#6](https://github.com/voxpupuli/openvox-strings/pull/6) ([bastelfreak](https://github.com/bastelfreak))
33
+
18
34
  <!-- markdownlint-disable MD024 -->
19
35
  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).
20
36
 
@@ -15,7 +15,7 @@ module OpenvoxStrings::Describe
15
15
  document = {
16
16
  defined_types: YARD::Registry.all(:puppet_defined_type).sort_by!(&:name).map!(&:to_hash),
17
17
  resource_types: YARD::Registry.all(:puppet_type).sort_by!(&:name).map!(&:to_hash),
18
- providers: YARD::Registry.all(:puppet_provider).sort_by!(&:name).map!(&:to_hash)
18
+ providers: YARD::Registry.all(:puppet_provider).sort_by!(&:name).map!(&:to_hash),
19
19
  }
20
20
  # if --list flag passed, produce a summarized list of types
21
21
  if list_types
@@ -17,7 +17,7 @@ module OpenvoxStrings::Json
17
17
  providers: YARD::Registry.all(:puppet_provider).sort_by!(&:name).map!(&:to_hash),
18
18
  puppet_functions: YARD::Registry.all(:puppet_function).sort_by!(&:name).map!(&:to_hash),
19
19
  puppet_tasks: YARD::Registry.all(:puppet_task).sort_by!(&:name).map!(&:to_hash),
20
- puppet_plans: YARD::Registry.all(:puppet_plan).sort_by!(&:name).map!(&:to_hash)
20
+ puppet_plans: YARD::Registry.all(:puppet_plan).sort_by!(&:name).map!(&:to_hash),
21
21
  # TODO: Need Ruby documentation?
22
22
  }
23
23
 
@@ -23,7 +23,7 @@ module OpenvoxStrings::Markdown
23
23
  OpenvoxStrings::Markdown::Function,
24
24
  OpenvoxStrings::Markdown::DataType,
25
25
  OpenvoxStrings::Markdown::PuppetTask,
26
- OpenvoxStrings::Markdown::PuppetPlan
26
+ OpenvoxStrings::Markdown::PuppetPlan,
27
27
  ]
28
28
  end
29
29
 
@@ -33,7 +33,7 @@ module OpenvoxStrings::Markdown
33
33
  output = [
34
34
  "# Reference\n\n",
35
35
  "<!-- DO NOT EDIT: This document was generated by Puppet Strings -->\n\n",
36
- "## Table of Contents\n\n"
36
+ "## Table of Contents\n\n",
37
37
  ]
38
38
 
39
39
  # Create table of contents
@@ -13,7 +13,7 @@ namespace :strings do
13
13
  options = {
14
14
  debug: args[:debug] == 'true',
15
15
  backtrace: args[:backtrace] == 'true',
16
- markup: args[:markup] || 'markdown'
16
+ markup: args[:markup] || 'markdown',
17
17
  }
18
18
 
19
19
  raise('Error: Both JSON and Markdown output have been selected. Please select one.') if args[:json] == 'true' && args[:markdown] == 'true'
@@ -33,7 +33,7 @@ namespace :strings do
33
33
  options[format] = !(args[format] == 'false' || args[format].empty?)
34
34
  return unless options[format]
35
35
 
36
- options[:path] = args[format] == 'true' ? nil : args[format]
36
+ options[:path] = (args[format] == 'true') ? nil : args[format]
37
37
  end
38
38
  # rubocop:enable Style/PreferredHashMethods
39
39
 
@@ -24,7 +24,7 @@ namespace :strings do
24
24
  backtrace: args[:backtrace] == 'true',
25
25
  json: false,
26
26
  markdown: true,
27
- path: file
27
+ path: file,
28
28
  }
29
29
  OpenvoxStrings.generate(patterns, options)
30
30
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenvoxStrings
4
- VERSION = '5.0.0'
4
+ VERSION = '6.0.0'
5
5
  end
@@ -5,9 +5,9 @@ class OpenvoxStrings::Yard::CodeObjects::Base < YARD::CodeObjects::NamespaceObje
5
5
  # Allocates a new code object.
6
6
  # @param [Array] args The arguments to initialize the code object with.
7
7
  # @return Returns the code object.
8
- def self.new(*args)
8
+ def self.new(*)
9
9
  # Skip the super class' implementation because it detects :: in names and this will cause namespaces in the output we don't want
10
- object = Object.class.instance_method(:new).bind_call(self, *args)
10
+ object = Object.class.instance_method(:new).bind_call(self, *)
11
11
  existing = YARD::Registry.at(object.path)
12
12
  object = existing if existing.instance_of?(self)
13
13
  yield(object) if block_given?
@@ -94,7 +94,7 @@ class OpenvoxStrings::Yard::CodeObjects::DataType < OpenvoxStrings::Yard::CodeOb
94
94
  {
95
95
  name: func.name,
96
96
  signature: func.signature,
97
- docstring: OpenvoxStrings::Yard::Util.docstring_to_hash(func.docstring, %i[param option enum return example])
97
+ docstring: OpenvoxStrings::Yard::Util.docstring_to_hash(func.docstring, %i[param option enum return example]),
98
98
  }
99
99
  end
100
100
  hash
@@ -48,7 +48,7 @@ class OpenvoxStrings::Yard::CodeObjects::Task < OpenvoxStrings::Yard::CodeObject
48
48
  { name: name.to_s,
49
49
  tag_name: 'param',
50
50
  text: props['description'] || '',
51
- types: [props['type']] || '' }
51
+ types: [props['type']] || '', }
52
52
  end
53
53
  end
54
54
 
@@ -60,10 +60,10 @@ class OpenvoxStrings::Yard::CodeObjects::Task < OpenvoxStrings::Yard::CodeObject
60
60
  line: statement.line,
61
61
  docstring: {
62
62
  text: statement.docstring,
63
- tags: parameters
63
+ tags: parameters,
64
64
  },
65
65
  source: statement.source,
66
66
  supports_noop: statement.json['supports_noop'] || false,
67
- input_method: statement.json['input_method'] }
67
+ input_method: statement.json['input_method'], }
68
68
  end
69
69
  end
@@ -158,7 +158,7 @@ class OpenvoxStrings::Yard::CodeObjects::Type < OpenvoxStrings::Yard::CodeObject
158
158
  provider_param = Parameter.new(
159
159
  'provider',
160
160
  "The specific backend to use for this `#{name}` resource. You will seldom need " \
161
- 'to specify this --- Puppet will usually discover the appropriate provider for your platform.'
161
+ 'to specify this --- Puppet will usually discover the appropriate provider for your platform.',
162
162
  )
163
163
 
164
164
  @parameters ||= []
@@ -40,9 +40,7 @@ class OpenvoxStrings::Yard::Handlers::Puppet::FunctionHandler < OpenvoxStrings::
40
40
  def add_return_tag(object, type = nil)
41
41
  tag = object.tag(:return)
42
42
  if tag
43
- if (type && tag.types && tag.types.first) && (type != tag.types.first)
44
- log.warn "Documented return type does not match return type in function definition near #{statement.file}:#{statement.line}."
45
- end
43
+ log.warn "Documented return type does not match return type in function definition near #{statement.file}:#{statement.line}." if type && tag.types && tag.types.first && (type != tag.types.first)
46
44
 
47
45
  tag.types = type ? [type] : tag.types || ['Any']
48
46
  return
@@ -39,7 +39,7 @@ class OpenvoxStrings::Yard::Handlers::Ruby::FunctionHandler < OpenvoxStrings::Ya
39
39
  is_3x = ['Puppet::Parser::Functions', 'newfunction'].include?(module_name)
40
40
  object = OpenvoxStrings::Yard::CodeObjects::Function.new(
41
41
  get_name(statement, 'Puppet::Functions.create_function'),
42
- is_3x ? OpenvoxStrings::Yard::CodeObjects::Function::RUBY_3X : OpenvoxStrings::Yard::CodeObjects::Function::RUBY_4X
42
+ is_3x ? OpenvoxStrings::Yard::CodeObjects::Function::RUBY_3X : OpenvoxStrings::Yard::CodeObjects::Function::RUBY_4X,
43
43
  )
44
44
  object.source = statement
45
45
  register object
@@ -185,7 +185,7 @@ class OpenvoxStrings::Yard::Handlers::Ruby::FunctionHandler < OpenvoxStrings::Ya
185
185
  node_as_string(parameters[0]),
186
186
  nil, # TODO: determine default from corresponding Ruby method signature?
187
187
  method_name.include?('optional'),
188
- method_name.include?('repeated')
188
+ method_name.include?('repeated'),
189
189
  )
190
190
  end
191
191
 
@@ -216,7 +216,7 @@ class OpenvoxStrings::Yard::Handlers::Ruby::FunctionHandler < OpenvoxStrings::Ya
216
216
  nil, # TODO: determine default from corresponding Ruby method signature?
217
217
  block.method_name.source.include?('optional'),
218
218
  false, # Not repeated
219
- true # Is block
219
+ true, # Is block
220
220
  )
221
221
  end
222
222
  end
@@ -244,7 +244,7 @@ class OpenvoxStrings::Yard::Handlers::Ruby::FunctionHandler < OpenvoxStrings::Ya
244
244
  param_tags,
245
245
  parameter.source,
246
246
  parameter.file,
247
- parameter.line
247
+ parameter.line,
248
248
  )
249
249
  end
250
250
 
@@ -259,7 +259,7 @@ class OpenvoxStrings::Yard::Handlers::Ruby::FunctionHandler < OpenvoxStrings::Ya
259
259
  parameter.line,
260
260
  nil,
261
261
  parameter[1].source,
262
- true
262
+ true,
263
263
  )
264
264
  end
265
265
 
@@ -275,7 +275,7 @@ class OpenvoxStrings::Yard::Handlers::Ruby::FunctionHandler < OpenvoxStrings::Ya
275
275
  nil,
276
276
  nil,
277
277
  false,
278
- true
278
+ true,
279
279
  )
280
280
  end
281
281
 
@@ -292,7 +292,7 @@ class OpenvoxStrings::Yard::Handlers::Ruby::FunctionHandler < OpenvoxStrings::Ya
292
292
  nil,
293
293
  false,
294
294
  false,
295
- true
295
+ true,
296
296
  )
297
297
  end
298
298
 
@@ -170,7 +170,7 @@ module OpenvoxStrings::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 = +"#{OpenvoxStrings::Yard::Util.ast_to_text(type_expr.left_expr)}[" # alias_of should be mutable so we add a + to the string.
173
+ @alias_of = "#{OpenvoxStrings::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| OpenvoxStrings::Yard::Util.ast_to_text(key) }.join(', ')
175
175
  @alias_of << ']'
176
176
  else
@@ -25,7 +25,7 @@ class OpenvoxStrings::Yard::Tags::OverloadTag < YARD::Tags::Tag
25
25
  name, default = parameter
26
26
  tag = tags.find { |t| t.name == name } if tags
27
27
  type = tag&.types ? "#{tag.type} " : 'Any '
28
- prefix = (name[0]).to_s if name.start_with?('*', '&')
28
+ prefix = name[0].to_s if name.start_with?('*', '&')
29
29
  name = name[1..] if prefix
30
30
  default = " = #{default}" if default
31
31
  "#{type}#{prefix}$#{name}#{default}"
@@ -15,7 +15,7 @@ end
15
15
  # Renders the layout section.
16
16
  # @return [String] Returns the rendered section.
17
17
  def layout
18
- @nav_url = url_for_list(!@file || options.index ? menu_lists.first[:type] : 'file')
18
+ @nav_url = url_for_list((!@file || options.index) ? menu_lists.first[:type] : 'file')
19
19
 
20
20
  case object
21
21
  when nil, String
@@ -78,53 +78,53 @@ def create_menu_lists
78
78
  {
79
79
  type: 'puppet_class',
80
80
  title: 'Puppet Classes',
81
- search_title: 'Puppet Classes'
81
+ search_title: 'Puppet Classes',
82
82
  },
83
83
  {
84
84
  type: 'puppet_data_type',
85
85
  title: 'Data Types',
86
- search_title: 'Data Types'
86
+ search_title: 'Data Types',
87
87
  },
88
88
  {
89
89
  type: 'puppet_defined_type',
90
90
  title: 'Defined Types',
91
- search_title: 'Defined Types'
91
+ search_title: 'Defined Types',
92
92
  },
93
93
  {
94
94
  type: 'puppet_type',
95
95
  title: 'Resource Types',
96
- search_title: 'Resource Types'
96
+ search_title: 'Resource Types',
97
97
  },
98
98
  {
99
99
  type: 'puppet_provider',
100
100
  title: 'Providers',
101
- search_title: 'Providers'
101
+ search_title: 'Providers',
102
102
  },
103
103
  {
104
104
  type: 'puppet_function',
105
105
  title: 'Puppet Functions',
106
- search_title: 'Puppet Functions'
106
+ search_title: 'Puppet Functions',
107
107
  },
108
108
  {
109
109
  type: 'puppet_task',
110
110
  title: 'Puppet Tasks',
111
- search_totle: 'Puppet Tasks'
111
+ search_totle: 'Puppet Tasks',
112
112
  },
113
113
  {
114
114
  type: 'puppet_plan',
115
115
  title: 'Puppet Plans',
116
- search_totle: 'Puppet Plans'
116
+ search_totle: 'Puppet Plans',
117
117
  },
118
118
  {
119
119
  type: 'class',
120
120
  title: 'Ruby Classes',
121
- search_title: 'Class List'
121
+ search_title: 'Class List',
122
122
  },
123
123
  {
124
124
  type: 'method',
125
125
  title: 'Ruby Methods',
126
- search_title: 'Method List'
127
- }
126
+ search_title: 'Method List',
127
+ },
128
128
  ]
129
129
 
130
130
  menu_lists.delete_if { |e| YARD::Registry.all(e[:type].intern).empty? }
@@ -134,7 +134,7 @@ def create_menu_lists
134
134
  menu_lists << {
135
135
  type: 'file',
136
136
  title: 'Files',
137
- search_title: 'File List'
137
+ search_title: 'File List',
138
138
  }
139
139
  end
140
140
 
@@ -10,7 +10,7 @@ end
10
10
  # Renders the overload section.
11
11
  # @return [String] Returns the rendered section.
12
12
  def overload
13
- erb(object.type == :puppet_function ? :puppet_overload : :overload)
13
+ erb((object.type == :puppet_function) ? :puppet_overload : :overload)
14
14
  end
15
15
 
16
16
  # Renders the enum section.
@@ -61,7 +61,7 @@ class YARD::CLI::Yardoc
61
61
  :puppet_provider,
62
62
  :puppet_function,
63
63
  :puppet_task,
64
- :puppet_plan
64
+ :puppet_plan,
65
65
  )
66
66
  end
67
67
  end
@@ -79,10 +79,10 @@ module OpenvoxStrings
79
79
 
80
80
  # Runs the YARD documentation server.
81
81
  # @param [Array<String>] args The arguments to YARD.
82
- def self.run_server(*args)
82
+ def self.run_server(*)
83
83
  require 'openvox-strings/yard'
84
84
  OpenvoxStrings::Yard.setup!
85
85
 
86
- YARD::CLI::Server.run(*args)
86
+ YARD::CLI::Server.run(*)
87
87
  end
88
88
  end
@@ -27,8 +27,8 @@ Puppet::Face.define(:strings, '0.0.1') do # rubocop:disable Metrics/BlockLength
27
27
  require 'openvox-strings'
28
28
 
29
29
  OpenvoxStrings.generate(
30
- args.count > 1 ? args[0..-2] : OpenvoxStrings::DEFAULT_SEARCH_PATTERNS,
31
- build_generate_options(args.last)
30
+ (args.count > 1) ? args[0..-2] : OpenvoxStrings::DEFAULT_SEARCH_PATTERNS,
31
+ build_generate_options(args.last),
32
32
  )
33
33
  nil
34
34
  end
@@ -46,7 +46,7 @@ Puppet::Face.define(:strings, '0.0.1') do # rubocop:disable Metrics/BlockLength
46
46
  check_required_features
47
47
  require 'openvox-strings'
48
48
 
49
- modules = args.count > 1 ? args[0..-2] : []
49
+ modules = (args.count > 1) ? args[0..-2] : []
50
50
 
51
51
  # Generate documentation for all (or the given) modules
52
52
  module_docs = []
@@ -133,7 +133,7 @@ Puppet::Face.define(:strings, '0.0.1') do # rubocop:disable Metrics/BlockLength
133
133
  search_patterns = ['types/**/*.pp', 'lib/**/*.rb']
134
134
  OpenvoxStrings.generate(
135
135
  search_patterns,
136
- build_generate_options(options)
136
+ build_generate_options(options),
137
137
  )
138
138
  nil
139
139
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openvox-strings
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Inc.
@@ -34,16 +34,22 @@ dependencies:
34
34
  name: rgen
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0.9'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.11'
40
43
  type: :runtime
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
- - - "~>"
47
+ - - ">="
45
48
  - !ruby/object:Gem::Version
46
49
  version: '0.9'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.11'
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: yard
49
55
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +64,20 @@ dependencies:
58
64
  - - "~>"
59
65
  - !ruby/object:Gem::Version
60
66
  version: '0.9'
67
+ - !ruby/object:Gem::Dependency
68
+ name: voxpupuli-rubocop
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: 4.2.0
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: 4.2.0
61
81
  email: voxpupuli@groups.io
62
82
  executables: []
63
83
  extensions: []
@@ -250,14 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
270
  requirements:
251
271
  - - ">="
252
272
  - !ruby/object:Gem::Version
253
- version: 2.7.0
273
+ version: 3.2.0
254
274
  required_rubygems_version: !ruby/object:Gem::Requirement
255
275
  requirements:
256
276
  - - ">="
257
277
  - !ruby/object:Gem::Version
258
278
  version: '0'
259
279
  requirements: []
260
- rubygems_version: 3.6.7
280
+ rubygems_version: 3.6.9
261
281
  specification_version: 4
262
282
  summary: Puppet documentation via YARD
263
283
  test_files: []