aboutsummaryrefslogtreecommitdiff
path: root/Gemfile
diff options
context:
space:
mode:
authorMelissa Stone <melissa@puppet.com>2019-01-08 15:43:06 -0800
committerMelissa Stone <melissa@puppet.com>2019-01-08 15:43:06 -0800
commit090a165445c0e7a0d3fd161d43e771e877932052 (patch)
tree28684bd74ec672f786d2f6d8e96fde02de9db2f5 /Gemfile
parent1ff420767cfb06c0b14c9db65ebd306569fa8284 (diff)
downloadpuppet-augeas_core-090a165445c0e7a0d3fd161d43e771e877932052.tar.gz
puppet-augeas_core-090a165445c0e7a0d3fd161d43e771e877932052.tar.bz2
(maint) update PDK to 1.8.0; update all templates
Diffstat (limited to 'Gemfile')
-rw-r--r--Gemfile22
1 files changed, 7 insertions, 15 deletions
diff --git a/Gemfile b/Gemfile
index 4c9526b..1d1cfb8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,22 +1,15 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
def location_for(place_or_version, fake_version = nil)
- if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
- [fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
- elsif place_or_version =~ %r{\Afile:\/\/(.*)}
- ['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
- else
- [place_or_version, { require: false }]
- end
-end
+ git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
+ file_url_regex = %r{\Afile:\/\/(?<path>.*)}
-def gem_type(place_or_version)
- if place_or_version =~ %r{\Agit[:@]}
- :git
- elsif !place_or_version.nil? && place_or_version.start_with?('file:')
- :file
+ 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
+ elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
+ ['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
else
- :gem
+ [place_or_version, { require: false }]
end
end
@@ -47,7 +40,6 @@ group :system_tests do
end
puppet_version = ENV['PUPPET_GEM_VERSION']
-puppet_type = gem_type(puppet_version)
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']