resque-unique_by_arity 1.0.10 → 1.0.11
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 41b95f0fb6ea9a5bb7f107893efb476b5bc533c1a76ec9d96a523589dbcdb89e
|
4
|
+
data.tar.gz: d68bff5ca6ba72c92a009a53334be806edf0fad08fab8d095a01f26a0eda8a6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3f01c31058533db7534f51cc8b0c55f892b9c9ab3e45ce777eb3e327ff2ca6714b0237eab0bc1ff0d106524ea5e453ee323a5ccc607d11c148531ff9db79efa
|
7
|
+
data.tar.gz: ad96c870c8d3c363553d402cd76c6791182b33623bd82724d86cb498724fe76e689704eeec38685bcdbf2cd5b1b84f4d4335331c91eab6f2459d0f4b16b3b823
|
data/.travis.yml
CHANGED
@@ -13,6 +13,7 @@ module Resque
|
|
13
13
|
attr_accessor :unique_at_runtime
|
14
14
|
attr_accessor :unique_in_queue
|
15
15
|
attr_accessor :unique_across_queues
|
16
|
+
attr_accessor :base_klass_name
|
16
17
|
def initialize(**options)
|
17
18
|
@logger = options.key?(:logger) ? options[:logger] : Logger.new(STDOUT)
|
18
19
|
@log_level = options.key?(:log_level) ? options[:log_level] : :debug
|
@@ -24,11 +25,14 @@ module Resque
|
|
24
25
|
@unique_at_runtime = options.key?(:unique_at_runtime) ? options[:unique_at_runtime] : false
|
25
26
|
@unique_in_queue = options.key?(:unique_in_queue) ? options[:unique_in_queue] : false
|
26
27
|
@unique_across_queues = options.key?(:unique_across_queues) ? options[:unique_across_queues] : false
|
28
|
+
end
|
29
|
+
|
30
|
+
def validate
|
27
31
|
# The default config initialization shouldn't trigger any warnings.
|
28
|
-
if
|
29
|
-
log ":arity_for_uniqueness is set to #{
|
30
|
-
log ":lock_after_execution_period is set to #{
|
31
|
-
log ":unique_in_queue and :unique_across_queues should not be set at the same time, as :unique_across_queues will always supercede :unique_in_queue" if
|
32
|
+
if base_klass_name && logger
|
33
|
+
log "[#{base_klass_name}] :arity_for_uniqueness is set to #{arity_for_uniqueness}, but no uniqueness enforcement was turned on [:unique_at_runtime, :unique_in_queue, :unique_across_queues]" unless unique_at_runtime || unique_in_queue || unique_across_queues
|
34
|
+
log "[#{base_klass_name}] :lock_after_execution_period is set to #{lock_after_execution_period}, but :unique_at_runtime is not set" if lock_after_execution_period && !unique_at_runtime
|
35
|
+
log "[#{base_klass_name}] :unique_in_queue and :unique_across_queues should not be set at the same time, as :unique_across_queues will always supercede :unique_in_queue" if unique_in_queue && unique_across_queues
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|
@@ -43,7 +47,7 @@ module Resque
|
|
43
47
|
def log(msg)
|
44
48
|
Resque::UniqueByArity.unique_log(msg, self)
|
45
49
|
end
|
46
|
-
|
50
|
+
|
47
51
|
def to_hash
|
48
52
|
{
|
49
53
|
logger: logger,
|
@@ -6,6 +6,8 @@ module Resque
|
|
6
6
|
end
|
7
7
|
def included(base)
|
8
8
|
return unless @configuration
|
9
|
+
@configuration.base_klass_name = base.to_s
|
10
|
+
@configuration.validate
|
9
11
|
base.send(:extend, Resque::UniqueByArity)
|
10
12
|
base.uniqueness_config_reset(@configuration.dup)
|
11
13
|
|
@@ -21,7 +23,7 @@ module Resque
|
|
21
23
|
uniqueness_cop_module = Resque::UniqueByArity::CopModulizer.to_mod(@configuration)
|
22
24
|
# This will override methods from both plugins above, if configured for both
|
23
25
|
base.send(:extend, uniqueness_cop_module)
|
24
|
-
|
26
|
+
|
25
27
|
base.include Resque::UniqueByArity::Validation unless @configuration.skip_arity_validation?
|
26
28
|
end
|
27
29
|
end
|
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_runtime_dependency "resque_solo", "~> 0.3"
|
27
27
|
spec.add_runtime_dependency "colorize", "~> 0.8"
|
28
28
|
spec.add_development_dependency "bundler", "~> 1.14"
|
29
|
-
spec.add_development_dependency "rake", "~>
|
29
|
+
spec.add_development_dependency "rake", "~> 12.3"
|
30
30
|
spec.add_development_dependency "rspec", "~> 3.0"
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-unique_by_arity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque-unique_at_runtime
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '12.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '12.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.6
|
140
|
+
rubygems_version: 2.7.6
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Magic hacks which allow integration of resque_solo and resque-unique_at_runtime_simultaneously
|