Merge pull request #13861 from mkllnk/bump-ruby

Bump Ruby from 3.3.10 to 3.4.8
This commit is contained in:
David Cook
2026-01-20 16:34:31 +11:00
committed by GitHub
12 changed files with 36 additions and 60 deletions

1
.gitattributes vendored
View File

@@ -8,4 +8,3 @@
# Same thing for following files, but they don't have an sh extension
pre-commit eol=lf
webpack-dev-server eol=lf
install-bundler eol=lf

View File

@@ -1 +1 @@
3.3.10
3.4.8

View File

@@ -1,4 +1,4 @@
FROM ruby:3.3.10-alpine3.19 AS base
FROM ruby:3.4.8-alpine3.19 AS base
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
TZ=Europe/London \

View File

@@ -83,11 +83,8 @@ RUN wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.z
# Copy code and install app dependencies
COPY . /usr/src/app/
# Install Bundler
RUN ./script/install-bundler
# Install front-end dependencies
RUN yarn install
# Run bundler install in parallel with the amount of available CPUs
RUN bundle install --jobs="$(nproc)"
RUN bundle install --jobs="$(nproc)"

View File

@@ -1114,7 +1114,7 @@ DEPENDENCIES
wkhtmltopdf-binary
RUBY VERSION
ruby 3.3.10p183
ruby 3.4.8p72
BUNDLED WITH
2.5.22
4.0.3

View File

@@ -93,8 +93,8 @@ module Spree
type.demodulize.downcase
end
def self.find_with_destroyed(*args)
unscoped { find(*args) }
def self.find_with_destroyed(*)
unscoped { find(*) }
end
def payment_profiles_supported?

View File

@@ -16,7 +16,7 @@ FileUtils.chdir APP_ROOT do
# Add necessary setup steps to this file.
puts "== Installing dependencies =="
system! "script/install-bundler"
# Check first (it's quicker), then install new gems if necessary
system("bundle check 2> /dev/null") || system!(BUNDLE_ENV, "bundle install")

View File

@@ -392,9 +392,9 @@ module Reporting
end
end
def filter_scope(*args)
def filter_scope(*)
chain_to_scope do
where(*args)
where(*)
end
end
end

22
script/bump-ruby.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env sh
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <new-version>"
echo "Example: $0 3.4.8"
exit 1
fi
set -ex
OLD_VERSION=$(cat .ruby-version)
NEW_VERSION=$1
PATTERN="$(echo "$OLD_VERSION" | sed 's:[]\[^$.*/]:\\&:g')"
sed -i "s/\<$PATTERN\>/$NEW_VERSION/" .ruby-version Dockerfile
script/rbenv-install.sh
# Update bundler to the version shipped with Ruby:
bundle update --bundler
git commit -a -m "Bump Ruby from $OLD_VERSION to $NEW_VERSION"

View File

@@ -1,42 +0,0 @@
#!/bin/sh
# This shell script looks for the last used Bundler version in Gemfile.lock and
# installs exactly that version, removing all other versions.
# Command line arguments are passed on to `gem install`. So you can call this
# script with with arguments:
#
# ./script/install-bundler --no-ri --no-rdoc
# This script is used by ofn-install and can by handy in your development
# environment.
# Fail if a single command fails.
set -e
# `grep`: find the occurrences of "BUNDLED WITH" (-m is unnecessary and behaves different on macOS)
# `-A`: print the next line after "BUNDLED WITH" as well
# `-F`: find exactly that string
# `tail -n 1`: take the last line, the version line
# `tr -d`: delete all spaces, the indent before the version
version="$(grep -A 1 -F "BUNDLED WITH" Gemfile.lock | tail -n 1 | tr -d '[:space:]')"
# if the length of $version is zero
if [ -z "$version" ]; then
echo >&2 "No bundler version in Gemfile.lock."
exit 1
fi
# Get the currently used bundler version.
# We ignore all errors with `2>/dev/null || true` in case there is no bundler
# or only an orphaned shim installed.
current="$(bundler --version 2>/dev/null || true)"
if [ "$current" = "Bundler version $version" ]; then
echo >&2 "Already up-to-date: $current"
exit 0
fi
# Passing on all arguments of this script with "$@".
gem install bundler -v "$version" "$@"
gem uninstall bundler -v "!= $version" 2>/dev/null || true

View File

@@ -2,12 +2,12 @@
module OpenFoodNetwork
module PerformanceHelper
def multi_benchmark(num_samples, cache_key_patterns: [], &block)
def multi_benchmark(num_samples, cache_key_patterns: [], &)
results = (0..num_samples).map do |_i|
ActiveRecord::Base.connection.query_cache.clear
delete_cache_keys(cache_key_patterns)
result = Benchmark.measure(&block)
result = Benchmark.measure(&)
puts result

View File

@@ -68,9 +68,9 @@ RSpec.describe "DFC Permissions", feature: "cqcm-dev", vcr: true do
end
end
def within_platform_list(variant, &block)
def within_platform_list(variant, &)
retry_expectations(on: Ferrum::JavaScriptError) do
within(platform_list(variant), &block)
within(platform_list(variant), &)
end
end