mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-22 00:57:26 +00:00
Merge pull request #13861 from mkllnk/bump-ruby
Bump Ruby from 3.3.10 to 3.4.8
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -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
|
||||
@@ -1 +1 @@
|
||||
3.3.10
|
||||
3.4.8
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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)"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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
22
script/bump-ruby.sh
Executable 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"
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user