diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3df6df41..ef00c095 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml index 0644dd07..25330640 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,7 +16,7 @@ inherit_from: - .rubocop_todo.yml AllCops: - TargetRubyVersion: 3.2 + TargetRubyVersion: 3.3 TargetRailsVersion: 7.1 UseCache: True NewCops: enable diff --git a/.ruby-version b/.ruby-version index be94e6f5..15a27998 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.3.0 diff --git a/Gemfile b/Gemfile index eb1d24a5..bf8bfbb5 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index 0c776600..a148b1ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 28e84c1f..eece4aae 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/models/submission.rb b/app/models/submission.rb index 00d06612..145ddf52 100644 --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -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 diff --git a/spec/support/controllers.rb b/spec/support/controllers.rb index 6101e91c..0e888303 100644 --- a/spec/support/controllers.rb +++ b/spec/support/controllers.rb @@ -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