Skip to content

Commit

Permalink
TESTING
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Feb 14, 2023
1 parent 0f75df6 commit 0010dbb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

def location_for(place_or_version, fake_version = nil)
def location_for(place_or_version, required = false)
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
file_url_regex = %r{\Afile:\/\/(?<path>.*)}

if 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: required }].compact
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: required }]
else
[place_or_version, { require: false }]
[place_or_version, { require: required }]
end
end

Expand Down Expand Up @@ -54,7 +54,7 @@ gems = {}

gems['rake'] = [require: false]
gems['puppetlabs_spec_helper'] = [require: false]
gems['puppet'] = location_for(puppet_version)
gems['puppet'] = location_for(puppet_version, true)

# If facter or hiera versions have been specified via the environment
# variables
Expand Down

0 comments on commit 0010dbb

Please sign in to comment.