resque-unique_by_arity 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 320160b5cbb9ce7b5347856e8e0ed5b1fb5277ef3d91162870ab984f9b856b93
4
- data.tar.gz: 2ca9c526fd23cd3ae036ee6d378e1635f2cf10eb7c27b617eb2b5bc4a1e592eb
3
+ metadata.gz: 2832d3ab2ddbac6a32f3402a0a24dea7eb8ca6b253d0eff6ea6f8a924e343fb1
4
+ data.tar.gz: a03a10a39c8fe8b1bfbec33299b4de7a72f7d8da3e8d1131c693e97fb61cc580
5
5
  SHA512:
6
- metadata.gz: b99c2055b7740fe7da51b844e558b47c54fac217071ca3522be15b7de1a8b08b7a04d4ed176d1f13bae3ced96740be048699bdc787778a0683e3e5b9d15364a8
7
- data.tar.gz: ae6ba4159d5673adccf3bda77140576d5a1f0817e2f0f551dde2663bab865d4f0de8c4d29c37510c8c6ae49871be8405b35e567a968b82696b1d5e981cd53619
6
+ metadata.gz: bdd1c1ff4d5ba5aca5ba17f3e6ae290c349f7064084c0876054200a28951352b410163287db536d0930109d655c7a43c51b61271bdc972d4dc65436fc85bc772
7
+ data.tar.gz: dc859b3415561ec698bb82381c713cef59f298c8ae591ff281eef103b0b545b5dec7e30de45c58c41d5e9415b2e289b046312ec8335b887ff1fb7baae274c027
@@ -1,35 +1,55 @@
1
- example_id | status | run_time |
2
- -------------------------------------------------- | ------ | --------------- |
3
- ./spec/resque/unique_by_arity_spec.rb[1:1] | passed | 0.00088 seconds |
4
- ./spec/resque/unique_by_arity_spec.rb[1:2:1:1] | passed | 0.00094 seconds |
5
- ./spec/resque/unique_by_arity_spec.rb[1:3:1] | passed | 0.00017 seconds |
6
- ./spec/resque/unique_by_arity_spec.rb[1:4:1:1] | passed | 0.00016 seconds |
7
- ./spec/resque/unique_by_arity_spec.rb[1:5:1:1] | passed | 0.00159 seconds |
8
- ./spec/resque/unique_by_arity_spec.rb[1:5:2:1] | passed | 0.00029 seconds |
9
- ./spec/resque/unique_by_arity_spec.rb[1:5:3:1] | passed | 0.0003 seconds |
10
- ./spec/resque/unique_by_arity_spec.rb[1:6:1] | passed | 0.00016 seconds |
11
- ./spec/resque/unique_by_arity_spec.rb[1:7:1] | passed | 0.00033 seconds |
12
- ./spec/resque/unique_by_arity_spec.rb[1:7:2:1] | passed | 0.00028 seconds |
13
- ./spec/resque/unique_by_arity_spec.rb[1:7:3:1] | passed | 0.00036 seconds |
14
- ./spec/resque/unique_by_arity_spec.rb[1:7:4:1] | passed | 0.00035 seconds |
15
- ./spec/resque/unique_by_arity_spec.rb[1:8:1:1:1:1] | passed | 0.00811 seconds |
16
- ./spec/resque/unique_by_arity_spec.rb[1:8:1:2:1:1] | passed | 0.0006 seconds |
17
- ./spec/resque/unique_by_arity_spec.rb[1:8:1:3:1:1] | passed | 0.00104 seconds |
18
- ./spec/resque/unique_by_arity_spec.rb[1:8:2:1:1:1] | passed | 0.00079 seconds |
19
- ./spec/resque/unique_by_arity_spec.rb[1:8:2:2:1:1] | passed | 0.0003 seconds |
20
- ./spec/resque/unique_by_arity_spec.rb[1:8:2:3:1:1] | passed | 0.00026 seconds |
21
- ./spec/resque/unique_by_arity_spec.rb[1:8:3:1:1:1] | passed | 0.00042 seconds |
22
- ./spec/resque/unique_by_arity_spec.rb[1:8:3:2:1:1] | passed | 0.00083 seconds |
23
- ./spec/resque/unique_by_arity_spec.rb[1:8:3:3:1:1] | passed | 0.00028 seconds |
24
- ./spec/resque/unique_by_arity_spec.rb[1:8:4:1:1:1] | passed | 0.00032 seconds |
25
- ./spec/resque/unique_by_arity_spec.rb[1:8:4:2:1:1] | passed | 0.00076 seconds |
26
- ./spec/resque/unique_by_arity_spec.rb[1:8:4:3:1:1] | passed | 0.00031 seconds |
27
- ./spec/resque/unique_by_arity_spec.rb[1:8:5:1:1:1] | passed | 0.00032 seconds |
28
- ./spec/resque/unique_by_arity_spec.rb[1:8:5:2:1:1] | passed | 0.001 seconds |
29
- ./spec/resque/unique_by_arity_spec.rb[1:8:5:3:1] | passed | 0.00078 seconds |
30
- ./spec/resque/unique_by_arity_spec.rb[1:9:1] | passed | 0.00452 seconds |
31
- ./spec/resque/unique_by_arity_spec.rb[1:10:1:1] | passed | 0.00026 seconds |
32
- ./spec/resque/unique_by_arity_spec.rb[1:11:1:1] | passed | 0.00052 seconds |
33
- ./spec/resque/unique_by_arity_spec.rb[1:11:2:1:1] | passed | 0.00083 seconds |
34
- ./spec/resque/unique_by_arity_spec.rb[1:11:2:2:1] | passed | 0.00264 seconds |
35
- ./spec/resque/unique_by_arity_spec.rb[1:11:2:3:1] | passed | 0.00328 seconds |
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,
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module UniqueByArity
3
- VERSION = '2.0.1'.freeze
3
+ VERSION = '2.0.2'.freeze
4
4
  end
5
5
  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: 2.0.1
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-08 00:00:00.000000000 Z
11
+ date: 2018-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize