Skip to content

Commit c470111

Browse files
authored
Merge pull request #8992 from joshcooper/maint/main/PUP-11649_remove_ruby_older_then_2.7
(PUP-11649) Drop MRI < 2.7
2 parents 7f96b47 + a40bcf8 commit c470111

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
1818
s.version = mdata ? mdata[1] : version
1919

2020
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1")
21+
# Bump this in PUP-11716
2122
s.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
2223
s.authors = ["Puppet Labs"]
2324
s.date = "2012-08-17"

.github/workflows/checks.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
strategy:
1717
matrix:
1818
cfg:
19-
- {check: rubocop, os: ubuntu-latest, ruby: 2.5}
20-
- {check: commits, os: ubuntu-latest, ruby: 2.5}
21-
- {check: warnings, os: ubuntu-latest, ruby: 2.5}
19+
- {check: rubocop, os: ubuntu-latest, ruby: 2.7}
20+
- {check: commits, os: ubuntu-latest, ruby: 2.7}
21+
- {check: warnings, os: ubuntu-latest, ruby: 2.7}
2222

2323
runs-on: ${{ matrix.cfg.os }}
2424
steps:

.github/workflows/rspec_tests.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ jobs:
1616
strategy:
1717
matrix:
1818
cfg:
19-
- {os: ubuntu-latest, ruby: '2.5'}
20-
- {os: ubuntu-latest, ruby: '2.6'}
2119
- {os: ubuntu-latest, ruby: '2.7'}
2220
- {os: ubuntu-latest, ruby: '3.0'}
2321
- {os: ubuntu-20.04, ruby: '3.2'} # openssl 1.1.1
2422
- {os: ubuntu-22.04, ruby: '3.2'} # openssl 3
2523
- {os: ubuntu-latest, ruby: 'jruby-9.2.21.0'}
26-
- {os: windows-2019, ruby: '2.5'}
27-
- {os: windows-2019, ruby: '2.6'}
2824
- {os: windows-2019, ruby: '2.7'}
2925
- {os: windows-2019, ruby: '3.0'}
3026
- {os: windows-2019, ruby: '3.2'} # openssl 3

ext/project_data.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gem_executables: 'puppet'
1515
gem_default_executables: 'puppet'
1616
gem_license: 'Apache-2.0'
1717
gem_forge_project: 'puppet'
18-
gem_required_ruby_version: '>= 2.5.0'
18+
gem_required_ruby_version: '>= 2.7.0'
1919
gem_required_rubygems_version: '> 1.3.1'
2020
gem_runtime_dependencies:
2121
facter: ['> 2.0.1', '< 5']

lib/puppet.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
require_relative 'puppet/version'
22
require_relative 'puppet/concurrent/synchronized'
33

4-
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new("2.5.0")
5-
raise LoadError, "Puppet #{Puppet.version} requires Ruby 2.5.0 or greater, found Ruby #{RUBY_VERSION.dup}."
4+
# Update JRuby version constraints in PUP-11716
5+
if !defined?(JRUBY_VERSION) && Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new("2.7.0")
6+
raise LoadError, "Puppet #{Puppet.version} requires Ruby 2.7.0 or greater, found Ruby #{RUBY_VERSION.dup}."
67
end
78

8-
Puppet::OLDEST_RECOMMENDED_RUBY_VERSION = '2.5.0'
9+
Puppet::OLDEST_RECOMMENDED_RUBY_VERSION = '2.7.0'
910

1011
$LOAD_PATH.extend(Puppet::Concurrent::Synchronized)
1112

@@ -130,6 +131,7 @@ def self.run_mode
130131

131132
# Now that settings are loaded we have the code loaded to be able to issue
132133
# deprecation warnings. Warn if we're on a deprecated ruby version.
134+
# Update JRuby version constraints in PUP-11716
133135
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new(Puppet::OLDEST_RECOMMENDED_RUBY_VERSION)
134136
Puppet.deprecation_warning(_("Support for ruby version %{version} is deprecated and will be removed in a future release. See https://puppet.com/docs/puppet/latest/system_requirements.html for a list of supported ruby versions.") % { version: RUBY_VERSION })
135137
end

0 commit comments

Comments
 (0)