Skip to content
Snippets Groups Projects
Unverified Commit 3e72d6eb authored by Gavin Didrichsen's avatar Gavin Didrichsen
Browse files
parent 2cbc2e57
No related tags found
No related merge requests found
...@@ -64,13 +64,15 @@ def location_for(place_or_version, fake_version = nil, gem_name = nil) ...@@ -64,13 +64,15 @@ def location_for(place_or_version, fake_version = nil, gem_name = nil)
version = place_or_version || '>= 0' version = place_or_version || '>= 0'
if ['puppet', 'facter'].include?(gem_name) && ENV['PUPPET_AUTH_TOKEN'] # Only use private source if PUPPET_AUTH_TOKEN is set AND it's a puppet-related gem
if ['puppet', 'facter'].include?(gem_name) && !ENV['PUPPET_AUTH_TOKEN'].to_s.empty?
[version, { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] [version, { require: false, source: 'https://rubygems-puppetcore.puppet.com' }]
elsif place_or_version && (git_url = place_or_version.match(git_url_regex)) elsif place_or_version && (git_url = place_or_version.match(git_url_regex))
[fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
['>= 0', { path: File.expand_path(file_url[:path]), require: false }] ['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
else else
# Default to rubygems.org when PUPPET_AUTH_TOKEN is not set
[version, { require: false }] [version, { require: false }]
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment