Mercurial > repos > other > Puppet
comparison modules/stdlib/Gemfile @ 272:c42fb28cff86
Update to a newer Python module
This also pulls in an EPEL module (which we don't use) and a newer
stdlib version.
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Fri, 03 Jan 2020 19:56:04 +0000 |
parents | addb0ea390a1 |
children | d9352a684e62 |
comparison
equal
deleted
inserted
replaced
271:c62728474654 | 272:c42fb28cff86 |
---|---|
1 source ENV['GEM_SOURCE'] || 'https://rubygems.org' | 1 source ENV['GEM_SOURCE'] || 'https://rubygems.org' |
2 | 2 |
3 def location_for(place, fake_version = nil) | 3 def location_for(place_or_version, fake_version = nil) |
4 if place =~ /^(git[:@][^#]*)#(.*)/ | 4 if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)} |
5 [fake_version, { :git => $1, :branch => $2, :require => false }].compact | 5 [fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact |
6 elsif place =~ /^file:\/\/(.*)/ | 6 elsif place_or_version =~ %r{\Afile:\/\/(.*)} |
7 ['>= 0', { :path => File.expand_path($1), :require => false }] | 7 ['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }] |
8 else | 8 else |
9 [place, { :require => false }] | 9 [place_or_version, { require: false }] |
10 end | 10 end |
11 end | 11 end |
12 | 12 |
13 group :development, :unit_tests do | 13 def gem_type(place_or_version) |
14 gem 'rake', '~> 10.1.0', :require => false | 14 if place_or_version =~ %r{\Agit[:@]} |
15 gem 'rspec-puppet', :require => false | 15 :git |
16 gem 'puppetlabs_spec_helper', :require => false | 16 elsif !place_or_version.nil? && place_or_version.start_with?('file:') |
17 gem 'puppet-lint', :require => false | 17 :file |
18 gem 'pry', :require => false | 18 else |
19 gem 'simplecov', :require => false | 19 :gem |
20 end | |
20 end | 21 end |
21 | 22 |
23 ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments | |
24 minor_version = ruby_version_segments[0..1].join('.') | |
25 | |
26 group :development do | |
27 gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0') | |
28 gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') | |
29 gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') | |
30 gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9') | |
31 gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby] | |
32 gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby] | |
33 gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] | |
34 gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] | |
35 gem "puppet-blacksmith", '~> 3.4', require: false | |
36 end | |
22 group :system_tests do | 37 group :system_tests do |
23 gem 'beaker-rspec', :require => false | 38 gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby] |
24 gem 'serverspec', :require => false | 39 gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] |
40 gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13') | |
41 gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1') | |
42 gem "beaker-pe", require: false | |
43 gem "beaker-hostgenerator" | |
44 gem "beaker-rspec" | |
25 end | 45 end |
26 | 46 |
27 ENV['GEM_PUPPET_VERSION'] ||= ENV['PUPPET_GEM_VERSION'] | 47 puppet_version = ENV['PUPPET_GEM_VERSION'] |
28 puppetversion = ENV['GEM_PUPPET_VERSION'] | 48 puppet_type = gem_type(puppet_version) |
29 if puppetversion | 49 facter_version = ENV['FACTER_GEM_VERSION'] |
30 gem 'puppet', *location_for(puppetversion) | 50 hiera_version = ENV['HIERA_GEM_VERSION'] |
31 else | 51 |
32 gem 'puppet', :require => false | 52 def puppet_older_than?(version) |
53 puppet_version = ENV['PUPPET_GEM_VERSION'] | |
54 !puppet_version.nil? && | |
55 Gem::Version.correct?(puppet_version) && | |
56 Gem::Requirement.new("< #{version}").satisfied_by?(Gem::Version.new(puppet_version.dup)) | |
33 end | 57 end |
34 | 58 |
35 # vim:ft=ruby | 59 gems = {} |
60 | |
61 gems['puppet'] = location_for(puppet_version) | |
62 | |
63 # If facter or hiera versions have been specified via the environment | |
64 # variables, use those versions. If not, and if the puppet version is < 3.5.0, | |
65 # use known good versions of both for puppet < 3.5.0. | |
66 if facter_version | |
67 gems['facter'] = location_for(facter_version) | |
68 elsif puppet_type == :gem && puppet_older_than?('3.5.0') | |
69 gems['facter'] = ['>= 1.6.11', '<= 1.7.5', require: false] | |
70 end | |
71 | |
72 if hiera_version | |
73 gems['hiera'] = location_for(ENV['HIERA_GEM_VERSION']) | |
74 elsif puppet_type == :gem && puppet_older_than?('3.5.0') | |
75 gems['hiera'] = ['>= 1.0.0', '<= 1.3.0', require: false] | |
76 end | |
77 | |
78 if Gem.win_platform? && (puppet_type != :gem || puppet_older_than?('3.5.0')) | |
79 # For Puppet gems < 3.5.0 (tested as far back as 3.0.0) on Windows | |
80 if puppet_type == :gem | |
81 gems['ffi'] = ['1.9.0', require: false] | |
82 gems['minitar'] = ['0.5.4', require: false] | |
83 gems['win32-eventlog'] = ['0.5.3', '<= 0.6.5', require: false] | |
84 gems['win32-process'] = ['0.6.5', '<= 0.7.5', require: false] | |
85 gems['win32-security'] = ['~> 0.1.2', '<= 0.2.5', require: false] | |
86 gems['win32-service'] = ['0.7.2', '<= 0.8.8', require: false] | |
87 else | |
88 gems['ffi'] = ['~> 1.9.0', require: false] | |
89 gems['minitar'] = ['~> 0.5.4', require: false] | |
90 gems['win32-eventlog'] = ['~> 0.5', '<= 0.6.5', require: false] | |
91 gems['win32-process'] = ['~> 0.6', '<= 0.7.5', require: false] | |
92 gems['win32-security'] = ['~> 0.1', '<= 0.2.5', require: false] | |
93 gems['win32-service'] = ['~> 0.7', '<= 0.8.8', require: false] | |
94 end | |
95 | |
96 gems['win32-dir'] = ['~> 0.3', '<= 0.4.9', require: false] | |
97 | |
98 if RUBY_VERSION.start_with?('1.') | |
99 gems['win32console'] = ['1.3.2', require: false] | |
100 # sys-admin was removed in Puppet 3.7.0 and doesn't compile under Ruby 2.x | |
101 gems['sys-admin'] = ['1.5.6', require: false] | |
102 end | |
103 | |
104 # Puppet < 3.7.0 requires these. | |
105 # Puppet >= 3.5.0 gem includes these as requirements. | |
106 # The following versions are tested to work with 3.0.0 <= puppet < 3.7.0. | |
107 gems['win32-api'] = ['1.4.8', require: false] | |
108 gems['win32-taskscheduler'] = ['0.2.2', require: false] | |
109 gems['windows-api'] = ['0.4.3', require: false] | |
110 gems['windows-pr'] = ['1.2.3', require: false] | |
111 elsif Gem.win_platform? | |
112 # If we're using a Puppet gem on Windows which handles its own win32-xxx gem | |
113 # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445). | |
114 gems['win32-dir'] = ['<= 0.4.9', require: false] | |
115 gems['win32-eventlog'] = ['<= 0.6.5', require: false] | |
116 gems['win32-process'] = ['<= 0.7.5', require: false] | |
117 gems['win32-security'] = ['<= 0.2.5', require: false] | |
118 gems['win32-service'] = ['<= 0.8.8', require: false] | |
119 end | |
120 | |
121 gems.each do |gem_name, gem_params| | |
122 gem gem_name, *gem_params | |
123 end | |
124 | |
125 # Evaluate Gemfile.local and ~/.gemfile if they exist | |
126 extra_gemfiles = [ | |
127 "#{__FILE__}.local", | |
128 File.join(Dir.home, '.gemfile'), | |
129 ] | |
130 | |
131 extra_gemfiles.each do |gemfile| | |
132 if File.file?(gemfile) && File.readable?(gemfile) | |
133 eval(File.read(gemfile), binding) | |
134 end | |
135 end | |
136 # vim: syntax=ruby |