From 3feb846cf41d53a6ca7c0f4ea420df56c687a2ec Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Tue, 11 Mar 2014 09:21:37 -0700 Subject: Ensure Gemfile retains facilities for Jenkins. --- Gemfile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Gemfile') diff --git a/Gemfile b/Gemfile index 3d6d5ea..4604d1b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,15 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' +def location_for(place, fake_version = nil) + if place =~ /^(git[:@][^#]*)#(.*)/ + [fake_version, { :git => $1, :branch => $2, :require => false }].compact + elsif place =~ /^file:\/\/(.*)/ + ['>= 0', { :path => File.expand_path($1), :require => false }] + else + [place, { :require => false }] + end +end + group :development, :test do gem 'rake', :require => false gem 'rspec-puppet', :require => false @@ -15,8 +25,10 @@ group :development, :test do gem 'beaker-rspec', :require => false end -if puppetversion = ENV['PUPPET_GEM_VERSION'] - gem 'puppet', puppetversion, :require => false +ENV['GEM_PUPPET_VERSION'] ||= ENV['PUPPET_GEM_VERSION'] +puppetversion = ENV['GEM_PUPPET_VERSION'] +if puppetversion + gem 'puppet', *location_for(puppetversion) else gem 'puppet', :require => false end -- cgit v1.2.3