Skip to content

Commit

Permalink
Merge pull request chocolatey-archive#48 from puppetlabs/hunner_msync
Browse files Browse the repository at this point in the history
(MODULES-3704) Update gemfile template to be identical
  • Loading branch information
eputnam authored Nov 14, 2016
2 parents 35b34ff + 1030b80 commit f5781a1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
6 changes: 5 additions & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
- ".config"

Gemfile:
supports_windows: true
required:
':development':
- gem: rake
Expand All @@ -47,8 +46,13 @@ Gemfile:
- gem: mocha
version: '~>0.10.5'
- gem: pry
- gem: json_pure
version: '<= 2.0.1'
condition: "Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')"
':system_tests':
- gem: beaker
from_env: BEAKER_VERSION
version: '~> 2.20'
- gem: master_manipulator
version: '~> 1.2'
- gem: beaker-windows
Expand Down
56 changes: 27 additions & 29 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#This file is generated by ModuleSync, do not edit.

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

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

# Used for gem conditionals
supports_windows = true

# The following gems are not included by default as they require DevKit on Windows.
# You should probably include them in a Gemfile.local or a ~/.gemfile
#gem 'pry' #this may already be included in the gemfile
Expand All @@ -36,62 +41,52 @@ end
#end

group :development do
gem 'rake', :require => false
gem 'rspec', '~>3.0', :require => false
gem 'puppet-lint', :require => false
gem 'puppetlabs_spec_helper', '~>0.10.3', :require => false
gem 'puppet_facts', :require => false
gem 'mocha', '~>0.10.5', :require => false
gem 'pry', :require => false
gem 'rake', :require => false
gem 'rspec', '~>3.0', :require => false
gem 'puppet-lint', :require => false
gem 'puppetlabs_spec_helper', '~>0.10.3', :require => false
gem 'puppet_facts', :require => false
gem 'mocha', '~>0.10.5', :require => false
gem 'pry', :require => false
gem 'json_pure', '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
end

group :system_tests do
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 2.20')
gem 'master_manipulator', '~> 1.2', :require => false
gem 'beaker-windows', '~> 0.6', :require => false
gem 'beaker-hostgenerator', '~> 0.6', :require => false
gem 'master_manipulator', '~> 1.2', :require => false
gem 'beaker-windows', '~> 0.6', :require => false
gem 'beaker-hostgenerator', '~> 0.6', :require => false
end

# The recommendation is for PROJECT_GEM_VERSION, although there are older ways
# of referencing these. Add them all for compatibility reasons. We'll remove
# later when no issues are known. We'll prefer them in the right order.
puppetversion = ENV['PUPPET_GEM_VERSION'] || ENV['GEM_PUPPET_VERSION'] || ENV['PUPPET_LOCATION'] || '>= 0'
gem 'puppet', *location_for(puppetversion)

# json_pure 2.0.2 added a requirement on ruby >= 2. We pin to json_pure 2.0.1
# if using ruby 1.x
gem 'json_pure', '<=2.0.1', :require => false if RUBY_VERSION =~ /^1\./
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])

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

# For Windows dependencies, these could be required based on the version of
# Puppet you are requiring. Anything greater than v3.5.0 is going to have
# Windows-specific dependencies dictated by the gem itself. The other scenario
# is when you are faking out Puppet to use a local file path / git path.
explicitly_require_windows_gems = false
puppet_gem_location = gem_type(puppetversion)
puppet_gem_location = gem_type(ENV['PUPPET_GEM_VERSION'])
# This is not a perfect answer to the version check
if puppet_gem_location != :gem || puppetversion < '3.5.0'
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'])))
if Gem::Platform.local.os == 'mingw32'
explicitly_require_windows_gems = true
end

if puppet_gem_location == :gem
# If facterversion hasn't been specified and we are
# looking for a Puppet Gem version less than 3.5.0, we
# need to ensure we get a good Facter for specs.
gem "facter",">= 1.6.11","<= 1.7.5",:require => false unless facterversion
gem "facter",">= 1.6.11","<= 1.7.5",:require => false unless ENV['FACTER_GEM_VERSION']
# If hieraversion hasn't been specified and we are
# looking for a Puppet Gem version less than 3.5.0, we
# need to ensure we get a good Hiera for specs.
gem "hiera",">= 1.0.0","<= 1.3.0",:require => false unless hieraversion
gem "hiera",">= 1.0.0","<= 1.3.0",:require => false unless ENV['HIERA_GEM_VERSION']
end
end

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

# sys-admin was removed in Puppet 3.7.0+, and doesn't compile
# under Ruby 2.3 - so restrict it to Ruby 1.x
gem "sys-admin", "1.5.6", :require => false if RUBY_VERSION =~ /^1\./

# Puppet less than 3.7.0 requires these.
# Puppet 3.5.0+ will control the actual requirements.
# These are listed in formats that work with all versions of
# Puppet from 3.0.0 to 3.6.x. After that, these were no longer used.
# We do not want to allow newer versions than what came out after
# 3.6.x to be used as they constitute some risk in breaking older
# functionality. So we set these to exact versions.
gem "sys-admin", "1.5.6", :require => false
gem "win32-api", "1.4.8", :require => false
gem "win32-taskscheduler", "0.2.2", :require => false
gem "windows-api", "0.4.3", :require => false
Expand Down

0 comments on commit f5781a1

Please sign in to comment.