You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Gemfile 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. source ENV['GEM_SOURCE'] || 'https://rubygems.org'
  2. def location_for(place_or_version, fake_version = nil)
  3. git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
  4. file_url_regex = %r{\Afile:\/\/(?<path>.*)}
  5. if place_or_version && (git_url = place_or_version.match(git_url_regex))
  6. [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
  7. elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
  8. ['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
  9. else
  10. [place_or_version, { require: false }]
  11. end
  12. end
  13. ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
  14. minor_version = ruby_version_segments[0..1].join('.')
  15. group :development do
  16. gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
  17. gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
  18. gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
  19. gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
  20. gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
  21. gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
  22. gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
  23. gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
  24. gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
  25. gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
  26. gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
  27. gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
  28. gem "rspec-puppet-facts", '~> 1.7', require: false
  29. gem "rspec-puppet", require: false
  30. gem "puppet-strings", require: false
  31. gem "rgen", require: false
  32. gem "hiera-eyaml", require: false
  33. gem "puppet-lint-resource_reference_syntax", require: false
  34. gem "puppet-lint-trailing_comma-check", require: false
  35. gem "puppet-lint-variable_contains_upcase", require: false
  36. end
  37. puppet_version = ENV['PUPPET_GEM_VERSION']
  38. facter_version = ENV['FACTER_GEM_VERSION']
  39. hiera_version = ENV['HIERA_GEM_VERSION']
  40. gems = {}
  41. gems['puppet'] = location_for(puppet_version)
  42. # If facter or hiera versions have been specified via the environment
  43. # variables
  44. gems['facter'] = location_for(facter_version) if facter_version
  45. gems['hiera'] = location_for(hiera_version) if hiera_version
  46. if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
  47. # If we're using a Puppet gem on Windows which handles its own win32-xxx gem
  48. # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
  49. gems['win32-dir'] = ['<= 0.4.9', require: false]
  50. gems['win32-eventlog'] = ['<= 0.6.5', require: false]
  51. gems['win32-process'] = ['<= 0.7.5', require: false]
  52. gems['win32-security'] = ['<= 0.2.5', require: false]
  53. gems['win32-service'] = ['0.8.8', require: false]
  54. end
  55. gems.each do |gem_name, gem_params|
  56. gem gem_name, *gem_params
  57. end
  58. # Evaluate Gemfile.local and ~/.gemfile if they exist
  59. extra_gemfiles = [
  60. "#{__FILE__}.local",
  61. File.join(Dir.home, '.gemfile'),
  62. ]
  63. extra_gemfiles.each do |gemfile|
  64. if File.file?(gemfile) && File.readable?(gemfile)
  65. eval(File.read(gemfile), binding)
  66. end
  67. end
  68. # vim: syntax=ruby