Skip to content

Commit

Permalink
rubocop cleanup ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
onyxraven committed Oct 14, 2024
1 parent 6cd37a1 commit 3feb932
Show file tree
Hide file tree
Showing 47 changed files with 58 additions and 158 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ on:
pull_request:
branches: [master]

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
rubocop:
name: Rubocop
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
ruby: [
2.7
]
ruby:
- "3.0"
- "3.1"
- "3.2"
- "3.3"

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 7 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.7
NewCops: enable
Include:
- Gemfile
- '**/Rakefile'
- resque-scheduler.gemspec
- bin/resque-scheduler

Documentation:
Enabled: false

Style/DoubleNegation:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Metrics/ClassLength:
Max: 110
Bundler/DuplicatedGem:
Exclude:
- 'Gemfile'
Style/FrozenStringLiteralComment:
Enabled: false
71 changes: 0 additions & 71 deletions .rubocop_todo.yml

This file was deleted.

1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
source 'https://rubygems.org'

case resque_version = ENV.fetch('RESQUE', 'latest')
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'yard'
Expand Down
2 changes: 0 additions & 2 deletions bin/migrate_to_timestamps_set.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require 'redis'
require 'resque'

Expand Down
1 change: 0 additions & 1 deletion examples/Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# vim:fileencoding=utf-8
require 'resque/scheduler/tasks'
2 changes: 0 additions & 2 deletions examples/config/initializers/resque-web.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require 'json'
require 'yaml'
require 'resque'
Expand Down
1 change: 0 additions & 1 deletion examples/dynamic-scheduling/app/jobs/fix_schedules_job.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
#
# Background job to fix the schedule for email sending. Any missing
# schedule will be added to resque-schedule.
Expand Down
2 changes: 0 additions & 2 deletions examples/dynamic-scheduling/app/jobs/send_email_job.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

class SendEmailJob
@queue = :send_emails

Expand Down
2 changes: 0 additions & 2 deletions examples/dynamic-scheduling/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

class User < ActiveRecord::Base
after_create :schedule_send_email

Expand Down
2 changes: 0 additions & 2 deletions examples/dynamic-scheduling/lib/tasks/resque.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require 'resque/tasks'
require 'resque/scheduler/tasks'
require 'yaml'
Expand Down
1 change: 0 additions & 1 deletion exe/resque-scheduler
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env ruby
# vim:fileencoding=utf-8

require 'resque-scheduler'
Resque::Scheduler::Cli.run!
1 change: 0 additions & 1 deletion lib/resque-scheduler.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
require_relative 'resque/scheduler'

Resque.extend Resque::Scheduler::Extension
2 changes: 0 additions & 2 deletions lib/resque/scheduler.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require 'redis/errors'
require 'rufus/scheduler'
require_relative 'scheduler/configuration'
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/cli.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require 'optparse'

module Resque
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

module Resque
module Scheduler
module Configuration
Expand Down
1 change: 0 additions & 1 deletion lib/resque/scheduler/delaying_extensions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
require 'resque'
require_relative 'plugin'
require_relative '../scheduler'
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/env.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require 'English' # $PROCESS_ID

module Resque
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/extension.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require_relative 'scheduling_extensions'
require_relative 'delaying_extensions'

Expand Down
1 change: 0 additions & 1 deletion lib/resque/scheduler/lock.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
%w(base basic resilient).each do |file|
require "resque/scheduler/lock/#{file}"
end
2 changes: 0 additions & 2 deletions lib/resque/scheduler/lock/base.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

module Resque
module Scheduler
module Lock
Expand Down
1 change: 0 additions & 1 deletion lib/resque/scheduler/lock/basic.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
require_relative 'base'

module Resque
Expand Down
1 change: 0 additions & 1 deletion lib/resque/scheduler/lock/resilient.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
require_relative 'base'

module Resque
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/locking.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

# ### Locking the scheduler process
#
# There are two places in resque-scheduler that need to be synchronized in order
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/logger_builder.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require 'mono_logger'

module Resque
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/plugin.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

module Resque
module Scheduler
module Plugin
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/scheduling_extensions.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

module Resque
module Scheduler
module SchedulingExtensions
Expand Down
1 change: 0 additions & 1 deletion lib/resque/scheduler/server.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
require 'resque-scheduler'
require 'resque/server'
require 'tilt/erb'
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/signal_handling.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

module Resque
module Scheduler
module SignalHandling
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/tasks.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

require 'resque/tasks'
require 'resque-scheduler'

Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/util.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

module Resque
module Scheduler
class Util
Expand Down
2 changes: 0 additions & 2 deletions lib/resque/scheduler/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# vim:fileencoding=utf-8

module Resque
module Scheduler
VERSION = '4.10.2'.freeze
Expand Down
21 changes: 11 additions & 10 deletions resque-scheduler.gemspec
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# vim:fileencoding=utf-8
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'resque/scheduler/version'

Gem::Specification.new do |spec|
spec.name = 'resque-scheduler'
spec.version = Resque::Scheduler::VERSION
spec.authors = <<-EOF.split(/\n/).map(&:strip)
spec.authors = <<-AUTHORS.split(/\n/).map(&:strip)
Ben VandenBos
Simon Eskildsen
Ryan Biesemeyer
Dan Buch
Michael Bianco
Patrick Tulskie
EOF
spec.email = %w(
AUTHORS
spec.email = %w[
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
)
]
spec.summary = 'Light weight job scheduling on top of Resque'
spec.description = <<-DESCRIPTION
Light weight job scheduling on top of Resque.
Expand All @@ -32,7 +31,7 @@ Gem::Specification.new do |spec|
spec.license = 'MIT'
spec.metadata['rubygems_mfa_required'] = 'true'

spec.required_ruby_version = '>= 2.3.0'
spec.required_ruby_version = '>= 2.7.0'

spec.files = `git ls-files -z`.split("\0").reject do |f|
f.match(%r{^(test|spec|features|examples|bin|tasks)/}) ||
Expand All @@ -41,7 +40,7 @@ Gem::Specification.new do |spec|
end
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = %w(lib)
spec.require_paths = %w[lib]

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'json'
Expand All @@ -52,12 +51,14 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rake'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'test-unit'
spec.add_development_dependency 'yard'
spec.add_development_dependency 'timecop'
spec.add_development_dependency 'yard'

# We pin rubocop because new cops have a tendency to result in false-y
# positives for new contributors, which is not a nice experience.
spec.add_development_dependency 'rubocop', '~> 0.40.0'
spec.add_development_dependency 'ostruct'
spec.add_development_dependency 'racc'
spec.add_development_dependency 'rubocop', '~> 0.92.0'

spec.add_runtime_dependency 'mono_logger', '~> 1.0'
spec.add_runtime_dependency 'redis', '>= 3.3'
Expand Down
1 change: 0 additions & 1 deletion test/cli_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
require_relative 'test_helper'

context 'Cli' do
Expand Down
1 change: 0 additions & 1 deletion test/configuration_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim:fileencoding=utf-8
require_relative 'test_helper'

context 'Configuration' do
Expand Down
Loading

0 comments on commit 3feb932

Please sign in to comment.