Skip to content

Commit

Permalink
last adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasAud committed Jan 22, 2024
1 parent 1fde077 commit 5d1ade7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
9 changes: 0 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion lib/puppetfile-resolver/cache/persistent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/puppetfile-resolver/spec_searchers/git/github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down
6 changes: 3 additions & 3 deletions lib/puppetfile-resolver/spec_searchers/git/gitlab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down

0 comments on commit 5d1ade7

Please sign in to comment.