resque-disable-job 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cf5675cd4709d19ab8540335abdf81e3245f658e3ae434a559b82fe097740e7
4
- data.tar.gz: d7129819867dc331bda8eec1b61b6409bf2d9c4dac5b85cf6e1eec47dd7c437b
3
+ metadata.gz: 5ad9eb3568ffd8e37431d07c9739007505884939a7a3617dce0aa98e23c31cfc
4
+ data.tar.gz: 4f7f3de0b00ded9ed8f1b71637a40d97219ae81cceee410f92876808beb3fb1b
5
5
  SHA512:
6
- metadata.gz: fc235c8350945eed9336d2e42c9b58f036259060d3d77782d55838f0386b4c38394c91219fd03e4bc493ba365c75b31c3c04b6c492fb789d0b5368179693c7fb
7
- data.tar.gz: 77bbab0994a0c14993fd058c5b32e29cde05c19fea7f83274f13e1278963ede43a58754c0350b84c3d5881a5e11767fde87789f44a98c0c6b7315c23b44e5998
6
+ metadata.gz: 67c69c4dc87e4f225d6d2d4e9654dfd52cd4b58fa4e1332ac5ceeb1966bc20785f44a5da09df7d8ded1237092d1c9e262677b0c95a224ab9deb2416937a6333f
7
+ data.tar.gz: 5e33b40387d0a6e2189326dd27fdc81fc110cf7fefaa9ad681f2fe3264e7f7565d38305ff197522addcd1697409904d563056890846cf4f74d475890b629c13a
@@ -0,0 +1,60 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ jobs:
7
+ specs:
8
+ runs-on: ubuntu-latest
9
+ services:
10
+ redis:
11
+ image: redis:7
12
+ ports:
13
+ - 6379:6379
14
+ env:
15
+ RAILS_ENV: test
16
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ ruby-version:
21
+ - '2.7'
22
+ - '3.0'
23
+ - '3.1'
24
+ - '3.2'
25
+ gemfile:
26
+ - 'resque_1'
27
+ - 'resque_2'
28
+ steps:
29
+ - uses: actions/checkout@v3
30
+ - uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: true
34
+ - name: test ${{ matrix.ruby-version }} with ${{ matrix.gemfile }}
35
+ run: bundle exec rake spec
36
+
37
+ linter:
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v3
41
+ - uses: ruby/setup-ruby@v1
42
+ with:
43
+ bundler-cache: true
44
+ - name: linter
45
+ run: bundle exec rake rubocop
46
+
47
+ specs_successful:
48
+ name: Specs passing?
49
+ needs: specs
50
+ if: always()
51
+ runs-on: ubuntu-latest
52
+ steps:
53
+ - run: |
54
+ if ${{ needs.specs.result == 'success' }}
55
+ then
56
+ echo "All specs pass"
57
+ else
58
+ echo "Some specs failed"
59
+ false
60
+ fi
@@ -0,0 +1,12 @@
1
+ name: Publish public gem
2
+
3
+ on:
4
+ push:
5
+ tags: v*
6
+
7
+ jobs:
8
+ call-workflow:
9
+ uses: zendesk/gw/.github/workflows/ruby-gem-publication.yml@main
10
+ secrets:
11
+ RUBY_GEMS_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
12
+ RUBY_GEMS_TOTP_DEVICE: ${{ secrets.RUBY_GEMS_TOTP_DEVICE }}
data/.gitignore CHANGED
@@ -3,16 +3,5 @@
3
3
  /coverage/
4
4
  /tmp/
5
5
 
6
- # Used by dotenv library to load environment variables.
7
- # .env
8
-
9
- ## Documentation cache and generated files:
10
- ## Environment normalization:
11
- # for a library or gem, you might want to ignore these files since the code is
12
- # intended to run in multiple environments; otherwise, check them in:
13
- Gemfile.lock
14
- .ruby-version
15
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
16
-
17
6
  # Exclude the built gems
18
7
  *.gem
data/.rubocop.yml CHANGED
@@ -1,27 +1,35 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
1
  AllCops:
4
2
  DisplayCopNames: true
5
3
  CacheRootDirectory: tmp
6
4
 
7
5
  # Configured cops
8
- Layout/AlignParameters:
6
+ Layout/ParameterAlignment:
9
7
  EnforcedStyle: with_fixed_indentation
10
8
  Layout/CaseIndentation:
11
9
  EnforcedStyle: end
12
10
  Layout/FirstParameterIndentation:
13
11
  EnforcedStyle: consistent
14
- Layout/IndentArray:
12
+ Layout/FirstArrayElementIndentation:
15
13
  EnforcedStyle: consistent
16
- Layout/IndentHash:
14
+ Layout/FirstHashElementIndentation:
17
15
  EnforcedStyle: consistent
18
16
  Layout/MultilineMethodCallIndentation:
19
17
  EnforcedStyle: indented
20
18
  Layout/MultilineOperationIndentation:
21
19
  EnforcedStyle: indented
20
+ Layout/LineLength:
21
+ Exclude:
22
+ - 'resque-disable-job.gemspec'
22
23
 
23
24
  Lint/EndAlignment:
24
25
  EnforcedStyleAlignWith: variable
26
+ Lint/ConstantDefinitionInBlock:
27
+ Exclude:
28
+ - 'spec/**/*'
29
+
30
+ Naming/FileName:
31
+ Exclude:
32
+ - 'lib/resque-disable-job.rb'
25
33
 
26
34
  Style/EmptyMethod:
27
35
  EnforcedStyle: expanded
@@ -41,8 +49,6 @@ Metrics:
41
49
 
42
50
  Style/BlockDelimiters:
43
51
  Enabled: false
44
- Style/BracesAroundHashParameters:
45
- Enabled: false
46
52
  Style/ClassVars:
47
53
  Enabled: false
48
54
  Style/EmptyElse:
@@ -65,3 +71,5 @@ Style/WordArray:
65
71
  Enabled: false
66
72
  Style/MutableConstant:
67
73
  Enabled: false
74
+ Style/NumericPredicate:
75
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.8
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.3.0] - 2023-07-18
11
+ - Adds support for Resque 2.x.
12
+ - Ruby versions from 2.7 to 3.2 are now tested against and supported.
data/Gemfile CHANGED
@@ -1,8 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
4
-
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
- # Specify your gem's dependencies in resque-disable-job.gemspec
8
- gemspec
3
+ eval_gemfile 'gemfiles/resque_1.gemfile'
data/Gemfile.lock ADDED
@@ -0,0 +1,100 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ resque-disable-job (0.3.0)
5
+ resque
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ codecov (0.2.12)
12
+ json
13
+ simplecov
14
+ coderay (1.1.3)
15
+ docile (1.4.0)
16
+ json (2.6.3)
17
+ language_server-protocol (3.17.0.3)
18
+ method_source (1.0.0)
19
+ minitest (5.18.1)
20
+ minitest-rg (5.2.0)
21
+ minitest (~> 5.0)
22
+ mocha (2.0.4)
23
+ ruby2_keywords (>= 0.0.5)
24
+ mono_logger (1.1.2)
25
+ multi_json (1.15.0)
26
+ mustermann (3.0.0)
27
+ ruby2_keywords (~> 0.0.1)
28
+ parallel (1.23.0)
29
+ parser (3.2.2.3)
30
+ ast (~> 2.4.1)
31
+ racc
32
+ pry (0.14.2)
33
+ coderay (~> 1.1)
34
+ method_source (~> 1.0)
35
+ racc (1.7.1)
36
+ rack (2.2.7)
37
+ rack-protection (3.0.6)
38
+ rack
39
+ rainbow (3.1.1)
40
+ rake (13.0.6)
41
+ redis (4.8.1)
42
+ redis-namespace (1.11.0)
43
+ redis (>= 4)
44
+ regexp_parser (2.8.1)
45
+ resque (1.27.4)
46
+ mono_logger (~> 1.0)
47
+ multi_json (~> 1.0)
48
+ redis-namespace (~> 1.3)
49
+ sinatra (>= 0.9.2)
50
+ vegas (~> 0.1.2)
51
+ rexml (3.2.5)
52
+ rubocop (1.54.2)
53
+ json (~> 2.3)
54
+ language_server-protocol (>= 3.17.0)
55
+ parallel (~> 1.10)
56
+ parser (>= 3.2.2.3)
57
+ rainbow (>= 2.2.2, < 4.0)
58
+ regexp_parser (>= 1.8, < 3.0)
59
+ rexml (>= 3.2.5, < 4.0)
60
+ rubocop-ast (>= 1.28.0, < 2.0)
61
+ ruby-progressbar (~> 1.7)
62
+ unicode-display_width (>= 2.4.0, < 3.0)
63
+ rubocop-ast (1.29.0)
64
+ parser (>= 3.2.1.0)
65
+ ruby-progressbar (1.13.0)
66
+ ruby2_keywords (0.0.5)
67
+ simplecov (0.22.0)
68
+ docile (~> 1.1)
69
+ simplecov-html (~> 0.11)
70
+ simplecov_json_formatter (~> 0.1)
71
+ simplecov-html (0.12.3)
72
+ simplecov_json_formatter (0.1.4)
73
+ sinatra (3.0.6)
74
+ mustermann (~> 3.0)
75
+ rack (~> 2.2, >= 2.2.4)
76
+ rack-protection (= 3.0.6)
77
+ tilt (~> 2.0)
78
+ tilt (2.2.0)
79
+ unicode-display_width (2.4.2)
80
+ vegas (0.1.11)
81
+ rack (>= 1.0.0)
82
+
83
+ PLATFORMS
84
+ ruby
85
+
86
+ DEPENDENCIES
87
+ codecov
88
+ minitest
89
+ minitest-rg
90
+ mocha
91
+ pry
92
+ rake
93
+ redis (< 5)
94
+ resque (~> 1.27)
95
+ resque-disable-job!
96
+ rubocop
97
+ simplecov
98
+
99
+ BUNDLED WITH
100
+ 2.4.12
data/Rakefile CHANGED
@@ -4,6 +4,9 @@ require 'bundler/gem_tasks'
4
4
  require 'rake/testtask'
5
5
  require 'rubocop/rake_task'
6
6
 
7
+ # Pushing to rubygems is handled by a github workflow
8
+ ENV['gem_push'] = 'false'
9
+
7
10
  RuboCop::RakeTask.new
8
11
 
9
12
  Rake::TestTask.new(:spec) do |test|
@@ -12,4 +15,4 @@ Rake::TestTask.new(:spec) do |test|
12
15
  test.warning = false
13
16
  end
14
17
 
15
- task default: :spec
18
+ task default: %i[spec rubocop]
data/bin/bundle_all ADDED
@@ -0,0 +1,11 @@
1
+ #! /bin/bash
2
+ # Usage: ./bundle_all <args>
3
+ # This will update the lock files
4
+ # in the gemfiles/ folder as well
5
+ echo "bundle_all"
6
+ for i in gemfiles/*.gemfile Gemfile
7
+ do
8
+ echo "Bundling for $i"
9
+ echo "BUNDLE_GEMFILE=$i bundle $@"
10
+ BUNDLE_GEMFILE=$i bundle $@
11
+ done
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec path: '../'
6
+
7
+ gem 'codecov'
8
+ gem 'minitest'
9
+ gem 'minitest-rg'
10
+ gem 'mocha'
11
+ gem 'pry'
12
+ gem 'rake'
13
+ gem 'rubocop'
14
+ gem 'simplecov'
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ eval_gemfile 'common.rb'
4
+ gem 'redis', '< 5'
5
+ gem 'resque', '~> 1.27'
@@ -0,0 +1,100 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ resque-disable-job (0.3.0)
5
+ resque
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ codecov (0.2.12)
12
+ json
13
+ simplecov
14
+ coderay (1.1.3)
15
+ docile (1.4.0)
16
+ json (2.6.3)
17
+ language_server-protocol (3.17.0.3)
18
+ method_source (1.0.0)
19
+ minitest (5.18.1)
20
+ minitest-rg (5.2.0)
21
+ minitest (~> 5.0)
22
+ mocha (2.0.4)
23
+ ruby2_keywords (>= 0.0.5)
24
+ mono_logger (1.1.2)
25
+ multi_json (1.15.0)
26
+ mustermann (3.0.0)
27
+ ruby2_keywords (~> 0.0.1)
28
+ parallel (1.23.0)
29
+ parser (3.2.2.3)
30
+ ast (~> 2.4.1)
31
+ racc
32
+ pry (0.14.2)
33
+ coderay (~> 1.1)
34
+ method_source (~> 1.0)
35
+ racc (1.7.1)
36
+ rack (2.2.7)
37
+ rack-protection (3.0.6)
38
+ rack
39
+ rainbow (3.1.1)
40
+ rake (13.0.6)
41
+ redis (4.8.1)
42
+ redis-namespace (1.11.0)
43
+ redis (>= 4)
44
+ regexp_parser (2.8.1)
45
+ resque (1.27.4)
46
+ mono_logger (~> 1.0)
47
+ multi_json (~> 1.0)
48
+ redis-namespace (~> 1.3)
49
+ sinatra (>= 0.9.2)
50
+ vegas (~> 0.1.2)
51
+ rexml (3.2.5)
52
+ rubocop (1.54.2)
53
+ json (~> 2.3)
54
+ language_server-protocol (>= 3.17.0)
55
+ parallel (~> 1.10)
56
+ parser (>= 3.2.2.3)
57
+ rainbow (>= 2.2.2, < 4.0)
58
+ regexp_parser (>= 1.8, < 3.0)
59
+ rexml (>= 3.2.5, < 4.0)
60
+ rubocop-ast (>= 1.28.0, < 2.0)
61
+ ruby-progressbar (~> 1.7)
62
+ unicode-display_width (>= 2.4.0, < 3.0)
63
+ rubocop-ast (1.29.0)
64
+ parser (>= 3.2.1.0)
65
+ ruby-progressbar (1.13.0)
66
+ ruby2_keywords (0.0.5)
67
+ simplecov (0.22.0)
68
+ docile (~> 1.1)
69
+ simplecov-html (~> 0.11)
70
+ simplecov_json_formatter (~> 0.1)
71
+ simplecov-html (0.12.3)
72
+ simplecov_json_formatter (0.1.4)
73
+ sinatra (3.0.6)
74
+ mustermann (~> 3.0)
75
+ rack (~> 2.2, >= 2.2.4)
76
+ rack-protection (= 3.0.6)
77
+ tilt (~> 2.0)
78
+ tilt (2.2.0)
79
+ unicode-display_width (2.4.2)
80
+ vegas (0.1.11)
81
+ rack (>= 1.0.0)
82
+
83
+ PLATFORMS
84
+ ruby
85
+
86
+ DEPENDENCIES
87
+ codecov
88
+ minitest
89
+ minitest-rg
90
+ mocha
91
+ pry
92
+ rake
93
+ redis (< 5)
94
+ resque (~> 1.27)
95
+ resque-disable-job!
96
+ rubocop
97
+ simplecov
98
+
99
+ BUNDLED WITH
100
+ 2.4.12
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ eval_gemfile 'common.rb'
4
+ gem 'resque', '< 3'
@@ -0,0 +1,100 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ resque-disable-job (0.3.0)
5
+ resque
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ codecov (0.2.12)
12
+ json
13
+ simplecov
14
+ coderay (1.1.3)
15
+ connection_pool (2.4.1)
16
+ docile (1.4.0)
17
+ json (2.6.3)
18
+ language_server-protocol (3.17.0.3)
19
+ method_source (1.0.0)
20
+ minitest (5.18.1)
21
+ minitest-rg (5.2.0)
22
+ minitest (~> 5.0)
23
+ mocha (2.0.4)
24
+ ruby2_keywords (>= 0.0.5)
25
+ mono_logger (1.1.2)
26
+ multi_json (1.15.0)
27
+ mustermann (3.0.0)
28
+ ruby2_keywords (~> 0.0.1)
29
+ parallel (1.23.0)
30
+ parser (3.2.2.3)
31
+ ast (~> 2.4.1)
32
+ racc
33
+ pry (0.14.2)
34
+ coderay (~> 1.1)
35
+ method_source (~> 1.0)
36
+ racc (1.7.1)
37
+ rack (2.2.7)
38
+ rack-protection (3.0.6)
39
+ rack
40
+ rainbow (3.1.1)
41
+ rake (13.0.6)
42
+ redis (5.0.6)
43
+ redis-client (>= 0.9.0)
44
+ redis-client (0.14.1)
45
+ connection_pool
46
+ redis-namespace (1.11.0)
47
+ redis (>= 4)
48
+ regexp_parser (2.8.1)
49
+ resque (2.5.0)
50
+ mono_logger (~> 1.0)
51
+ multi_json (~> 1.0)
52
+ redis-namespace (~> 1.6)
53
+ sinatra (>= 0.9.2)
54
+ rexml (3.2.5)
55
+ rubocop (1.54.2)
56
+ json (~> 2.3)
57
+ language_server-protocol (>= 3.17.0)
58
+ parallel (~> 1.10)
59
+ parser (>= 3.2.2.3)
60
+ rainbow (>= 2.2.2, < 4.0)
61
+ regexp_parser (>= 1.8, < 3.0)
62
+ rexml (>= 3.2.5, < 4.0)
63
+ rubocop-ast (>= 1.28.0, < 2.0)
64
+ ruby-progressbar (~> 1.7)
65
+ unicode-display_width (>= 2.4.0, < 3.0)
66
+ rubocop-ast (1.29.0)
67
+ parser (>= 3.2.1.0)
68
+ ruby-progressbar (1.13.0)
69
+ ruby2_keywords (0.0.5)
70
+ simplecov (0.22.0)
71
+ docile (~> 1.1)
72
+ simplecov-html (~> 0.11)
73
+ simplecov_json_formatter (~> 0.1)
74
+ simplecov-html (0.12.3)
75
+ simplecov_json_formatter (0.1.4)
76
+ sinatra (3.0.6)
77
+ mustermann (~> 3.0)
78
+ rack (~> 2.2, >= 2.2.4)
79
+ rack-protection (= 3.0.6)
80
+ tilt (~> 2.0)
81
+ tilt (2.2.0)
82
+ unicode-display_width (2.4.2)
83
+
84
+ PLATFORMS
85
+ ruby
86
+
87
+ DEPENDENCIES
88
+ codecov
89
+ minitest
90
+ minitest-rg
91
+ mocha
92
+ pry
93
+ rake
94
+ resque (< 3)
95
+ resque-disable-job!
96
+ rubocop
97
+ simplecov
98
+
99
+ BUNDLED WITH
100
+ 2.4.12
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Resque
4
4
  module DisableJob
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -26,26 +26,25 @@ module Resque
26
26
 
27
27
  def self.match_rules(job_name, job_args, rules)
28
28
  rules.take(MAX_JOB_RULES).detect do |specific_rule|
29
- begin
30
- # if the rule is not expired
31
- if !expired?(specific_rule)
32
- # if the arguments received and the ones from the rule match, that means that we need to disable the current job
33
- specific_rule.match?(job_args)
34
- else
35
- # we remove the rule if it's expired
36
- remove_specific_rule(specific_rule)
37
- false
38
- end
39
- rescue StandardError => e
40
- Resque.logger.error "Failed to parse AllowDisableJob rules for #{job_name}: #{specific_rule.serialized_arguments}. Error: #{e.message}"
29
+ # if the rule is not expired
30
+ if !expired?(specific_rule)
31
+ # if the arguments received and the ones from the rule match,
32
+ # that means that we need to disable the current job
33
+ specific_rule.match?(job_args)
34
+ else
35
+ # we remove the rule if it's expired
36
+ remove_specific_rule(specific_rule)
41
37
  false
42
38
  end
39
+ rescue StandardError => e
40
+ Resque.logger.error "Failed to parse AllowDisableJob rules for #{job_name}: #{specific_rule.serialized_arguments}. Error: #{e.message}" # rubocop:disable Layout/LineLength
41
+ false
43
42
  end
44
43
  end
45
44
 
46
45
  # The rule is expired if the TTL of the rule key is -1.
47
46
  def self.expired?(rule)
48
- Resque.redis.ttl(rule.rule_key) < 0 # .negative? only works in Ruby 2.3 and above
47
+ Resque.redis.ttl(rule.rule_key) < 0
49
48
  end
50
49
 
51
50
  # To disable a job we need to add it in 3 data structures:
@@ -39,15 +39,15 @@ module Resque
39
39
  end
40
40
 
41
41
  def all_rules_key
42
- @all_rules_key ||= main_set + ':' + @job_name
42
+ @all_rules_key ||= "#{main_set}:#{@job_name}"
43
43
  end
44
44
 
45
45
  def rule_key
46
- @rule_key ||= all_rules_key + ':' + digest
46
+ @rule_key ||= "#{all_rules_key}:#{digest}"
47
47
  end
48
48
 
49
49
  def serialized_arguments
50
- @serialized_args ||= @arguments.to_json
50
+ @serialized_args ||= @arguments.to_json # rubocop:disable Naming/MemoizedInstanceVariableName
51
51
  end
52
52
 
53
53
  def arguments
@@ -55,12 +55,13 @@ module Resque
55
55
  end
56
56
 
57
57
  def digest
58
- @rule_digest ||= Digest::SHA1.hexdigest(serialized_arguments)
58
+ @rule_digest ||= Digest::SHA1.hexdigest(serialized_arguments) # rubocop:disable Naming/MemoizedInstanceVariableName
59
59
  end
60
60
 
61
61
  def match?(args)
62
62
  job_args = normalize_job_args(args)
63
63
  return true if job_args == arguments
64
+
64
65
  # We check each parameter in the job_args with the rule arguments to be blocked
65
66
  # if it's nil, then we match as we handle the 'any' case,
66
67
  # if it's specified, we check for equality (65 == 65)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'resque/disable_job/version'
6
6
 
@@ -22,16 +22,7 @@ It uses some Redis data structures to keep a record of what jobs need to be disa
22
22
  spec.bindir = 'exe'
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
+ spec.required_ruby_version = '>= 2.7'
25
26
 
26
- spec.add_runtime_dependency 'resque', '~> 1.25'
27
-
28
- spec.add_development_dependency 'bundler', '~> 1.16'
29
- spec.add_development_dependency 'codecov', '~> 0'
30
- spec.add_development_dependency 'minitest'
31
- spec.add_development_dependency 'minitest-rg', '~> 0'
32
- spec.add_development_dependency 'mocha', '~> 0'
33
- spec.add_development_dependency 'pry', '~> 0'
34
- spec.add_development_dependency 'rake', '~> 10.0'
35
- spec.add_development_dependency 'rubocop', '0.51.0'
36
- spec.add_development_dependency 'simplecov', '~> 0'
27
+ spec.add_dependency 'resque'
37
28
  end
metadata CHANGED
@@ -1,155 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-disable-job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Balcanasu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-05 00:00:00.000000000 Z
11
+ date: 2023-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: resque
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.25'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.25'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.16'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.16'
41
- - !ruby/object:Gem::Dependency
42
- name: codecov
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: minitest
57
15
  requirement: !ruby/object:Gem::Requirement
58
16
  requirements:
59
17
  - - ">="
60
18
  - !ruby/object:Gem::Version
61
19
  version: '0'
62
- type: :development
20
+ type: :runtime
63
21
  prerelease: false
64
22
  version_requirements: !ruby/object:Gem::Requirement
65
23
  requirements:
66
24
  - - ">="
67
25
  - !ruby/object:Gem::Version
68
26
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: minitest-rg
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: mocha
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: pry
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rake
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '10.0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '10.0'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - '='
130
- - !ruby/object:Gem::Version
131
- version: 0.51.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - '='
137
- - !ruby/object:Gem::Version
138
- version: 0.51.0
139
- - !ruby/object:Gem::Dependency
140
- name: simplecov
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
27
  description: |-
154
28
  This is a Resque plugin that allows us to disable jobs from being processed, by using the job class name and arguments.
155
29
  It uses some Redis data structures to keep a record of what jobs need to be disabled and how many jobs were disabled for that rule.
@@ -159,15 +33,24 @@ executables: []
159
33
  extensions: []
160
34
  extra_rdoc_files: []
161
35
  files:
36
+ - ".github/workflows/ci.yml"
37
+ - ".github/workflows/publish.yml"
162
38
  - ".gitignore"
163
39
  - ".rubocop.yml"
164
- - ".rubocop_todo.yml"
165
- - ".travis.yml"
40
+ - ".ruby-version"
41
+ - CHANGELOG.md
166
42
  - CODE_OF_CONDUCT.md
167
43
  - Gemfile
44
+ - Gemfile.lock
168
45
  - LICENSE
169
46
  - README.md
170
47
  - Rakefile
48
+ - bin/bundle_all
49
+ - gemfiles/common.rb
50
+ - gemfiles/resque_1.gemfile
51
+ - gemfiles/resque_1.gemfile.lock
52
+ - gemfiles/resque_2.gemfile
53
+ - gemfiles/resque_2.gemfile.lock
171
54
  - lib/resque-disable-job.rb
172
55
  - lib/resque/disable_job/version.rb
173
56
  - lib/resque/plugins/disable_job.rb
@@ -187,15 +70,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
70
  requirements:
188
71
  - - ">="
189
72
  - !ruby/object:Gem::Version
190
- version: '0'
73
+ version: '2.7'
191
74
  required_rubygems_version: !ruby/object:Gem::Requirement
192
75
  requirements:
193
76
  - - ">="
194
77
  - !ruby/object:Gem::Version
195
78
  version: '0'
196
79
  requirements: []
197
- rubyforge_project:
198
- rubygems_version: 2.7.6
80
+ rubygems_version: 3.0.3.1
199
81
  signing_key:
200
82
  specification_version: 4
201
83
  summary: Resque plugin that can disable jobs from being processed.
data/.rubocop_todo.yml DELETED
@@ -1,14 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2017-11-09 09:31:15 +0100 using RuboCop version 0.51.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
11
- # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
12
- Naming/FileName:
13
- Exclude:
14
- - 'lib/resque-disable-job.rb'
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- language: ruby
2
-
3
- cache: bundler
4
-
5
- branches:
6
- only: master
7
-
8
- rvm:
9
- - 2.2.4
10
- - 2.2.7
11
- - 2.3.4
12
- - 2.4.2
13
- env:
14
- - COMMAND=rake
15
- matrix:
16
- include:
17
- - rvm: 2.4.2
18
- env: COMMAND="rubocop -d"
19
-
20
- services:
21
- - redis-server
22
-
23
- script:
24
- - bundle exec rubocop -V
25
- - bundle exec $COMMAND