Browse Source

Bumps [rubocop-performance](https://github.com/rubocop-hq/rubocop-performance) from 1.1.0 to 1.4.1.
- [Release notes](https://github.com/rubocop-hq/rubocop-performance/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop-performance/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-performance/compare/v1.1.0...v1.4.1)

Thorsten Eckel 5 years ago
parent
commit
1c63e96675

+ 2 - 2
Gemfile.lock

@@ -448,8 +448,8 @@ GEM
       rainbow (>= 2.2.2, < 4.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 1.4.0, < 1.7)
-    rubocop-performance (1.1.0)
-      rubocop (>= 0.67.0)
+    rubocop-performance (1.4.1)
+      rubocop (>= 0.71.0)
     rubocop-rails (2.3.2)
       rack (>= 1.1)
       rubocop (>= 0.72.0)

+ 1 - 1
app/controllers/monitoring_controller.rb

@@ -303,7 +303,7 @@ curl http://localhost/api/v1/monitoring/amount_check?token=XXX&periode=1h
     raise Exceptions::UnprocessableEntity, 'periode is missing!' if params[:periode].blank?
 
     scale = params[:periode][-1, 1]
-    raise Exceptions::UnprocessableEntity, 'periode need to have s, m, h or d as last!' if scale !~ /^(s|m|h|d)$/
+    raise Exceptions::UnprocessableEntity, 'periode need to have s, m, h or d as last!' if !scale.match?(/^(s|m|h|d)$/)
 
     periode = params[:periode][0, params[:periode].length - 1]
     raise Exceptions::UnprocessableEntity, 'periode need to be an integer!' if periode.to_i.zero?

+ 1 - 1
app/models/channel/driver/imap.rb

@@ -182,7 +182,7 @@ example
         # check if verify message exists
         subject = message_meta['ENVELOPE'].subject
         next if !subject
-        next if subject !~ /#{verify_string}/
+        next if !subject.match?(/#{verify_string}/)
 
         Rails.logger.info " - verify email #{verify_string} found"
         timeout(600) do

+ 1 - 1
app/models/channel/driver/pop3.rb

@@ -117,7 +117,7 @@ returns
         next if !mail
 
         # check if verify message exists
-        next if mail !~ /#{verify_string}/
+        next if !mail.match?(/#{verify_string}/)
 
         Rails.logger.info " - verify email #{verify_string} found"
         m.delete

+ 1 - 1
app/models/channel/email_parser.rb

@@ -734,7 +734,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
         'image/gif':               %w[gif image],
       }
       map.each do |type, ext|
-        next if headers_store['Content-Type'] !~ /^#{Regexp.quote(type)}/i
+        next if !headers_store['Content-Type'].match?(/^#{Regexp.quote(type)}/i)
 
         filename = if headers_store['Content-Description'].present?
                      "#{headers_store['Content-Description']}.#{ext[0]}".to_s.force_encoding('utf-8')

+ 1 - 1
app/models/channel/filter/follow_up_possible_check.rb

@@ -8,7 +8,7 @@ module Channel::Filter::FollowUpPossibleCheck
 
     ticket = Ticket.lookup(id: ticket_id)
     return true if !ticket
-    return true if ticket.state.state_type.name !~ /^(closed|merged|removed)/i
+    return true if !ticket.state.state_type.name.match?(/^(closed|merged|removed)/i)
 
     # in case of closed tickets, remove follow-up information
     case ticket.group.follow_up_possible

+ 2 - 2
app/models/channel/filter/identify_sender.rb

@@ -104,7 +104,7 @@ module Channel::Filter::IdentifySender
         items.each do |address_data|
           email_address = address_data.address
           next if email_address.blank?
-          next if email_address !~ /@/
+          next if !email_address.match?(/@/)
           next if email_address.match?(/\s/)
 
           user_create(
@@ -132,7 +132,7 @@ module Channel::Filter::IdentifySender
             display_name = $1
           end
           next if address.blank?
-          next if address !~ /@/
+          next if !address.match?(/@/)
           next if address.match?(/\s/)
 
           user_create(

+ 1 - 1
app/models/channel/filter/out_of_office_check.rb

@@ -8,7 +8,7 @@ module Channel::Filter::OutOfOfficeCheck
 
     # check ms out of office characteristics
     if mail[ 'x-auto-response-suppress'.to_sym ]
-      return if mail[ 'x-auto-response-suppress'.to_sym ] !~ /all/i
+      return if !mail[ 'x-auto-response-suppress'.to_sym ].match?(/all/i)
       return if !mail[ 'x-ms-exchange-inbox-rules-loop'.to_sym ]
 
       mail[ 'x-zammad-out-of-office'.to_sym ] = true

+ 2 - 2
app/models/channel/filter/own_notification_loop_detection.rb

@@ -9,10 +9,10 @@ module Channel::Filter::OwnNotificationLoopDetection
 
     recedence = mail['precedence'.to_sym]
     return if !recedence
-    return if recedence !~ /bulk/i
+    return if !recedence.match?(/bulk/i)
 
     fqdn = Setting.get('fqdn')
-    return if message_id !~ /@#{Regexp.quote(fqdn)}>/i
+    return if !message_id.match?(/@#{Regexp.quote(fqdn)}>/i)
 
     mail[ 'x-zammad-ignore'.to_sym ] = true
     Rails.logger.info "Detected own sent notification mail and dropped it to prevent loops (message_id: #{message_id}, from: #{mail[:from]}, to: #{mail[:to]})"

+ 2 - 2
app/models/channel/filter/trusted.rb

@@ -8,7 +8,7 @@ module Channel::Filter::Trusted
     # check if trust x-headers
     if !channel[:trusted]
       mail.each_key do |key|
-        next if key !~ /^x-zammad/i
+        next if !key.match?(/^x-zammad/i)
 
         mail.delete(key)
       end
@@ -17,7 +17,7 @@ module Channel::Filter::Trusted
 
     # verify values
     mail.each do |key, value|
-      next if key !~ /^x-zammad/i
+      next if !key.match?(/^x-zammad/i)
 
       # no assoc exists, remove header
       next if Channel::EmailParser.check_attributes_by_x_headers(key, value)

Some files were not shown because too many files changed in this diff