Maintenance: Updated rubocop(-* gems) to latest version (1.11.0).
This commit is contained in:
parent
06be90f038
commit
e5dc99deea
9 changed files with 14 additions and 16 deletions
|
@ -292,7 +292,7 @@ GEM
|
||||||
mini_portile2 (2.5.0)
|
mini_portile2 (2.5.0)
|
||||||
mini_racer (0.2.9)
|
mini_racer (0.2.9)
|
||||||
libv8 (>= 6.9.411)
|
libv8 (>= 6.9.411)
|
||||||
minitest (5.14.3)
|
minitest (5.14.4)
|
||||||
msgpack (1.2.4)
|
msgpack (1.2.4)
|
||||||
multi_json (1.15.0)
|
multi_json (1.15.0)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
|
@ -455,7 +455,7 @@ GEM
|
||||||
rspec-support (~> 3.9.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-support (3.9.3)
|
rspec-support (3.9.3)
|
||||||
rszr (0.5.2)
|
rszr (0.5.2)
|
||||||
rubocop (1.10.0)
|
rubocop (1.11.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 3.0.0.0)
|
parser (>= 3.0.0.0)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
|
@ -466,7 +466,7 @@ GEM
|
||||||
unicode-display_width (>= 1.4.0, < 3.0)
|
unicode-display_width (>= 1.4.0, < 3.0)
|
||||||
rubocop-ast (1.4.1)
|
rubocop-ast (1.4.1)
|
||||||
parser (>= 2.7.1.5)
|
parser (>= 2.7.1.5)
|
||||||
rubocop-performance (1.9.2)
|
rubocop-performance (1.10.0)
|
||||||
rubocop (>= 0.90.0, < 2.0)
|
rubocop (>= 0.90.0, < 2.0)
|
||||||
rubocop-ast (>= 0.4.0)
|
rubocop-ast (>= 0.4.0)
|
||||||
rubocop-rails (2.9.1)
|
rubocop-rails (2.9.1)
|
||||||
|
|
|
@ -174,7 +174,7 @@ class FormController < ApplicationController
|
||||||
Rails.logger.info 'Invalid token for form!'
|
Rails.logger.info 'Invalid token for form!'
|
||||||
raise Exceptions::NotAuthorized
|
raise Exceptions::NotAuthorized
|
||||||
end
|
end
|
||||||
parts = result.split(/:/)
|
parts = result.split(':')
|
||||||
if parts.count != 3
|
if parts.count != 3
|
||||||
Rails.logger.info "Invalid token for form (need to have 3 parts, only #{parts.count} found)!"
|
Rails.logger.info "Invalid token for form (need to have 3 parts, only #{parts.count} found)!"
|
||||||
raise Exceptions::NotAuthorized
|
raise Exceptions::NotAuthorized
|
||||||
|
|
|
@ -157,7 +157,7 @@ class TicketsController < ApplicationController
|
||||||
|
|
||||||
# create tags if given
|
# create tags if given
|
||||||
if params[:tags].present?
|
if params[:tags].present?
|
||||||
tags = params[:tags].split(/,/)
|
tags = params[:tags].split(',')
|
||||||
tags.each do |tag|
|
tags.each do |tag|
|
||||||
ticket.tag_add(tag)
|
ticket.tag_add(tag)
|
||||||
end
|
end
|
||||||
|
|
|
@ -61,7 +61,7 @@ get assets and record_ids of selector
|
||||||
# get assets of condition
|
# get assets of condition
|
||||||
models = Models.all
|
models = Models.all
|
||||||
send(selector).each do |item, content|
|
send(selector).each do |item, content|
|
||||||
attribute = item.split(/\./)
|
attribute = item.split('.')
|
||||||
next if !attribute[1]
|
next if !attribute[1]
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -80,7 +80,7 @@ returns
|
||||||
|
|
||||||
def case_sensitive_find_by(**attrs)
|
def case_sensitive_find_by(**attrs)
|
||||||
return nil if attrs.empty?
|
return nil if attrs.empty?
|
||||||
return find_by(**attrs) if Rails.application.config.db_case_sensitive || attrs.values.none? { |v| v.is_a?(String) }
|
return find_by(**attrs) if Rails.application.config.db_case_sensitive || attrs.values.none?(String)
|
||||||
|
|
||||||
where(**attrs).find { |record| record[attrs.keys.first] == attrs.values.first }
|
where(**attrs).find { |record| record[attrs.keys.first] == attrs.values.first }
|
||||||
end
|
end
|
||||||
|
|
|
@ -411,7 +411,7 @@ returns
|
||||||
|
|
||||||
array.each { |elem| elem.append(nil) if elem.one? }
|
array.each { |elem| elem.append(nil) if elem.one? }
|
||||||
|
|
||||||
Hash[*array.flatten] # rubocop:disable Style/HashConversion
|
Hash[*array.flatten]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Parses RFC822 header
|
# Parses RFC822 header
|
||||||
|
|
|
@ -651,9 +651,7 @@ check if country is blocked for chat
|
||||||
return false if geo_ip['country_code'].blank?
|
return false if geo_ip['country_code'].blank?
|
||||||
|
|
||||||
countries = block_country.split(';')
|
countries = block_country.split(';')
|
||||||
countries.any? do |local_country|
|
countries.any?(geo_ip['country_code'])
|
||||||
geo_ip['country_code'] == local_country
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -575,7 +575,7 @@ condition example
|
||||||
# get tables to join
|
# get tables to join
|
||||||
tables = ''
|
tables = ''
|
||||||
selectors.each_key do |attribute|
|
selectors.each_key do |attribute|
|
||||||
selector = attribute.split(/\./)
|
selector = attribute.split('.')
|
||||||
next if !selector[1]
|
next if !selector[1]
|
||||||
next if selector[0] == 'ticket'
|
next if selector[0] == 'ticket'
|
||||||
next if selector[0] == 'execution_time'
|
next if selector[0] == 'execution_time'
|
||||||
|
@ -630,7 +630,7 @@ condition example
|
||||||
return nil if selector['pre_condition'] && selector['pre_condition'] !~ /^(not_set|current_user\.|specific)/
|
return nil if selector['pre_condition'] && selector['pre_condition'] !~ /^(not_set|current_user\.|specific)/
|
||||||
|
|
||||||
# get attributes
|
# get attributes
|
||||||
attributes = attribute.split(/\./)
|
attributes = attribute.split('.')
|
||||||
attribute = "#{ActiveRecord::Base.connection.quote_table_name("#{attributes[0]}s")}.#{ActiveRecord::Base.connection.quote_column_name(attributes[1])}"
|
attribute = "#{ActiveRecord::Base.connection.quote_table_name("#{attributes[0]}s")}.#{ActiveRecord::Base.connection.quote_column_name(attributes[1])}"
|
||||||
|
|
||||||
# magic selectors
|
# magic selectors
|
||||||
|
@ -639,7 +639,7 @@ condition example
|
||||||
end
|
end
|
||||||
|
|
||||||
if attributes[0] == 'ticket' && attributes[1] == 'tags'
|
if attributes[0] == 'ticket' && attributes[1] == 'tags'
|
||||||
selector['value'] = selector['value'].split(/,/).collect(&:strip)
|
selector['value'] = selector['value'].split(',').collect(&:strip)
|
||||||
end
|
end
|
||||||
|
|
||||||
if selector['operator'].include?('in working time')
|
if selector['operator'].include?('in working time')
|
||||||
|
@ -993,7 +993,7 @@ perform changes on ticket
|
||||||
if key == 'ticket.tags'
|
if key == 'ticket.tags'
|
||||||
next if value['value'].blank?
|
next if value['value'].blank?
|
||||||
|
|
||||||
tags = value['value'].split(/,/)
|
tags = value['value'].split(',')
|
||||||
case value['operator']
|
case value['operator']
|
||||||
when 'add'
|
when 'add'
|
||||||
tags.each do |tag|
|
tags.each do |tag|
|
||||||
|
|
|
@ -491,7 +491,7 @@ example for aggregations within one year
|
||||||
if selector.present?
|
if selector.present?
|
||||||
selector.each do |key, data|
|
selector.each do |key, data|
|
||||||
data = data.clone
|
data = data.clone
|
||||||
table, key_tmp = key.split(/\./)
|
table, key_tmp = key.split('.')
|
||||||
if key_tmp.blank?
|
if key_tmp.blank?
|
||||||
key_tmp = table
|
key_tmp = table
|
||||||
table = 'ticket'
|
table = 'ticket'
|
||||||
|
|
Loading…
Reference in a new issue