Gemfile 2.29 KB
Newer Older
1 2
gemfile_home = File.dirname(__FILE__)

3
source ENV['GEM_SOURCE'] || "https://rubygems.org"
4
oldest_supported_puppet = "5.0.0"
5 6
beaker_version = ENV['BEAKER_VERSION']

7
begin
8
  puppet_ref = File.read(gemfile_home + '/ext/test-conf/puppet-ref-requested').strip
9
rescue Errno::ENOENT
10
  puppet_ref = File.read(gemfile_home + '/ext/test-conf/puppet-ref-default').strip
11 12
end

13 14 15 16 17 18 19 20 21
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
Ken Barber's avatar
Ken Barber committed
22 23

gem 'facter'
24
gem 'rake'
25
gem 'packaging', *location_for(ENV['PACKAGING_VERSION'] || '~> 0.99')
26

27
group :test do
28 29 30
  # Add test-unit for ruby 2.2+ support (has been removed from stdlib)
  gem 'test-unit'

31 32 33 34 35
  # Pinning for Ruby 1.9.3 support
  gem 'json_pure', '~> 1.8'
  # Pinning for Ruby < 2.2.0 support
  gem 'activesupport', '~> 4.2'

36 37 38
  # addressable 2.5 requires public_suffix, which requires ruby 2.
  gem 'addressable', '< 2.5.0'

39
  # Pinning to work-around an incompatiblity with 2.14 in puppetlabs_spec_helper
40
  gem 'rspec', '~> 3.1'
41
  gem 'puppetlabs_spec_helper', '0.10.3', :require => false
42

43 44 45
  # docker-api 1.32.0 requires ruby 2.0.0
  gem 'docker-api', '1.31.0'

46
  case puppet_ref
47 48 49 50 51 52
  when "latest"
    gem 'puppet', ">= #{oldest_supported_puppet}", :require => false
  when "oldest"
    gem 'puppet', oldest_supported_puppet, :require => false
  else
    gem 'puppet', :git => 'https://github.com/puppetlabs/puppet.git',
53
      :ref => puppet_ref, :require => false
54
  end
55

56
  gem 'mocha', '~> 1.0'
57 58
end

59 60 61 62 63 64 65 66 67 68
# This is a workaround for a bug in bundler, where it likes to look at ruby
# version deps regardless of what groups you want or not. This lets us
# conditionally shortcut evaluation entirely.
if ENV['NO_ACCEPTANCE'] != 'true'
  group :acceptance do
    if beaker_version
      #use the specified version
      gem 'beaker', *location_for(beaker_version)
    else
      # use the pinned version
69
      gem 'beaker', '~> 4.1'
70
    end
71
  end
72
  gem 'beaker-hostgenerator', '1.1.13'
73
  gem 'beaker-abs', *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.2')
74 75
  gem 'beaker-vmpooler', *location_for(ENV['BEAKER_VMPOOLER_VERSION'] || "~> 1.3")
  gem 'beaker-puppet', '~> 1.0'
76
end