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
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: 3.3
bundler-cache: true
- name: Setup Node
@ -94,7 +94,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: 3.3
bundler-cache: true
- name: Run rubocop

View File

@ -16,7 +16,7 @@ inherit_from:
- .rubocop_todo.yml
AllCops:
TargetRubyVersion: 3.2
TargetRubyVersion: 3.3
TargetRailsVersion: 7.1
UseCache: True
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 'carrierwave'
gem 'charlock_holmes', require: 'charlock_holmes/string'
gem 'csv'
gem 'docker-api', require: 'docker'
gem 'eventmachine'
gem 'factory_bot_rails'

View File

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

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.
# 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
durations = {}
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
rescue Runner::Error => e
e.waiting_duration = waiting_duration

View File

@ -37,10 +37,10 @@ def expect_json
expect_content_type('application/json')
end
def expect_redirect(path = nil, &)
if block_given?
def expect_redirect(path = nil, &block)
if block
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
elsif path
it "redirects to #{path}" do