From e56f657bed6c3b1cb5492e7a8cf995013c4388b5 Mon Sep 17 00:00:00 2001 From: Patrik Ragnarsson Date: Tue, 16 Jan 2024 10:50:27 +0100 Subject: [PATCH] Require Ruby 2.7.8 as minimum Ruby version (#1993) Ruby 2.6 reached end-of-life 2022-04: https://en.wikipedia.org/wiki/History_of_Ruby Ruby 2.7.8 was still supported less than a year ago and doesn't cause and particular problems right now. --- .github/workflows/test.yml | 3 +-- .rubocop.yml | 2 +- Gemfile | 14 +------------- README.md | 20 +++++++------------- rack-protection/rack-protection.gemspec | 2 +- sinatra-contrib/sinatra-contrib.gemspec | 2 +- sinatra.gemspec | 2 +- 7 files changed, 13 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cfdd26c013..c9bbcf5370 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,6 @@ jobs: rack: - stable ruby: - - "2.6" - "2.7" - "3.0" - "3.1" @@ -77,7 +76,7 @@ jobs: tilt: - stable # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' - ruby: [2.6, 2.7, '3.0', 3.1, 3.2, 3.3, jruby, truffleruby] + ruby: [2.7, '3.0', 3.1, 3.2, 3.3, jruby, truffleruby] include: # Rack - { ruby: 3.2, rack: head, puma: stable, tilt: stable, rack_session: stable, allow-failure: true } diff --git a/.rubocop.yml b/.rubocop.yml index ae3aef8d26..acc9f59e68 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,7 +9,7 @@ # # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md AllCops: - TargetRubyVersion: 2.6 + TargetRubyVersion: 2.7 SuggestExtensions: false NewCops: enable Exclude: diff --git a/Gemfile b/Gemfile index 57ba675d46..bffd1c1531 100644 --- a/Gemfile +++ b/Gemfile @@ -30,12 +30,6 @@ gem 'yard' # used by rake doc gem 'rack-protection', path: 'rack-protection' gem 'sinatra-contrib', path: 'sinatra-contrib' -# traces 0.10.0 started to use Ruby 2.7 syntax without specifying required Ruby version -# https://github.com/socketry/traces/pull/8#discussion_r1237988182 -# async-http 0.60.2 added traces 0.10.0 as dependency -# https://github.com/socketry/async-http/pull/124/files#r1237988899 -gem 'traces', '< 0.10.0' if RUBY_VERSION >= '2.6.0' && RUBY_VERSION < '2.7.0' - gem 'asciidoctor' gem 'builder' gem 'childprocess', '>= 5' @@ -46,13 +40,7 @@ gem 'falcon', '~> 0.40', platforms: [:ruby] gem 'haml', '~> 6' gem 'kramdown' gem 'liquid' -# markaby 0.9.1 introduced Ruby 2.7 syntax in https://github.com/markaby/markaby/pull/44 -# and does not specify required_ruby_version -if RUBY_VERSION >= '2.6.0' && RUBY_VERSION < '2.7.0' - gem 'markaby', '< 0.9.1' -else - gem 'markaby' -end +gem 'markaby' gem 'nokogiri', '> 1.5.0' gem 'pandoc-ruby', '~> 2.0.2' gem 'rabl' diff --git a/README.md b/README.md index be6e596eb0..5dcbd7bdcf 100644 --- a/README.md +++ b/README.md @@ -2820,30 +2820,24 @@ uses a threaded model of concurrency. The following Ruby versions are officially supported:
-
Ruby 2.6
+
Ruby
- 2.6 is fully supported and recommended. There are currently no plans to - drop official support for it. + The stable releases are fully supported and recommended.
-
Rubinius
+
TruffleRuby
- Rubinius is officially supported (Rubinius >= 2.x). It is recommended to - gem install puma. + The latest stable release of TruffleRuby is supported.
JRuby
- The latest stable release of JRuby is officially supported. It is not - recommended to use C extensions with JRuby. It is recommended to - gem install trinidad. + The latest stable release of JRuby is supported. It is not + recommended to use C extensions with JRuby.
-Versions of Ruby before 2.6 are no longer supported as of Sinatra 3.0.0. - -We also keep an eye on upcoming Ruby versions. Expect upcoming -3.x releases to be fully supported. +Versions of Ruby before 2.7.8 are no longer supported as of Sinatra 4.0.0. Sinatra should work on any operating system supported by the chosen Ruby implementation. diff --git a/rack-protection/rack-protection.gemspec b/rack-protection/rack-protection.gemspec index b95d118573..1a8640dbe7 100644 --- a/rack-protection/rack-protection.gemspec +++ b/rack-protection/rack-protection.gemspec @@ -36,7 +36,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can 'rubygems_mfa_required' => 'true' } - s.required_ruby_version = '>= 2.6.0' + s.required_ruby_version = '>= 2.7.8' # dependencies s.add_dependency 'base64', '>= 0.1.0' diff --git a/sinatra-contrib/sinatra-contrib.gemspec b/sinatra-contrib/sinatra-contrib.gemspec index 782fa881a5..6fb28e5153 100644 --- a/sinatra-contrib/sinatra-contrib.gemspec +++ b/sinatra-contrib/sinatra-contrib.gemspec @@ -35,7 +35,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can 'rubygems_mfa_required' => 'true' } - s.required_ruby_version = '>= 2.6.0' + s.required_ruby_version = '>= 2.7.8' s.add_dependency 'multi_json', '>= 0.0.2' s.add_dependency 'mustermann', '~> 3.0' diff --git a/sinatra.gemspec b/sinatra.gemspec index 7df5871ad2..50a27b9264 100644 --- a/sinatra.gemspec +++ b/sinatra.gemspec @@ -43,7 +43,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can 'documentation_uri' => 'https://www.rubydoc.info/gems/sinatra' } - s.required_ruby_version = '>= 2.6.0' + s.required_ruby_version = '>= 2.7.8' s.add_dependency 'mustermann', '~> 3.0' s.add_dependency 'rack', '>= 3.0.0', '< 4'