Sha256: 06e1693f9f3a47ee4313a0d2c5dc574e50ffe74f149c4184bdb3e6c2a4083a11

Contents?: true

Size: 1.98 KB

Versions: 1

Compression:

Stored size: 1.98 KB

Contents

# frozen_string_literal: true

source ENV['GEM_SOURCE'] || 'https://rubygems.org'

def location_for(place_or_version, fake_version = nil)
  git_url_regex = %r{\A(?<url>(?:https?|git)[:@][^#]*)(?:#(?<branch>.*))?}
  file_url_regex = %r{\Afile://(?<path>.*)}

  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
    [place_or_version, { require: false }]
  end
end

# Specify the global dependencies in puppetlabs_spec_helper.gemspec
# Note that only ruby 1.9 compatible dependencies may go there, everything else needs to be documented and pulled in manually, and optionally by everyone who wants to use the extended features.
gemspec

def infer_puppet_version
  # Infer the Puppet Gem version based on the Ruby Version
  ruby_ver = Gem::Version.new(RUBY_VERSION.dup)
  return '~> 6.0' if ruby_ver >= Gem::Version.new('2.5.0')
  return '~> 5.0' if ruby_ver >= Gem::Version.new('2.4.0')

  '~> 4.0'
end

group :development do
  gem 'codecov'
  gem 'github_changelog_generator' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.0')
  gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'] || ENV['PUPPET_VERSION'] || infer_puppet_version)
  gem 'simplecov', '~> 0'
  gem 'simplecov-console'
  if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.4')
    gem 'rubocop', '0.57.2'
    gem 'rubocop-rspec'
  end
end

# pin some gems for older ruby versions
gem 'fakefs', '<= 0.13.3' if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.4.0')
gem 'json_pure', '<=2.0.1' if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem 'puppet-syntax', '<= 3' if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.4.0')
gem 'rack', '~> 1' if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.2.0')

# vim:filetype=ruby

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
puppetlabs_spec_helper-2.16.0 Gemfile