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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afaba7f0ac02c1b80d222b733d7caf16ce7b2d42
|
4
|
+
data.tar.gz: 1d6cc14ca863aa92d5f736d4741e479a6abc3759
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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] :
|
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.
|
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
|
5
|
-
|
6
|
-
|
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
|