aboutsummaryrefslogtreecommitdiff
path: root/Gemfile
diff options
context:
space:
mode:
authorMelissa Stone <melissa@puppet.com>2019-01-08 15:41:32 -0800
committerMelissa Stone <melissa@puppet.com>2019-01-08 15:41:32 -0800
commit4b77469aa9cce6110f95f93f255a2740ec2d2393 (patch)
treeee4f2fca99a1f9b5cf27eb298c967e89d02cd04a /Gemfile
parentc73b2d9cd24f85fcd3d52cc090ba0d1dc02f88b6 (diff)
downloadpuppet-hosts_core-4b77469aa9cce6110f95f93f255a2740ec2d2393.tar.gz
puppet-hosts_core-4b77469aa9cce6110f95f93f255a2740ec2d2393.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 1c6557c..ea9295f 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']