Skip to content

Commit

Permalink
build: relax Puppet version
Browse files Browse the repository at this point in the history
Makes this gem easier to use, because you no longer need
to override ENV[PUPPET_VERSION] if you don't want Puppet 5.
  • Loading branch information
mxey committed Jun 18, 2024
1 parent 37a5a9b commit cc2918b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 39 deletions.
24 changes: 0 additions & 24 deletions config/puppet-versions.json

This file was deleted.

17 changes: 2 additions & 15 deletions octocatalog-diff.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
require 'json'

DEFAULT_PUPPET_VERSION = '5.5.22'.freeze

Gem::Specification.new do |s|
s.required_ruby_version = '>= 2.6.0'
puppet_version = ENV['PUPPET_VERSION'] || DEFAULT_PUPPET_VERSION

s.name = 'octocatalog-diff'
s.version = ENV['OCTOCATALOG_DIFF_VERSION'] || File.read(File.join(File.dirname(__FILE__), '.version')).strip
Expand All @@ -30,23 +27,13 @@ EOF
s.add_runtime_dependency 'hashdiff', '>= 0.3.0'
s.add_runtime_dependency 'parallel', '>= 1.12.0'
s.add_runtime_dependency 'rugged', '>= 0.25.0b2'
s.add_runtime_dependency 'puppet', puppet_version
s.add_development_dependency 'puppet', puppet_version
s.add_runtime_dependency 'puppet', '>= 7'
s.add_development_dependency 'puppet', '>= 7'
s.add_development_dependency 'rspec', '~> 3.4.0'
s.add_development_dependency 'rake', '12.3.3'
s.add_development_dependency 'parallel_tests', '2.7.1'
s.add_development_dependency 'rspec-retry', '0.5.0'
s.add_development_dependency 'rubocop', '= 0.49.0'
s.add_development_dependency 'simplecov', '~> 0.14.1'
s.add_development_dependency 'simplecov-erb', '~> 0.1.1'

puppet_v = Gem::Version.new(puppet_version)
version_config = JSON.parse(File.read(File.join(File.dirname(__FILE__), 'config', 'puppet-versions.json')))
version_config.each do |data|
next unless puppet_v >= Gem::Version.new(data['minimum_version'])
next unless puppet_v <= Gem::Version.new(data['maximum_version'])
data['additional_gems'].each do |additional_gem|
s.add_development_dependency additional_gem['name'], additional_gem['version']
end
end
end

0 comments on commit cc2918b

Please sign in to comment.