Bump rubocop from 1.57.2 to 1.58.0 and fix offenses

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.57.2 to 1.58.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.57.2...v1.58.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2023-12-04 03:12:30 +00:00
committed by Sebastian Serth
parent be3264ac25
commit bcb6409126
6 changed files with 10 additions and 10 deletions

View File

@ -229,7 +229,7 @@ module Lti
hide_test_results
disable_hints
disable_download].each do |option|
value = params["custom_embed_options_#{option}".to_sym] == 'true'
value = params[:"custom_embed_options_#{option}"] == 'true'
# Optimize storage and save only those that are true, the session cookie is limited to 4KB
@embed_options[option] = value if value.present?
end

View File

@ -28,7 +28,7 @@ class TipsController < ApplicationController
params[:tip]
.permit(:title, :description, :example, :file_type_id)
.each {|_key, value| value.strip! unless value.is_a?(Array) }
.each_value {|value| value.strip! unless value.is_a?(Array) }
.merge(user: current_user)
end
private :tip_params

View File

@ -12,7 +12,7 @@ class ApplicationRecord < ActiveRecord::Base
# and except the `log` of TestrunMessages or the `output` of Testruns
attribute_names.without('content', 'log', 'output').each do |name|
if send(name.to_sym).respond_to?(:strip)
send("#{name}=".to_sym, send(name).strip)
send(:"#{name}=", send(name).strip)
end
end
end
@ -21,7 +21,7 @@ class ApplicationRecord < ActiveRecord::Base
# remove null bytes from string attributes
attribute_names.each do |name|
if send(name.to_sym).respond_to?(:tr)
send("#{name}=".to_sym, send(name).tr("\0", ''))
send(:"#{name}=", send(name).tr("\0", ''))
end
end
end

View File

@ -213,7 +213,7 @@ class Submission < ApplicationRecord
private
def build_files_hash(files, attribute)
files&.map(&attribute.to_proc)&.zip(files)&.to_h || {}
files&.map(&attribute.to_proc)&.zip(files).to_h
end
def prepared_runner
@ -269,7 +269,7 @@ class Submission < ApplicationRecord
def score_file(output, file, requesting_user)
assessor = Assessor.new(execution_environment:)
assessment = assessor.assess(output)
passed = ((assessment[:passed] == assessment[:count]) and (assessment[:score]).positive?)
passed = (assessment[:passed] == assessment[:count]) and (assessment[:score]).positive?
testrun_output = passed ? nil : "status: #{output[:status]}\n stdout: #{output[:stdout]}\n stderr: #{output[:stderr]}"
if testrun_output.present?
execution_environment.error_templates.each do |template|