@@ -28,11 +28,12 @@ group :development do
2828 gem "fast_gettext" , require : false if Gem ::Version . new ( RUBY_VERSION . dup ) >= Gem ::Version . new ( '2.1.0' )
2929 gem "json_pure" , '<= 2.0.1' , require : false if Gem ::Version . new ( RUBY_VERSION . dup ) < Gem ::Version . new ( '2.0.0' )
3030 gem "json" , '= 1.8.1' , require : false if Gem ::Version . new ( RUBY_VERSION . dup ) == Gem ::Version . new ( '2.1.9' )
31+ gem "json" , '<= 2.0.4' , require : false if Gem ::Version . new ( RUBY_VERSION . dup ) == Gem ::Version . new ( '2.4.4' )
3132 gem "puppet-module-posix-default-r#{ minor_version } " , require : false , platforms : [ :ruby ]
3233 gem "puppet-module-posix-dev-r#{ minor_version } " , require : false , platforms : [ :ruby ]
3334 gem "puppet-module-win-default-r#{ minor_version } " , require : false , platforms : [ :mswin , :mingw , :x64_mingw ]
3435 gem "puppet-module-win-dev-r#{ minor_version } " , require : false , platforms : [ :mswin , :mingw , :x64_mingw ]
35- gem "puppet-blacksmith" , '~> 3.4' , require : false
36+ gem "puppet-blacksmith" , '~> 3.4' , require : false , platforms : [ :ruby ]
3637end
3738group :system_tests do
3839 gem "puppet-module-posix-system-r#{ minor_version } " , require : false , platforms : [ :ruby ]
@@ -49,73 +50,24 @@ puppet_type = gem_type(puppet_version)
4950facter_version = ENV [ 'FACTER_GEM_VERSION' ]
5051hiera_version = ENV [ 'HIERA_GEM_VERSION' ]
5152
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 ) )
57- end
58-
5953gems = { }
6054
6155gems [ 'puppet' ] = location_for ( puppet_version )
6256
6357# 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
58+ # variables
7759
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
60+ gems [ 'facter' ] = location_for ( facter_version ) if facter_version
61+ gems [ 'hiera' ] = location_for ( hiera_version ) if hiera_version
10362
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?
63+ if Gem . win_platform? && puppet_version =~ %r{^(file:///|git://)}
11264 # If we're using a Puppet gem on Windows which handles its own win32-xxx gem
11365 # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
11466 gems [ 'win32-dir' ] = [ '<= 0.4.9' , require : false ]
11567 gems [ 'win32-eventlog' ] = [ '<= 0.6.5' , require : false ]
11668 gems [ 'win32-process' ] = [ '<= 0.7.5' , require : false ]
11769 gems [ 'win32-security' ] = [ '<= 0.2.5' , require : false ]
118- gems [ 'win32-service' ] = [ '<= 0.8.8' , require : false ]
70+ gems [ 'win32-service' ] = [ '0.8.8' , require : false ]
11971end
12072
12173gems . each do |gem_name , gem_params |
0 commit comments