From 5e04c9c1d93b74e49d79ac24270b3703cc33b8f8 Mon Sep 17 00:00:00 2001 From: Irving Caro <112433591+betterment-coding-agent@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:22:23 -0600 Subject: [PATCH] Remove Ruby 2.7 guards --- .rubocop_todo.yml | 20 +++++++++----------- lib/delayed/performable_method.rb | 8 +------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7364103..f2f68dd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 99999` -# on 2023-01-20 19:16:15 UTC using RuboCop version 1.43.0. +# on 2023-12-28 21:21:19 UTC using RuboCop version 1.59.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -33,6 +33,7 @@ Lint/ConstantDefinitionInBlock: - 'spec/message_sending_spec.rb' # Offense count: 2 +# Configuration parameters: AllowedParentClasses. Lint/MissingSuper: Exclude: - 'lib/delayed/message_sending.rb' @@ -50,7 +51,7 @@ Lint/SuppressedException: - 'lib/delayed/backend/base.rb' # Offense count: 4 -# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes, Max. +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max. Metrics/AbcSize: Exclude: - 'lib/delayed/message_sending.rb' @@ -58,17 +59,15 @@ Metrics/AbcSize: - 'lib/delayed/worker.rb' # Offense count: 1 -RSpec/AnyInstance: +# This cop supports safe autocorrection (--autocorrect). +Performance/StringIdentifierArgument: Exclude: - - 'spec/delayed/job_spec.rb' + - 'lib/delayed/monitor.rb' -# Offense count: 18 -# This cop supports unsafe autocorrection (--autocorrect-all). -RSpec/BeEq: +# Offense count: 1 +RSpec/AnyInstance: Exclude: - 'spec/delayed/job_spec.rb' - - 'spec/delayed/priority_spec.rb' - - 'spec/message_sending_spec.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). @@ -165,11 +164,10 @@ Rake/DuplicateTask: Exclude: - 'Rakefile' -# Offense count: 4 +# Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). Security/YAMLLoad: Exclude: - - 'spec/delayed/serialization/active_record_spec.rb' - 'spec/helper.rb' - 'spec/yaml_ext_spec.rb' diff --git a/lib/delayed/performable_method.rb b/lib/delayed/performable_method.rb index 766e271..1df2e8a 100644 --- a/lib/delayed/performable_method.rb +++ b/lib/delayed/performable_method.rb @@ -26,13 +26,7 @@ def display_name end def perform - return unless object - - if kwargs.nil? || (RUBY_VERSION < '2.7' && kwargs.empty?) - object.send(method_name, *args) - else - object.send(method_name, *args, **kwargs) - end + object.send(method_name, *args, **kwargs) if object end def method(sym)