Maintenance: Bump rubocop from 1.23.0 to 1.24.1

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.23.0 to 1.24.1.
- [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.23.0...v1.24.1)
This commit is contained in:
Martin Gruner 2022-01-03 08:21:16 +01:00
parent 2393fc85f2
commit 2c4ca0adfa
13 changed files with 23 additions and 31 deletions

View file

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

View file

@ -18,8 +18,7 @@ module HasPublishing
params_for_update = params
.permit(:id, :internal_at, :published_at, :archived_at)
.to_h
.map { |k, v| [k.to_sym, v == '--now--' ? Time.zone.now : v] }
.to_h
.to_h { |k, v| [k.to_sym, v == '--now--' ? Time.zone.now : v] }
model_update_render(klass, params_for_update)
end

View file

@ -33,8 +33,7 @@ module KnowledgeBaseRichTextHelper
settings = match
.slice(1...-1)
.split(',')
.map { |pair| pair.split(':').map(&:strip) }
.to_h
.to_h { |pair| pair.split(':').map(&:strip) }
.symbolize_keys
url = case settings[:provider]

View file

@ -93,9 +93,9 @@ returns
data = YAML.load_file(Rails.root.join('config/holiday_calendars.yml'))
url = data['url']
data['countries'].map do |country, domain|
data['countries'].to_h do |country, domain|
[format(url, domain: domain), country]
end.to_h
end
end
=begin

View file

@ -561,7 +561,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
end
def message_header_hash(mail)
imported_fields = mail.header.fields.map do |f|
imported_fields = mail.header.fields.to_h do |f|
begin
value = if f.value.match?(ISO2022JP_REGEXP)
value = header_field_unpack_japanese(f)
@ -582,7 +582,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
value = f.decoded.to_utf8(fallback: :read_as_sanitized_binary)
end
[f.name.downcase, value]
end.to_h
end
# imported_fields = mail.header.fields.map { |f| [f.name.downcase, f.to_utf8] }.to_h
raw_fields = mail.header.fields.index_by { |f| "raw-#{f.name.downcase}" }
@ -910,9 +910,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
md5 = Digest::MD5.hexdigest(msg)
file_path = Rails.root.join('tmp', folder, "#{md5}.eml")
File.open(file_path, 'wb') do |file|
file.write msg
end
File.binwrite(file_path, msg)
file_path
end

View file

@ -211,9 +211,7 @@ returns
if !path
path = Rails.root.join('tmp', filename)
end
::File.open(path, 'wb') do |handle|
handle.write file.content
end
::File.binwrite(path, file.content)
path
end

View file

@ -25,9 +25,9 @@ class Sequencer
def mapped
@mapped ||= begin
resource_with_indifferent_access = resource.with_indifferent_access
mapping.symbolize_keys.collect do |source, local|
mapping.symbolize_keys.to_h do |source, local|
[local, resource_with_indifferent_access[source]]
end.to_h.with_indifferent_access
end.with_indifferent_access
end
end

View file

@ -35,12 +35,12 @@ class Sequencer
end
def folder_total_map
ews_folder_ids.collect do |folder_id|
ews_folder_ids.to_h do |folder_id|
folder = ews_folder.find(folder_id)
display_path = ews_folder.display_path(folder)
[display_path, folder.total_count]
end.to_h
end
end
end
end

View file

@ -16,12 +16,12 @@ class Sequencer
return {} if custom_fields.blank?
custom_fields.select { |custom_field| ticket_field_map[ custom_field['id'] ].present? }
.map do |custom_field|
.to_h do |custom_field|
[
ticket_field_map[ custom_field['id'] ].to_sym, # remote_name
custom_field['value']
]
end.to_h
end
end
end
end

View file

@ -20,9 +20,7 @@ class Sessions::Store::File
# store session data in session file
FileUtils.mkpath path_tmp
File.open(session_file, 'wb') do |file|
file.write content
end
File.binwrite(session_file, content)
# destroy old session if needed
if File.exist?(path)

View file

@ -88,7 +88,7 @@ RSpec.describe 'User endpoint', type: :request do
context 'parameter groups' do
let(:group_names_access_map) do
Group.all.map { |g| [g.name, ['full']] }.to_h
Group.all.to_h { |g| [g.name, ['full']] }
end
let(:payload) do
@ -103,7 +103,7 @@ RSpec.describe 'User endpoint', type: :request do
context 'parameter group_ids' do
let(:group_ids_access_map) do
Group.all.map { |g| [g.id, ['full']] }.to_h
Group.all.to_h { |g| [g.id, ['full']] }
end
let(:payload) do
@ -436,7 +436,7 @@ RSpec.describe 'User endpoint', type: :request do
let(:privileged) do
{
groups: Group.all.map { |g| [g.name, ['full']] }.to_h
groups: Group.all.to_h { |g| [g.name, ['full']] }
}
end
@ -448,7 +448,7 @@ RSpec.describe 'User endpoint', type: :request do
let(:privileged) do
{
group_ids: Group.all.map { |g| [g.id, ['full']] }.to_h
group_ids: Group.all.to_h { |g| [g.id, ['full']] }
}
end

View file

@ -167,7 +167,7 @@ RSpec.describe 'System > Objects', type: :system do
context 'when checking field sorting', db_strategy: :reset do
# lexicographically ordered list of option strings
let(:options) { %w[0 000.000 1 100.100 100.200 2 200.100 200.200 3 ä b n ö p sr ß st t ü v] }
let(:options_hash) { options.reverse.collect { |o| [o, o] }.to_h }
let(:options_hash) { options.reverse.to_h { |o| [o, o] } }
let(:object_attribute) do
attribute = create(:object_manager_attribute_select, data_option: { options: options_hash, default: 0 }, position: 999)

View file

@ -4681,7 +4681,7 @@ wait untill text in selector disabppears
=end
def set_setting(name, value)
name_to_id = fetch_settings.map { |s| [s['name'], s['id']] }.to_h
name_to_id = fetch_settings.to_h { |s| [s['name'], s['id']] }
id = name_to_id[name]
url = URI.parse(browser_url)