Maintenance: Bump rubocop from 1.21.0 to 1.22.0

This commit is contained in:
Martin Gruner 2021-09-30 09:18:16 +02:00 committed by Thorsten Eckel
parent 4e4ba091d4
commit 51933e3b76
5 changed files with 8 additions and 12 deletions

View file

@ -498,13 +498,13 @@ GEM
rspec-support (~> 3.10)
rspec-support (3.10.2)
rszr (0.5.2)
rubocop (1.21.0)
rubocop (1.22.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.9.1, < 2.0)
rubocop-ast (>= 1.12.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.12.0)

View file

@ -502,7 +502,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
path = Rails.root.join('tmp/unprocessable_mail')
files = []
Dir.glob("#{path}/*.eml") do |entry|
ticket, _article, _user, _mail = Channel::EmailParser.new.process(params, IO.binread(entry))
ticket, _article, _user, _mail = Channel::EmailParser.new.process(params, File.binread(entry))
next if ticket.blank?
files.push entry

View file

@ -162,7 +162,7 @@ satinize html string based on whiltelist
if node.is_a?(Nokogiri::XML::Text) && node.content.present? && node.content.include?(':') && node.ancestors.map(&:name).exclude?('a')
urls = URI.extract(node.content, LINKABLE_URL_SCHEMES)
.map { |u| u.sub(%r{[,.]$}, '') } # URI::extract captures trailing dots/commas
.reject { |u| u.match?(%r{^[^:]+:$}) } # URI::extract will match, e.g., 'tel:'
.grep_v(%r{^[^:]+:$}) # URI::extract will match, e.g., 'tel:'
next if urls.blank?

View file

@ -104,9 +104,7 @@ Oversized Email Message Body #{'#' * 120_000}
# 1. verify that the oversized email has been saved locally to:
# /tmp/oversized_mail/yyyy-mm-ddThh:mm:ss-:md5.eml
path = Rails.root.join('tmp/oversized_mail')
target_files = Dir.entries(path).select do |filename|
filename =~ %r{^#{large_message_md5}\.eml$}
end
target_files = Dir.entries(path).grep(%r{^#{large_message_md5}\.eml$})
assert(target_files.present?, 'Large message .eml log file must be present.')
# pick the latest file that matches the criteria
@ -193,9 +191,7 @@ Oversized Email Message Body #{'#' * 120_000}
# 1. verify that the oversized email has been saved locally to:
# /tmp/oversized_mail/yyyy-mm-ddThh:mm:ss-:md5.eml
path = Rails.root.join('tmp/oversized_mail')
target_files = Dir.entries(path).select do |filename|
filename =~ %r{^.+?\.eml$}
end
target_files = Dir.entries(path).grep(%r{^.+?\.eml$})
assert_not(target_files.blank?, 'Large message .eml log file must be blank.')
# 2. verify that a postmaster response email has been sent to the sender

View file

@ -62,7 +62,7 @@ class ActiveSupport::TestCase
# read config file and count type & recipients
file = Rails.root.join('log', "#{Rails.env}.log")
lines = []
IO.foreach(file) do |line|
File.foreach(file) do |line|
lines.push line
end
count = 0