From 5d1ade704fb2ff9930b1515cd4bd7b8a98a176c1 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Mon, 22 Jan 2024 14:51:13 +0000 Subject: [PATCH] last adjustments --- .rubocop_todo.yml | 9 --------- lib/puppetfile-resolver/cache/persistent.rb | 2 +- lib/puppetfile-resolver/spec_searchers/git/github.rb | 6 +++--- lib/puppetfile-resolver/spec_searchers/git/gitlab.rb | 6 +++--- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 941cafb..a4a09cf 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -57,12 +57,3 @@ Style/OptionalBooleanParameter: Style/RedundantFreeze: Exclude: - 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/module/forge.rb' - -# Offense count: 7 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Mode. -Style/StringConcatenation: - Exclude: - - 'lib/puppetfile-resolver/cache/persistent.rb' - - 'lib/puppetfile-resolver/spec_searchers/git/github.rb' - - 'lib/puppetfile-resolver/spec_searchers/git/gitlab.rb' diff --git a/lib/puppetfile-resolver/cache/persistent.rb b/lib/puppetfile-resolver/cache/persistent.rb index b1eda50..e32abba 100644 --- a/lib/puppetfile-resolver/cache/persistent.rb +++ b/lib/puppetfile-resolver/cache/persistent.rb @@ -43,7 +43,7 @@ def persist(name, content_string) private def to_cache_name(name) - ::Digest::SHA256.hexdigest(name) + '.txt' + "#{::Digest::SHA256.hexdigest(name)}.txt" end end end diff --git a/lib/puppetfile-resolver/spec_searchers/git/github.rb b/lib/puppetfile-resolver/spec_searchers/git/github.rb index 4ca164e..9d1c6f4 100644 --- a/lib/puppetfile-resolver/spec_searchers/git/github.rb +++ b/lib/puppetfile-resolver/spec_searchers/git/github.rb @@ -19,11 +19,11 @@ def self.metadata(puppetfile_module, resolver_ui, config) end return nil if repo_url.nil? - metadata_url = 'https://raw.githubusercontent.com/' + repo_url + '/' + metadata_url = "https://raw.githubusercontent.com/#{repo_url}/" if puppetfile_module.ref - metadata_url += puppetfile_module.ref + '/' + metadata_url += "#{puppetfile_module.ref}/" elsif puppetfile_module.tag - metadata_url += puppetfile_module.tag + '/' + metadata_url += "#{puppetfile_module.tag}/" else # Default to master. Should it raise? metadata_url += 'master/' diff --git a/lib/puppetfile-resolver/spec_searchers/git/gitlab.rb b/lib/puppetfile-resolver/spec_searchers/git/gitlab.rb index ee66336..01ccdf1 100644 --- a/lib/puppetfile-resolver/spec_searchers/git/gitlab.rb +++ b/lib/puppetfile-resolver/spec_searchers/git/gitlab.rb @@ -21,11 +21,11 @@ def self.metadata(puppetfile_module, resolver_ui, config) # Example URL # https://gitlab.com/simp/pupmod-simp-crypto_policy/-/raw/0.1.4/metadata.json - metadata_url = 'https://gitlab.com/' + repo_url + '/-/raw/' + metadata_url = "https://gitlab.com/#{repo_url}/-/raw/" if puppetfile_module.ref - metadata_url += puppetfile_module.ref + '/' + metadata_url += "#{puppetfile_module.ref}/" elsif puppetfile_module.tag - metadata_url += puppetfile_module.tag + '/' + metadata_url += "#{puppetfile_module.tag}/" else # Default to master. Should it raise? metadata_url += 'master/'