Update Ruby to 3.3

This commit is contained in:
Sebastian Serth
2023-12-25 11:01:23 +01:00
parent aa8222a9ef
commit 04863f1f25
8 changed files with 18 additions and 15 deletions

View File

@ -25,7 +25,7 @@ jobs:
- name: Setup Ruby - name: Setup Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: 3.2 ruby-version: 3.3
bundler-cache: true bundler-cache: true
- name: Setup Node - name: Setup Node
@ -94,7 +94,7 @@ jobs:
- name: Setup Ruby - name: Setup Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: 3.2 ruby-version: 3.3
bundler-cache: true bundler-cache: true
- name: Run rubocop - name: Run rubocop

View File

@ -16,7 +16,7 @@ inherit_from:
- .rubocop_todo.yml - .rubocop_todo.yml
AllCops: AllCops:
TargetRubyVersion: 3.2 TargetRubyVersion: 3.3
TargetRailsVersion: 7.1 TargetRailsVersion: 7.1
UseCache: True UseCache: True
NewCops: enable NewCops: enable

View File

@ -1 +1 @@
3.2.2 3.3.0

View File

@ -8,6 +8,7 @@ gem 'bootsnap', require: false
gem 'bootstrap-will_paginate' gem 'bootstrap-will_paginate'
gem 'carrierwave' gem 'carrierwave'
gem 'charlock_holmes', require: 'charlock_holmes/string' gem 'charlock_holmes', require: 'charlock_holmes/string'
gem 'csv'
gem 'docker-api', require: 'docker' gem 'docker-api', require: 'docker'
gem 'eventmachine' gem 'eventmachine'
gem 'factory_bot_rails' gem 'factory_bot_rails'

View File

@ -131,6 +131,7 @@ GEM
crack (0.4.5) crack (0.4.5)
rexml rexml
crass (1.0.6) crass (1.0.6)
csv (3.2.8)
dachsfisch (1.0.0) dachsfisch (1.0.0)
nokogiri (>= 1.14.1, < 2.0.0) nokogiri (>= 1.14.1, < 2.0.0)
database_cleaner (2.0.2) database_cleaner (2.0.2)
@ -291,7 +292,7 @@ GEM
pagedown-bootstrap-rails (2.1.4) pagedown-bootstrap-rails (2.1.4)
railties (> 3.1) railties (> 3.1)
parallel (1.24.0) parallel (1.24.0)
parser (3.3.0.2) parser (3.3.0.4)
ast (~> 2.4.1) ast (~> 2.4.1)
racc racc
pg (1.5.4) pg (1.5.4)
@ -414,11 +415,11 @@ GEM
rspec-mocks (~> 3.12) rspec-mocks (~> 3.12)
rspec-support (~> 3.12) rspec-support (~> 3.12)
rspec-support (3.12.1) rspec-support (3.12.1)
rubocop (1.59.0) rubocop (1.60.1)
json (~> 2.3) json (~> 2.3)
language_server-protocol (>= 3.17.0) language_server-protocol (>= 3.17.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.2.2.4) parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0) regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0) rexml (>= 3.2.5, < 4.0)
@ -573,6 +574,7 @@ DEPENDENCIES
capybara capybara
carrierwave carrierwave
charlock_holmes charlock_holmes
csv
database_cleaner database_cleaner
docker-api docker-api
eventmachine eventmachine
@ -647,4 +649,4 @@ DEPENDENCIES
zxcvbn-ruby zxcvbn-ruby
BUNDLED WITH BUNDLED WITH
2.5.3 2.5.5

View File

@ -53,9 +53,9 @@ module ApplicationHelper
ActionController::Base.helpers.sanitize Kramdown::Document.new(markdown, input: 'GFM', hard_wrap: false).to_html.strip ActionController::Base.helpers.sanitize Kramdown::Document.new(markdown, input: 'GFM', hard_wrap: false).to_html.strip
end end
def row(options = {}, &) def row(options = {}, &block)
tag.div(class: 'attribute-row row') do tag.div(class: 'attribute-row row') do
label_column(options[:label]) + value_column(options[:value], &) label_column(options[:label]) + value_column(options[:value], &block)
end end
end end

View File

@ -169,11 +169,11 @@ class Submission < ApplicationRecord
# @raise [Runner::Error] if the code could not be run due to a failure with the runner. # @raise [Runner::Error] if the code could not be run due to a failure with the runner.
# See the specific type and message for more details. # See the specific type and message for more details.
def run(file, &) def run(file, &block)
run_command = command_for execution_environment.run_command, file.filepath run_command = command_for execution_environment.run_command, file.filepath
durations = {} durations = {}
prepared_runner do |runner, waiting_duration| prepared_runner do |runner, waiting_duration|
durations[:execution_duration] = runner.attach_to_execution(run_command, &) durations[:execution_duration] = runner.attach_to_execution(run_command, &block)
durations[:waiting_duration] = waiting_duration durations[:waiting_duration] = waiting_duration
rescue Runner::Error => e rescue Runner::Error => e
e.waiting_duration = waiting_duration e.waiting_duration = waiting_duration

View File

@ -37,10 +37,10 @@ def expect_json
expect_content_type('application/json') expect_content_type('application/json')
end end
def expect_redirect(path = nil, &) def expect_redirect(path = nil, &block)
if block_given? if block
it 'performs a redirect to the location given' do it 'performs a redirect to the location given' do
expect(controller).to redirect_to(instance_eval(&)) expect(controller).to redirect_to(instance_eval(&block))
end end
elsif path elsif path
it "redirects to #{path}" do it "redirects to #{path}" do