Browse Source

Maintenance: Updated rubocop(-* gems) to latest version (1.10.0).

Thorsten Eckel 4 years ago
parent
commit
027a1d4d63

+ 3 - 3
Gemfile.lock

@@ -248,7 +248,7 @@ GEM
     http-form_data (2.1.1)
     http_parser.rb (0.6.0)
     httpclient (2.8.3)
-    i18n (1.8.8)
+    i18n (1.8.9)
       concurrent-ruby (~> 1.0)
     icalendar (2.5.3)
       ice_cube (~> 0.16)
@@ -454,7 +454,7 @@ GEM
       rspec-support (~> 3.9.0)
     rspec-support (3.9.3)
     rszr (0.5.2)
-    rubocop (1.9.1)
+    rubocop (1.10.0)
       parallel (~> 1.10)
       parser (>= 3.0.0.0)
       rainbow (>= 2.2.2, < 4.0)
@@ -472,7 +472,7 @@ GEM
       activesupport (>= 4.2.0)
       rack (>= 1.1)
       rubocop (>= 0.90.0, < 2.0)
-    rubocop-rspec (2.1.0)
+    rubocop-rspec (2.2.0)
       rubocop (~> 1.0)
       rubocop-ast (>= 1.1.0)
     ruby-progressbar (1.11.0)

+ 1 - 1
app/controllers/monitoring_controller.rb

@@ -119,7 +119,7 @@ curl http://localhost/api/v1/monitoring/health_check?token=XXX
       handler_attempts_map[job_name][:attempts] += job.attempts
     end
 
-    Hash[handler_attempts_map.sort].each_with_index do |(job_name, job_data), index|
+    handler_attempts_map.sort.to_h.each_with_index do |(job_name, job_data), index|
       issues.push "Failed to run background job ##{index + 1} '#{job_name}' #{job_data[:count]} time(s) with #{job_data[:attempts]} attempt(s)."
     end
 

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

@@ -411,7 +411,7 @@ returns
 
     array.each { |elem| elem.append(nil) if elem.one? }
 
-    Hash[*array.flatten]
+    Hash[*array.flatten] # rubocop:disable Style/HashConversion
   end
 
   # Parses RFC822 header

+ 3 - 1
lib/core_ext/active_record/calculations/pluck_as_hash.rb

@@ -26,7 +26,9 @@ module ActiveRecord
 
     def pluck_as_hash_map(keys, values)
       if keys.one?
-        Hash[keys.first, values]
+        {
+          keys.first => values
+        }
       else
         keys.zip(values).to_h
       end

+ 2 - 2
test/browser/admin_object_manager_test.rb

@@ -597,7 +597,7 @@ class AdminObjectManagerTest < TestCase
 
     # lexicographically ordered list of option strings
     options = %w[0 000.000 1 100.100 100.200 2 200.100 200.200 3 ä b n ö p sr ß st t ü v]
-    options_hash = Hash[options.reverse.collect { |o| [o, o] }]
+    options_hash = options.reverse.collect { |o| [o, o] }.to_h
 
     object_manager_attribute_create(
       data: {
@@ -678,7 +678,7 @@ class AdminObjectManagerTest < TestCase
       url:      browser_url,
     )
 
-    options = Hash[ %w[äöü cat delete dog ß].map { |x| [x, "#{x.capitalize} Display"] } ]
+    options = %w[äöü cat delete dog ß].map { |x| [x, "#{x.capitalize} Display"] }.to_h
     options_no_dog = options.except('dog')
     options_no_dog_no_delete = options_no_dog.except('delete')