Skip to content

Commit f5781a1

Browse files
authored
Merge pull request chocolatey-archive#48 from puppetlabs/hunner_msync
(MODULES-3704) Update gemfile template to be identical
2 parents 35b34ff + 1030b80 commit f5781a1

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

.sync.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
- ".config"
3535

3636
Gemfile:
37-
supports_windows: true
3837
required:
3938
':development':
4039
- gem: rake
@@ -47,8 +46,13 @@ Gemfile:
4746
- gem: mocha
4847
version: '~>0.10.5'
4948
- gem: pry
49+
- gem: json_pure
50+
version: '<= 2.0.1'
51+
condition: "Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')"
5052
':system_tests':
5153
- gem: beaker
54+
from_env: BEAKER_VERSION
55+
version: '~> 2.20'
5256
- gem: master_manipulator
5357
version: '~> 1.2'
5458
- gem: beaker-windows

Gemfile

+27-29
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#This file is generated by ModuleSync, do not edit.
2+
13
source ENV['GEM_SOURCE'] || "https://rubygems.org"
24

35
# Determines what type of gem is requested based on place_or_version.
@@ -25,6 +27,9 @@ def location_for(place_or_version, fake_version = nil)
2527
end
2628
end
2729

30+
# Used for gem conditionals
31+
supports_windows = true
32+
2833
# The following gems are not included by default as they require DevKit on Windows.
2934
# You should probably include them in a Gemfile.local or a ~/.gemfile
3035
#gem 'pry' #this may already be included in the gemfile
@@ -36,62 +41,52 @@ end
3641
#end
3742

3843
group :development do
39-
gem 'rake', :require => false
40-
gem 'rspec', '~>3.0', :require => false
41-
gem 'puppet-lint', :require => false
42-
gem 'puppetlabs_spec_helper', '~>0.10.3', :require => false
43-
gem 'puppet_facts', :require => false
44-
gem 'mocha', '~>0.10.5', :require => false
45-
gem 'pry', :require => false
44+
gem 'rake', :require => false
45+
gem 'rspec', '~>3.0', :require => false
46+
gem 'puppet-lint', :require => false
47+
gem 'puppetlabs_spec_helper', '~>0.10.3', :require => false
48+
gem 'puppet_facts', :require => false
49+
gem 'mocha', '~>0.10.5', :require => false
50+
gem 'pry', :require => false
51+
gem 'json_pure', '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
4652
end
4753

4854
group :system_tests do
4955
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 2.20')
50-
gem 'master_manipulator', '~> 1.2', :require => false
51-
gem 'beaker-windows', '~> 0.6', :require => false
52-
gem 'beaker-hostgenerator', '~> 0.6', :require => false
56+
gem 'master_manipulator', '~> 1.2', :require => false
57+
gem 'beaker-windows', '~> 0.6', :require => false
58+
gem 'beaker-hostgenerator', '~> 0.6', :require => false
5359
end
5460

55-
# The recommendation is for PROJECT_GEM_VERSION, although there are older ways
56-
# of referencing these. Add them all for compatibility reasons. We'll remove
57-
# later when no issues are known. We'll prefer them in the right order.
58-
puppetversion = ENV['PUPPET_GEM_VERSION'] || ENV['GEM_PUPPET_VERSION'] || ENV['PUPPET_LOCATION'] || '>= 0'
59-
gem 'puppet', *location_for(puppetversion)
60-
61-
# json_pure 2.0.2 added a requirement on ruby >= 2. We pin to json_pure 2.0.1
62-
# if using ruby 1.x
63-
gem 'json_pure', '<=2.0.1', :require => false if RUBY_VERSION =~ /^1\./
61+
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
6462

6563
# Only explicitly specify Facter/Hiera if a version has been specified.
6664
# Otherwise it can lead to strange bundler behavior. If you are seeing weird
6765
# gem resolution behavior, try setting `DEBUG_RESOLVER` environment variable
6866
# to `1` and then run bundle install.
69-
facterversion = ENV['FACTER_GEM_VERSION'] || ENV['GEM_FACTER_VERSION'] || ENV['FACTER_LOCATION']
70-
gem "facter", *location_for(facterversion) if facterversion
71-
hieraversion = ENV['HIERA_GEM_VERSION'] || ENV['GEM_HIERA_VERSION'] || ENV['HIERA_LOCATION']
72-
gem "hiera", *location_for(hieraversion) if hieraversion
67+
gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION']
68+
gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION']
7369

7470
# For Windows dependencies, these could be required based on the version of
7571
# Puppet you are requiring. Anything greater than v3.5.0 is going to have
7672
# Windows-specific dependencies dictated by the gem itself. The other scenario
7773
# is when you are faking out Puppet to use a local file path / git path.
7874
explicitly_require_windows_gems = false
79-
puppet_gem_location = gem_type(puppetversion)
75+
puppet_gem_location = gem_type(ENV['PUPPET_GEM_VERSION'])
8076
# This is not a perfect answer to the version check
81-
if puppet_gem_location != :gem || puppetversion < '3.5.0'
77+
if puppet_gem_location != :gem || (Gem::Version.correct?(ENV['PUPPET_GEM_VERSION']) && Gem::Requirement.new('< 3.5.0').satisfied_by?(Gem::Version.new(ENV['PUPPET_GEM_VERSION'])))
8278
if Gem::Platform.local.os == 'mingw32'
8379
explicitly_require_windows_gems = true
8480
end
85-
8681
if puppet_gem_location == :gem
8782
# If facterversion hasn't been specified and we are
8883
# looking for a Puppet Gem version less than 3.5.0, we
8984
# need to ensure we get a good Facter for specs.
90-
gem "facter",">= 1.6.11","<= 1.7.5",:require => false unless facterversion
85+
gem "facter",">= 1.6.11","<= 1.7.5",:require => false unless ENV['FACTER_GEM_VERSION']
9186
# If hieraversion hasn't been specified and we are
9287
# looking for a Puppet Gem version less than 3.5.0, we
9388
# need to ensure we get a good Hiera for specs.
94-
gem "hiera",">= 1.0.0","<= 1.3.0",:require => false unless hieraversion
89+
gem "hiera",">= 1.0.0","<= 1.3.0",:require => false unless ENV['HIERA_GEM_VERSION']
9590
end
9691
end
9792

@@ -117,14 +112,17 @@ if explicitly_require_windows_gems
117112
gem "win32-dir", "~> 0.3","<= 0.4.9", :require => false
118113
gem "win32console", "1.3.2", :require => false if RUBY_VERSION =~ /^1\./
119114

115+
# sys-admin was removed in Puppet 3.7.0+, and doesn't compile
116+
# under Ruby 2.3 - so restrict it to Ruby 1.x
117+
gem "sys-admin", "1.5.6", :require => false if RUBY_VERSION =~ /^1\./
118+
120119
# Puppet less than 3.7.0 requires these.
121120
# Puppet 3.5.0+ will control the actual requirements.
122121
# These are listed in formats that work with all versions of
123122
# Puppet from 3.0.0 to 3.6.x. After that, these were no longer used.
124123
# We do not want to allow newer versions than what came out after
125124
# 3.6.x to be used as they constitute some risk in breaking older
126125
# functionality. So we set these to exact versions.
127-
gem "sys-admin", "1.5.6", :require => false
128126
gem "win32-api", "1.4.8", :require => false
129127
gem "win32-taskscheduler", "0.2.2", :require => false
130128
gem "windows-api", "0.4.3", :require => false

0 commit comments

Comments
 (0)