Browse Source

Maintenance: Update dependency rubocop-performance to v1.15.2

renovatebot 2 years ago
parent
commit
7310429184

+ 4 - 4
Gemfile.lock

@@ -455,17 +455,17 @@ GEM
       rspec-core (> 3.3)
     rspec-support (3.12.0)
     rszr (1.3.0)
-    rubocop (1.41.1)
+    rubocop (1.42.0)
       json (~> 2.3)
       parallel (~> 1.10)
       parser (>= 3.1.2.1)
       rainbow (>= 2.2.2, < 4.0)
       regexp_parser (>= 1.8, < 3.0)
       rexml (>= 3.2.5, < 4.0)
-      rubocop-ast (>= 1.23.0, < 2.0)
+      rubocop-ast (>= 1.24.1, < 2.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 1.4.0, < 3.0)
-    rubocop-ast (1.24.0)
+    rubocop-ast (1.24.1)
       parser (>= 3.1.1.0)
     rubocop-faker (1.1.0)
       faker (>= 2.12.0)
@@ -476,7 +476,7 @@ GEM
       activesupport
       rubocop
       rubocop-rspec
-    rubocop-performance (1.15.1)
+    rubocop-performance (1.15.2)
       rubocop (>= 1.7.0, < 2.0)
       rubocop-ast (>= 0.4.0)
     rubocop-rails (2.17.3)

+ 1 - 1
app/models/concerns/can_clone_attachments.rb

@@ -48,7 +48,7 @@ returns
         next if body.blank?
 
         content_disposition = new_attachment.preferences['Content-Disposition'] || new_attachment.preferences['content_disposition']
-        next if content_disposition.present? && content_disposition !~ %r{inline}
+        next if content_disposition.present? && content_disposition.exclude?('inline')
 
         content_id = new_attachment.preferences['Content-ID'] || new_attachment.preferences['content_id']
         next if content_id.blank?

+ 1 - 1
app/models/text_module.rb

@@ -51,7 +51,7 @@ import text modules from i18n/text_modules/*.yml if no text modules exist yet.
     file_content = File.read(filename)
     result = Psych.load(file_content)
 
-    raise "Can't load text modules from #{filename}" if result.length.zero?
+    raise "Can't load text modules from #{filename}" if result.empty?
 
     ActiveRecord::Base.transaction do
       result.each do |text_module|

+ 1 - 1
lib/fill_db.rb

@@ -121,7 +121,7 @@ or if you only want to create 100 tickets
                                                       to_migrate: true,
                                                       to_delete:  false,
                                                       to_config:  false,
-                                                      position:   1000 + index)
+                                                      position:   index + 1000)
 
               ObjectManager::Attribute.add(object_attribute_creation[:attribute_params])
 

+ 1 - 1
lib/search_index_backend.rb

@@ -384,7 +384,7 @@ remove whole data from index
         next if order_by&.at(index).blank?
 
         # for sorting values use .keyword values (no analyzer is used - plain values)
-        if elem !~ %r{\.} && elem !~ %r{_(time|date|till|id|ids|at)$} && elem != 'id'
+        if elem.exclude?('.') && elem !~ %r{_(time|date|till|id|ids|at)$} && elem != 'id'
           elem += '.keyword'
         end
 

+ 1 - 1
lib/websocket_server.rb

@@ -163,7 +163,7 @@ class WebsocketServer
   end
 
   def self.send_to_client
-    return if @clients.size.zero?
+    return if @clients.empty?
 
     # log 'debug', 'checking for data to send...'
     @clients.each do |client_id, client|

+ 1 - 1
test/browser_test_helper.rb

@@ -1404,7 +1404,7 @@ set type of task (closeTab, closeNextInOverview, stayOnTab)
     end
     return if params[:no_sleep]
 
-    sleep 2 * params[:files].count
+    sleep params[:files].count * 2
   end
 
 =begin