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
- SHA1:
3
- metadata.gz: f633f3ff4e8bb0f3e870227767fa1354624387ae
4
- data.tar.gz: 997bbaa637fd611baa63d107759df5c64c8e9dda
2
+ SHA256:
3
+ metadata.gz: 41b95f0fb6ea9a5bb7f107893efb476b5bc533c1a76ec9d96a523589dbcdb89e
4
+ data.tar.gz: d68bff5ca6ba72c92a009a53334be806edf0fad08fab8d095a01f26a0eda8a6d
5
5
  SHA512:
6
- metadata.gz: 7697b2036bc838b6be804f30cf1c0d5e40b9566e9d4f21b8d6722449777bf0937724b8fcb5806b44296a3e7f36d22f08b8aa41729b2aab02beaad6b75b86d703
7
- data.tar.gz: cc13bf8f10a09ca98ee1fc75d6f14a8519872d1d3df1a10fe6dacc399eabf9df20dd109f7dd84fcde7648e81f7a4c8f36a3b4eb8ba810088b0dc5362f01a6589
6
+ metadata.gz: f3f01c31058533db7534f51cc8b0c55f892b9c9ab3e45ce777eb3e327ff2ca6714b0237eab0bc1ff0d106524ea5e453ee323a5ccc607d11c148531ff9db79efa
7
+ data.tar.gz: ad96c870c8d3c363553d402cd76c6791182b33623bd82724d86cb498724fe76e689704eeec38685bcdbf2cd5b1b84f4d4335331c91eab6f2459d0f4b16b3b823
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.0.0
5
- before_install: gem install bundler -v 1.14.6
4
+ - 2.4.3
5
+ - 2.5.0
6
+ before_install: gem install bundler
@@ -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 options.keys.length > 0 && @logger
29
- log ":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
30
- log ":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
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 @unique_in_queue && @unique_across_queues
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
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module UniqueByArity
3
- VERSION = "1.0.10"
3
+ VERSION = "1.0.11"
4
4
  end
5
5
  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", "~> 10.0"
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.10
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: 2017-11-19 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
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.12
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