Update minimum ruby version to 3.2

This commit is contained in:
Tom Hughes 2025-02-21 19:22:43 +00:00
parent 4482ed6d27
commit 2de26d54ef
11 changed files with 24 additions and 26 deletions

View file

@ -19,7 +19,7 @@ jobs:
- name: Setup ruby - name: Setup ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: 3.1 ruby-version: 3.2
rubygems: 3.4.10 rubygems: 3.4.10
bundler-cache: true bundler-cache: true
- name: Create base branch - name: Create base branch

View file

@ -6,7 +6,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true cancel-in-progress: true
env: env:
ruby: '3.1' ruby: '3.2'
jobs: jobs:
rubocop: rubocop:
name: RuboCop name: RuboCop

View file

@ -10,7 +10,7 @@ jobs:
name: Ruby ${{ matrix.ruby }} name: Ruby ${{ matrix.ruby }}
strategy: strategy:
matrix: matrix:
ruby: ['3.1', '3.2', '3.3', '3.4'] ruby: ['3.2', '3.3', '3.4']
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
RAILS_ENV: test RAILS_ENV: test

View file

@ -12,7 +12,7 @@ require:
- ./.rubocop/specific_action_names.rb - ./.rubocop/specific_action_names.rb
AllCops: AllCops:
TargetRubyVersion: 3.1 TargetRubyVersion: 3.2
NewCops: enable NewCops: enable
Exclude: Exclude:
- 'vendor/**/*' - 'vendor/**/*'
@ -108,6 +108,10 @@ Style/MixinUsage:
- 'bin/setup' - 'bin/setup'
- 'bin/update' - 'bin/update'
Style/RaiseArgs:
Exclude:
- 'lib/osm.rb'
Style/StringLiterals: Style/StringLiterals:
EnforcedStyle: double_quotes EnforcedStyle: double_quotes

View file

@ -1,4 +1,4 @@
FROM debian:bookworm FROM ruby:3.2-bookworm
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive

View file

@ -55,7 +55,6 @@ gem "bootstrap_form", "~> 5.0"
gem "cancancan" gem "cancancan"
gem "config" gem "config"
gem "delayed_job_active_record" gem "delayed_job_active_record"
gem "dry-schema", "< 1.14.0" # see https://github.com/openstreetmap/openstreetmap-website/issues/5482
gem "dry-validation" gem "dry-validation"
gem "frozen_record" gem "frozen_record"
gem "http_accept_language", "~> 2.1.1" gem "http_accept_language", "~> 2.1.1"
@ -139,9 +138,6 @@ gem "image_processing"
# Used to validate widths # Used to validate widths
gem "unicode-display_width" gem "unicode-display_width"
# Lock some modules to old versions for ruby 3.1 support
gem "zeitwerk", "< 2.7"
# Gems useful for development # Gems useful for development
group :development do group :development do
gem "better_errors" gem "better_errors"

View file

@ -231,13 +231,13 @@ GEM
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
dry-core (~> 1.1) dry-core (~> 1.1)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
dry-schema (1.13.4) dry-schema (1.14.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1) dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2) dry-core (~> 1.1)
dry-initializer (~> 3.0) dry-initializer (~> 3.2)
dry-logic (>= 1.4, < 2) dry-logic (~> 1.5)
dry-types (>= 1.7, < 2) dry-types (~> 1.8)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
dry-types (1.8.2) dry-types (1.8.2)
bigdecimal (~> 3.0) bigdecimal (~> 3.0)
@ -671,7 +671,7 @@ GEM
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.6.18) zeitwerk (2.7.2)
PLATFORMS PLATFORMS
ruby ruby
@ -708,7 +708,6 @@ DEPENDENCIES
doorkeeper doorkeeper
doorkeeper-i18n doorkeeper-i18n
doorkeeper-openid_connect doorkeeper-openid_connect
dry-schema (< 1.14.0)
dry-validation dry-validation
erb_lint erb_lint
factory_bot_rails factory_bot_rails
@ -782,7 +781,6 @@ DEPENDENCIES
validates_email_format_of (>= 1.5.1) validates_email_format_of (>= 1.5.1)
vendorer vendorer
webmock webmock
zeitwerk (< 2.7)
BUNDLED WITH BUNDLED WITH
2.5.22 2.5.22

View file

@ -22,7 +22,7 @@ of packages required before you can get the various gems installed.
## Minimum requirements ## Minimum requirements
* Ruby 3.1+ * Ruby 3.2+
* PostgreSQL 13+ * PostgreSQL 13+
* Bundler (see note below about [developer Ruby setup](#rbenv)) * Bundler (see note below about [developer Ruby setup](#rbenv))
* Javascript Runtime * Javascript Runtime

View file

@ -5,12 +5,12 @@ module SvgHelper
tag.svg path_tag, :width => 16, :height => 16 tag.svg path_tag, :width => 16, :height => 16
end end
def previous_page_svg_tag(**options) def previous_page_svg_tag(**)
adjacent_page_svg_tag(dir == "rtl" ? 1 : -1, **options) adjacent_page_svg_tag(dir == "rtl" ? 1 : -1, **)
end end
def next_page_svg_tag(**options) def next_page_svg_tag(**)
adjacent_page_svg_tag(dir == "rtl" ? -1 : 1, **options) adjacent_page_svg_tag(dir == "rtl" ? -1 : 1, **)
end end
def key_svg_tag(**options) def key_svg_tag(**options)

View file

@ -4,8 +4,8 @@ require "fileutils"
APP_ROOT = File.expand_path("..", __dir__) APP_ROOT = File.expand_path("..", __dir__)
APP_NAME = "openstreetmap".freeze APP_NAME = "openstreetmap".freeze
def system!(*args) def system!(*)
system(*args, :exception => true) system(*, :exception => true)
end end
FileUtils.chdir APP_ROOT do FileUtils.chdir APP_ROOT do

View file

@ -506,10 +506,10 @@ module OSM
end end
# Parse a float, raising a specified exception on failure # Parse a float, raising a specified exception on failure
def self.parse_float(str, klass, *args) def self.parse_float(str, klass, *)
Float(str) Float(str)
rescue StandardError rescue StandardError
raise klass.new(*args) raise klass.new(*)
end end
# Construct a random token of a given length # Construct a random token of a given length