From e3a9bfd6df75f8ae62c8ebc37ca899fe0851d2c0 Mon Sep 17 00:00:00 2001 From: Gavin Didrichsen Date: Mon, 4 Dec 2023 21:30:53 +0000 Subject: [PATCH] Fix rubocop lint warnings Signed-off-by: Gavin Didrichsen --- lib/puppet-strings/describe.rb | 2 +- lib/puppet-strings/yard/code_objects/function.rb | 2 +- lib/puppet-strings/yard/code_objects/provider.rb | 2 +- lib/puppet-strings/yard/code_objects/type.rb | 2 +- lib/puppet-strings/yard/util.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/puppet-strings/describe.rb b/lib/puppet-strings/describe.rb index 6c09f14b2..acddd244b 100644 --- a/lib/puppet-strings/describe.rb +++ b/lib/puppet-strings/describe.rb @@ -66,7 +66,7 @@ def self.list_one(object) targetlength = 48 shortento = targetlength - 4 contentstring = object[:docstring][:text] - end_of_line = contentstring.index("\n") # "." gives closer results to old describeb, but breaks for '.k5login' + end_of_line = contentstring.index("\n") # "." gives closer results to old describeb, but breaks for '.k5login' contentstring = contentstring[0..end_of_line] unless end_of_line.nil? contentstring = "#{contentstring[0..shortento]} ..." if contentstring.length > targetlength diff --git a/lib/puppet-strings/yard/code_objects/function.rb b/lib/puppet-strings/yard/code_objects/function.rb index e2f9007ec..03916a081 100644 --- a/lib/puppet-strings/yard/code_objects/function.rb +++ b/lib/puppet-strings/yard/code_objects/function.rb @@ -8,7 +8,7 @@ class PuppetStrings::Yard::CodeObjects::Functions < PuppetStrings::Yard::CodeObj # @param [Symbol] type The function type to get the group for. # @return Returns the singleton instance of the group. def self.instance(type) - super("puppet_functions_#{type}".to_sym) + super(:"puppet_functions_#{type}") end # Gets the display name of the group. diff --git a/lib/puppet-strings/yard/code_objects/provider.rb b/lib/puppet-strings/yard/code_objects/provider.rb index 47e6ad5b6..2fc8135c5 100644 --- a/lib/puppet-strings/yard/code_objects/provider.rb +++ b/lib/puppet-strings/yard/code_objects/provider.rb @@ -8,7 +8,7 @@ class PuppetStrings::Yard::CodeObjects::Providers < PuppetStrings::Yard::CodeObj # @param [String] type The resource type name for the provider. # @return Returns the singleton instance of the group. def self.instance(type) - super("puppet_providers_#{type}".to_sym) + super(:"puppet_providers_#{type}") end # Gets the display name of the group. diff --git a/lib/puppet-strings/yard/code_objects/type.rb b/lib/puppet-strings/yard/code_objects/type.rb index fe6131fdd..3bbc95e26 100644 --- a/lib/puppet-strings/yard/code_objects/type.rb +++ b/lib/puppet-strings/yard/code_objects/type.rb @@ -169,7 +169,7 @@ def parameters # render-time. For now, this should re-resolve on every call. # may be able to memoize this def providers - providers = YARD::Registry.all("puppet_providers_#{name}".to_sym) + providers = YARD::Registry.all(:"puppet_providers_#{name}") return providers if providers.empty? providers.first.children diff --git a/lib/puppet-strings/yard/util.rb b/lib/puppet-strings/yard/util.rb index ecf4b6e50..8025b150d 100644 --- a/lib/puppet-strings/yard/util.rb +++ b/lib/puppet-strings/yard/util.rb @@ -35,7 +35,7 @@ def self.github_to_yard_links(data) # @return [Array] Returns an array of tag hashes. def self.tags_to_hashes(tags) # Skip over the API tags that are public - tags.select { |t| (t.tag_name != 'api' || t.text != 'public') }.map do |t| + tags.select { |t| t.tag_name != 'api' || t.text != 'public' }.map do |t| next t.to_hash if t.respond_to?(:to_hash) tag = { tag_name: t.tag_name }