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

if RUBY_VERSION =~ /^1\./
  gem 'addressable', '< 2.5.0'
  gem 'nokogiri', '< 1.6.8'
end

# mime-types 3 added a dependency on mime-types-data which has a
# requirement on ruby >= 2. We pin to mime-types 2.99.2 or less on
# ruby 1.x
gem 'mime-types', '<=2.99.2', :require => false if RUBY_VERSION =~ /^1\./

gem "beaker", *location_for(ENV['BEAKER_VERSION'] || 'git://github.com/puppetlabs/beaker#master')
gem 'rake', "~> 10.1.0"

# json-schema does not support windows, so use the 'ruby' platform to exclude it on windows
platforms :ruby do
  # json-schema uses multi_json, but chokes with multi_json 1.7.9, so prefer 1.7.7
  gem "multi_json", "~> 1.10", :require => false
  gem "json-schema", "2.1.1", :require => false
end

if File.exists? "#{__FILE__}.local"
  eval(File.read("#{__FILE__}.local"), binding)
end
