Skip to content

Commit

Permalink
Remove Ruby 2.7 guards
Browse files Browse the repository at this point in the history
  • Loading branch information
Irving-Betterment committed Dec 28, 2023
1 parent 72d66dc commit ca827c1
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 18 deletions.
84 changes: 73 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -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:25:50 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
Expand Down Expand Up @@ -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'
Expand All @@ -50,25 +51,23 @@ 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'
- 'lib/delayed/psych_ext.rb'
- '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).
Expand Down Expand Up @@ -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'

Expand All @@ -180,6 +178,70 @@ Style/FetchEnvVar:
Exclude:
- 'spec/helper.rb'

# Offense count: 57
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'Appraisals'
- 'Rakefile'
- 'app/models/delayed/job.rb'
- 'delayed.gemspec'
- 'gemfiles/rails_5_2.gemfile'
- 'gemfiles/rails_6_0.gemfile'
- 'gemfiles/rails_6_1.gemfile'
- 'gemfiles/rails_7_0.gemfile'
- 'gemfiles/rails_7_1.gemfile'
- 'lib/delayed.rb'
- 'lib/delayed/active_job_adapter.rb'
- 'lib/delayed/backend/base.rb'
- 'lib/delayed/backend/job_preparer.rb'
- 'lib/delayed/engine.rb'
- 'lib/delayed/exceptions.rb'
- 'lib/delayed/job_wrapper.rb'
- 'lib/delayed/lifecycle.rb'
- 'lib/delayed/message_sending.rb'
- 'lib/delayed/monitor.rb'
- 'lib/delayed/performable_mailer.rb'
- 'lib/delayed/performable_method.rb'
- 'lib/delayed/plugin.rb'
- 'lib/delayed/plugins/connection.rb'
- 'lib/delayed/plugins/instrumentation.rb'
- 'lib/delayed/priority.rb'
- 'lib/delayed/psych_ext.rb'
- 'lib/delayed/runnable.rb'
- 'lib/delayed/serialization/active_record.rb'
- 'lib/delayed/syck_ext.rb'
- 'lib/delayed/tasks.rb'
- 'lib/delayed/worker.rb'
- 'lib/delayed/yaml_ext.rb'
- 'lib/delayed_job.rb'
- 'lib/delayed_job_active_record.rb'
- 'lib/generators/delayed/generator.rb'
- 'lib/generators/delayed/migration_generator.rb'
- 'lib/generators/delayed/next_migration_version.rb'
- 'spec/autoloaded/clazz.rb'
- 'spec/autoloaded/instance_clazz.rb'
- 'spec/autoloaded/instance_struct.rb'
- 'spec/autoloaded/struct.rb'
- 'spec/delayed/active_job_adapter_spec.rb'
- 'spec/delayed/job_spec.rb'
- 'spec/delayed/monitor_spec.rb'
- 'spec/delayed/plugins/instrumentation_spec.rb'
- 'spec/delayed/priority_spec.rb'
- 'spec/delayed/serialization/active_record_spec.rb'
- 'spec/delayed/tasks_spec.rb'
- 'spec/helper.rb'
- 'spec/lifecycle_spec.rb'
- 'spec/message_sending_spec.rb'
- 'spec/performable_mailer_spec.rb'
- 'spec/performable_method_spec.rb'
- 'spec/psych_ext_spec.rb'
- 'spec/sample_jobs.rb'
- 'spec/worker_spec.rb'
- 'spec/yaml_ext_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MinMaxComparison:
Expand Down
8 changes: 1 addition & 7 deletions lib/delayed/performable_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,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)
Expand Down

0 comments on commit ca827c1

Please sign in to comment.