resque-unique_by_arity 1.0.7 → 1.0.8

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
  SHA1:
3
- metadata.gz: 3b2aa1e783e62de85edc68864c5b40e54adb348e
4
- data.tar.gz: 89b9d6cc87ff9e90b1e0002b81bf81c090fca977
3
+ metadata.gz: afaba7f0ac02c1b80d222b733d7caf16ce7b2d42
4
+ data.tar.gz: 1d6cc14ca863aa92d5f736d4741e479a6abc3759
5
5
  SHA512:
6
- metadata.gz: c5472ef10b97221b32a3f6b2e1fe73febfb7f818a6dfbdcdc01046beccf39fbf1f8df9e20372cdce758839d1a41907a241a53cfdcb4cbf33b084fa01193d3b91
7
- data.tar.gz: 50196ca7cc93dd4d092f48d02b42a843329b852cb3c485391317765d78fc4e5d3c85d5b0ea9c8b35286b5493e13ed6a8351b41cdfea7a479346ef26000db64f5
6
+ metadata.gz: 37655993edb61c5c6f26880e41519374ff4913b67ec32ac7979a108be31aec8773bb67d06b0485b55e648b442a43a993fb774a5665c284ef522f747f73492d84
7
+ data.tar.gz: 1b0019d9c73ae0e1e504d90871b4603474071d4c03f44d7dbcce1b7d1d5824a74d9bd68a46237e9064b009be588e99c6e08bd148857ec0b3c0c26c28c0f9ea67
@@ -15,7 +15,7 @@ module Resque
15
15
  @logger = options.key?(:logger) ? options[:logger] : Logger.new(STDOUT)
16
16
  @log_level = options.key?(:log_level) ? options[:log_level] : :debug
17
17
  @arity_for_uniqueness = options.key?(:arity_for_uniqueness) ? options[:arity_for_uniqueness] : 1
18
- @arity_validation = options.key?(:arity_validation) ? options[:arity_validation] : :warning
18
+ @arity_validation = options.key?(:arity_validation) ? options[:arity_validation] : false
19
19
  raise ArgumentError, "UniqueByArity::Cop.new requires arity_validation values of nil, false, :warning, :error, or an class descending from Exception but the value is #{@arity_validation} (#{@arity_validation.class})" unless VALID_ARITY_VALIDATION_LEVELS.include?(@arity_validation) || @arity_validation.ancestors.include?(Exception)
20
20
  @lock_after_execution_period = options.key?(:lock_after_execution_period) ? options[:lock_after_execution_period] : nil
21
21
  @unique_at_runtime = options.key?(:unique_at_runtime) ? options[:unique_at_runtime] : false
@@ -22,7 +22,7 @@ module Resque
22
22
  # This will override methods from both plugins above, if configured for both
23
23
  base.send(:extend, uniqueness_cop_module)
24
24
 
25
- base.singleton_class.prepend Resque::UniqueByArity::Validation
25
+ base.include Resque::UniqueByArity::Validation if @configuration.arity_validation
26
26
  end
27
27
  end
28
28
  end
@@ -1,9 +1,9 @@
1
1
  module Resque
2
2
  module UniqueByArity
3
3
  module Validation
4
- def perform(*_)
5
- uniq_config.validate_arity(self.to_s, self.method(:perform).super_method) if uniq_config.arity_validation
6
- super
4
+ def self.included(base)
5
+ @um = base.method(:perform)
6
+ base.uniq_config.validate_arity(base.to_s, @um) if base.uniq_config.arity_validation
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module UniqueByArity
3
- VERSION = "1.0.7"
3
+ VERSION = "1.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-unique_by_arity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling