resque-unique_by_arity 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec_status +55 -35
- data/lib/resque/plugins/unique_by_arity.rb +3 -0
- data/lib/resque/unique_by_arity/configuration.rb +6 -2
- data/lib/resque/unique_by_arity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2832d3ab2ddbac6a32f3402a0a24dea7eb8ca6b253d0eff6ea6f8a924e343fb1
|
4
|
+
data.tar.gz: a03a10a39c8fe8b1bfbec33299b4de7a72f7d8da3e8d1131c693e97fb61cc580
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdd1c1ff4d5ba5aca5ba17f3e6ae290c349f7064084c0876054200a28951352b410163287db536d0930109d655c7a43c51b61271bdc972d4dc65436fc85bc772
|
7
|
+
data.tar.gz: dc859b3415561ec698bb82381c713cef59f298c8ae591ff281eef103b0b545b5dec7e30de45c58c41d5e9415b2e289b046312ec8335b887ff1fb7baae274c027
|
data/.rspec_status
CHANGED
@@ -1,35 +1,55 @@
|
|
1
|
-
example_id
|
2
|
-
|
3
|
-
./spec/resque/
|
4
|
-
./spec/resque/
|
5
|
-
./spec/resque/
|
6
|
-
./spec/resque/
|
7
|
-
./spec/resque/
|
8
|
-
./spec/resque/
|
9
|
-
./spec/resque/
|
10
|
-
./spec/resque/
|
11
|
-
./spec/resque/
|
12
|
-
./spec/resque/
|
13
|
-
./spec/resque/
|
14
|
-
./spec/resque/
|
15
|
-
./spec/resque/
|
16
|
-
./spec/resque/
|
17
|
-
./spec/resque/
|
18
|
-
./spec/resque/
|
19
|
-
./spec/resque/
|
20
|
-
./spec/resque/
|
21
|
-
./spec/resque/
|
22
|
-
./spec/resque/
|
23
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
24
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
25
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
26
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
27
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
28
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
29
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
30
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
31
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
32
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
33
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
34
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
35
|
-
./spec/resque/unique_by_arity_spec.rb[1:
|
1
|
+
example_id | status | run_time |
|
2
|
+
----------------------------------------------------------------- | ------ | --------------- |
|
3
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:1] | passed | 0.00313 seconds |
|
4
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:2:1] | passed | 0.00099 seconds |
|
5
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:3:1] | passed | 0.00038 seconds |
|
6
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:4:1] | passed | 0.00016 seconds |
|
7
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:5:1] | passed | 0.00017 seconds |
|
8
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:6:1] | passed | 0.00018 seconds |
|
9
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:7:1] | passed | 0.0002 seconds |
|
10
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:8:1] | passed | 0.00016 seconds |
|
11
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:9:1] | passed | 0.00014 seconds |
|
12
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:10:1] | passed | 0.00014 seconds |
|
13
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:11:1] | passed | 0.00017 seconds |
|
14
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:12:1] | passed | 0.00015 seconds |
|
15
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:13:1] | passed | 0.00017 seconds |
|
16
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:14:1] | passed | 0.00096 seconds |
|
17
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:14:2:1] | passed | 0.00014 seconds |
|
18
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:1:14:3:1] | passed | 0.00013 seconds |
|
19
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:2:1] | passed | 0.01014 seconds |
|
20
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:3:1] | passed | 0.00031 seconds |
|
21
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:3:2] | passed | 0.00024 seconds |
|
22
|
+
./spec/resque/unique_by_arity/configuration_spec.rb[1:1:4:1] | passed | 0.00017 seconds |
|
23
|
+
./spec/resque/unique_by_arity_spec.rb[1:1] | passed | 0.00006 seconds |
|
24
|
+
./spec/resque/unique_by_arity_spec.rb[1:2:1:1] | passed | 0.00094 seconds |
|
25
|
+
./spec/resque/unique_by_arity_spec.rb[1:3:1] | passed | 0.00062 seconds |
|
26
|
+
./spec/resque/unique_by_arity_spec.rb[1:4:1:1] | passed | 0.00022 seconds |
|
27
|
+
./spec/resque/unique_by_arity_spec.rb[1:5:1:1] | passed | 0.00086 seconds |
|
28
|
+
./spec/resque/unique_by_arity_spec.rb[1:5:2:1] | passed | 0.00026 seconds |
|
29
|
+
./spec/resque/unique_by_arity_spec.rb[1:5:3:1] | passed | 0.00027 seconds |
|
30
|
+
./spec/resque/unique_by_arity_spec.rb[1:6:1] | passed | 0.00047 seconds |
|
31
|
+
./spec/resque/unique_by_arity_spec.rb[1:7:1] | passed | 0.00021 seconds |
|
32
|
+
./spec/resque/unique_by_arity_spec.rb[1:7:2:1] | passed | 0.00057 seconds |
|
33
|
+
./spec/resque/unique_by_arity_spec.rb[1:7:3:1] | passed | 0.00062 seconds |
|
34
|
+
./spec/resque/unique_by_arity_spec.rb[1:7:4:1] | passed | 0.00021 seconds |
|
35
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:1:1:1:1] | passed | 0.00028 seconds |
|
36
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:1:2:1:1] | passed | 0.00025 seconds |
|
37
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:1:3:1:1] | passed | 0.00061 seconds |
|
38
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:2:1:1:1] | passed | 0.00022 seconds |
|
39
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:2:2:1:1] | passed | 0.00029 seconds |
|
40
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:2:3:1:1] | passed | 0.00057 seconds |
|
41
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:3:1:1:1] | passed | 0.00076 seconds |
|
42
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:3:2:1:1] | passed | 0.00075 seconds |
|
43
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:3:3:1:1] | passed | 0.00062 seconds |
|
44
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:4:1:1:1] | passed | 0.0004 seconds |
|
45
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:4:2:1:1] | passed | 0.00032 seconds |
|
46
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:4:3:1:1] | passed | 0.00042 seconds |
|
47
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:5:1:1:1] | passed | 0.00023 seconds |
|
48
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:5:2:1:1] | passed | 0.00029 seconds |
|
49
|
+
./spec/resque/unique_by_arity_spec.rb[1:8:5:3:1] | passed | 0.0002 seconds |
|
50
|
+
./spec/resque/unique_by_arity_spec.rb[1:9:1] | passed | 0.0025 seconds |
|
51
|
+
./spec/resque/unique_by_arity_spec.rb[1:10:1:1] | passed | 0.00012 seconds |
|
52
|
+
./spec/resque/unique_by_arity_spec.rb[1:11:1:1] | passed | 0.00029 seconds |
|
53
|
+
./spec/resque/unique_by_arity_spec.rb[1:11:2:1:1] | passed | 0.00025 seconds |
|
54
|
+
./spec/resque/unique_by_arity_spec.rb[1:11:2:2:1] | passed | 0.0006 seconds |
|
55
|
+
./spec/resque/unique_by_arity_spec.rb[1:11:2:3:1] | passed | 0.0005 seconds |
|
@@ -30,6 +30,9 @@ module Resque
|
|
30
30
|
def included(base)
|
31
31
|
return unless @configuration
|
32
32
|
|
33
|
+
# We don't have access to the base class when initializing, but...
|
34
|
+
# we do initialize unique instances of the module for each class.
|
35
|
+
# As a result we can configure per class.
|
33
36
|
@configuration.base_klass_name = base.to_s
|
34
37
|
@configuration.validate
|
35
38
|
base.send(:extend, Resque::UniqueByArity)
|
@@ -35,8 +35,10 @@ module Resque
|
|
35
35
|
@unique_in_queue_key_base = options.key?(:unique_in_queue_key_base) ? options[:unique_in_queue_key_base] : DEFAULT_IN_QUEUE_KEY_BASE
|
36
36
|
@unique_in_queue = options.key?(:unique_in_queue) ? options[:unique_in_queue] : false
|
37
37
|
@unique_across_queues = options.key?(:unique_across_queues) ? options[:unique_across_queues] : false
|
38
|
+
# Can't be both unique in queue and unique across queues.
|
39
|
+
raise ArgumentError, "Resque::Plugins::UniqueByArity.new requires either one or none of @unique_across_queues and @unique_in_queue to be true. Having both set to true is non-sensical." if @unique_in_queue && @unique_across_queues
|
38
40
|
env_debug = ENV['RESQUE_DEBUG']
|
39
|
-
@debug_mode = options.key?(:debug_mode) ? options[:debug_mode] : env_debug == 'true' || (env_debug.is_a?(String) && env_debug.match?(/arity/))
|
41
|
+
@debug_mode = !!(options.key?(:debug_mode) ? options[:debug_mode] : env_debug == 'true' || (env_debug.is_a?(String) && env_debug.match?(/arity/)))
|
40
42
|
end
|
41
43
|
|
42
44
|
def validate
|
@@ -64,10 +66,12 @@ module Resque
|
|
64
66
|
|
65
67
|
def to_hash
|
66
68
|
{
|
67
|
-
logger: logger,
|
68
69
|
log_level: log_level,
|
70
|
+
logger: logger,
|
69
71
|
arity_for_uniqueness: arity_for_uniqueness,
|
70
72
|
arity_validation: arity_validation,
|
73
|
+
base_klass_name: base_klass_name,
|
74
|
+
debug_mode: debug_mode,
|
71
75
|
lock_after_execution_period: lock_after_execution_period,
|
72
76
|
runtime_lock_timeout: runtime_lock_timeout,
|
73
77
|
unique_at_runtime: unique_at_runtime,
|
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: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter H. Boling
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|