sidekiq-lock 0.4.0 → 0.5.0

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
  SHA256:
3
- metadata.gz: 7fb91d967eb073b2fb524357b936d473f3ab03450f3a1e7f45f9ae53895a210e
4
- data.tar.gz: 10e5ac0b30ea212f675d9ce11ba63da4114b7ade9f1da89bbdcd209cfaa2f40e
3
+ metadata.gz: 592d4bf95b4bbd2cba2444898c5f6843c0a9112c6c45e018999af361b8a5ca73
4
+ data.tar.gz: 7b0a5614796a292af28fc0880915a76ac85ecfb8c669b07d57d5019d8f246342
5
5
  SHA512:
6
- metadata.gz: 3181d04fc0b7fbb7f9807851abf37d69b09333b38fef0c8388671a750a4087a5a185fd57dce6469095fb26ee42728b2e856f623b2643a3c15a9ed244197e6d0f
7
- data.tar.gz: b1d1bd1c051b60188853436fd62ecec774cac2e303134e12dac203d166159b51e141f4a1a626ed952b6aa4591352f11e283bd17d371174bfdd25a6c3cac9745b
6
+ metadata.gz: ff115e3d009c6b6803e20326c2d84bf2286d9e4b652fe840b743596b8257919d7c54b3f1b9e1dcf2f9f1cba16af6541490464a77d55b52ff1b9407f28a7981f3
7
+ data.tar.gz: 0cf165b35136db26001b236837dcd7a831867fc81d8b81a3e14c2efe76edf41ade9cb5ba437b311b9ec1626af5aae176a3a09fde0c393ef5b949f2f5e5f8fa64
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.5.0 (August 13, 2021)
2
+
3
+ - maintenance - test on latest ruby versions (remove outdated rubies from build), add sidekiq 6 to build matrix, remove coveralls
4
+ - fix for ruby 3 (thanks to [@ak15](https://github.com/ak15))
5
+
1
6
  ## 0.4.0 (July 18, 2018)
2
7
 
3
8
  - make lock container configurable (non breaking change) - in case you would like to something else than `Thread.current` - now you easily can
@@ -10,7 +15,7 @@
10
15
 
11
16
  ## 0.3.0 (July 28, 2016)
12
17
 
13
- - ability to set custom lock value. Works just like setting timeout and name (handles procs as well).
18
+ - ability to set custom lock value. Works just like setting timeout and name, handles procs as well (thanks to [@piokaczm](https://github.com/piokaczm))
14
19
 
15
20
  ``` ruby
16
21
  sidekiq_options lock: {
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
+ <p align="center">
2
+ <img width="300" height="210" src="https://github.com/emq/sidekiq-lock/raw/master/logo.png">
3
+ </p>
4
+
1
5
  # Sidekiq::Lock
2
6
 
3
7
  [![Code Climate](https://codeclimate.com/github/emq/sidekiq-lock.png)](https://codeclimate.com/github/emq/sidekiq-lock)
4
- [![Build Status](https://travis-ci.org/emq/sidekiq-lock.png?branch=master)](https://travis-ci.org/emq/sidekiq-lock)
5
- [![Coverage Status](https://coveralls.io/repos/emq/sidekiq-lock/badge.png)](https://coveralls.io/r/emq/sidekiq-lock)
8
+ [![Build Status](https://travis-ci.com/rwojsznis/sidekiq-lock.svg?branch=master)](https://travis-ci.com/rwojsznis/sidekiq-lock)
6
9
  [![Gem Version](https://badge.fury.io/rb/sidekiq-lock.png)](http://badge.fury.io/rb/sidekiq-lock)
7
10
 
8
11
  **Note:** This is a _complete_ piece of software, it should work across all future sidekiq & ruby versions.
@@ -23,7 +23,7 @@ module Sidekiq
23
23
  # this also requires redis-rb >= 3.0.5
24
24
  def acquire!
25
25
  @acquired ||= Sidekiq.redis do |r|
26
- r.set(name, value, { nx: true, px: timeout })
26
+ r.set(name, value, nx: true, px: timeout)
27
27
  end
28
28
  end
29
29
 
@@ -31,8 +31,8 @@ module Sidekiq
31
31
  Sidekiq.redis do |r|
32
32
  begin
33
33
  r.evalsha redis_lock_script_sha, keys: [name], argv: [value]
34
- rescue Redis::CommandError
35
- r.eval redis_lock_script, keys: [name], argv: [value]
34
+ rescue Redis::CommandError
35
+ r.eval redis_lock_script, keys: [name], argv: [value]
36
36
  end
37
37
  end
38
38
  end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Lock
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
data/test/test_helper.rb CHANGED
@@ -1,8 +1,3 @@
1
- require 'coveralls'
2
- Coveralls.wear! do
3
- add_filter '/test/'
4
- end
5
-
6
1
  require 'minitest/autorun'
7
2
  require 'minitest/pride'
8
3
  require 'mocha/setup'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-lock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafal Wojsznis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-18 00:00:00.000000000 Z
11
+ date: 2021-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: coveralls
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.8'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '0.8'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: mocha
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -143,18 +129,10 @@ executables: []
143
129
  extensions: []
144
130
  extra_rdoc_files: []
145
131
  files:
146
- - ".gitignore"
147
- - ".travis.yml"
148
- - Appraisals
149
132
  - CHANGELOG.md
150
- - Gemfile
151
133
  - LICENSE.txt
152
134
  - README.md
153
135
  - Rakefile
154
- - gemfiles/sidekiq_2.gemfile
155
- - gemfiles/sidekiq_3.gemfile
156
- - gemfiles/sidekiq_4.gemfile
157
- - gemfiles/sidekiq_5.gemfile
158
136
  - lib/sidekiq-lock.rb
159
137
  - lib/sidekiq/lock.rb
160
138
  - lib/sidekiq/lock/container.rb
@@ -163,7 +141,6 @@ files:
163
141
  - lib/sidekiq/lock/testing/inline.rb
164
142
  - lib/sidekiq/lock/version.rb
165
143
  - lib/sidekiq/lock/worker.rb
166
- - sidekiq-lock.gemspec
167
144
  - test/lib/container_test.rb
168
145
  - test/lib/lock_test.rb
169
146
  - test/lib/middleware_test.rb
@@ -191,17 +168,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
168
  - !ruby/object:Gem::Version
192
169
  version: '0'
193
170
  requirements: []
194
- rubyforge_project:
195
- rubygems_version: 2.7.6
171
+ rubygems_version: 3.2.5
196
172
  signing_key:
197
173
  specification_version: 4
198
174
  summary: Simple redis-based lock mechanism for your sidekiq workers
199
175
  test_files:
200
- - test/lib/container_test.rb
201
- - test/lib/lock_test.rb
202
- - test/lib/middleware_test.rb
176
+ - test/test_workers.rb
177
+ - test/lib/worker_test.rb
203
178
  - test/lib/redis_lock_test.rb
204
179
  - test/lib/testing/inline_test.rb
205
- - test/lib/worker_test.rb
180
+ - test/lib/middleware_test.rb
181
+ - test/lib/lock_test.rb
182
+ - test/lib/container_test.rb
206
183
  - test/test_helper.rb
207
- - test/test_workers.rb
data/.gitignore DELETED
@@ -1,22 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .rvmrc
19
- .ruby-version
20
- .ruby-gemset
21
- *.gemfile.lock
22
- .idea/
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
-
4
- services:
5
- - redis-server
6
-
7
- gemfile:
8
- - gemfiles/sidekiq_2.gemfile
9
- - gemfiles/sidekiq_3.gemfile
10
- - gemfiles/sidekiq_4.gemfile
11
- - gemfiles/sidekiq_5.gemfile
12
-
13
- rvm:
14
- - 2.2.10
15
- - 2.3.7
16
- - 2.4.4
17
- - 2.5.1
18
-
19
- notifications:
20
- email: false
data/Appraisals DELETED
@@ -1,15 +0,0 @@
1
- appraise 'sidekiq-2' do
2
- gem 'sidekiq', '~> 2.17', '>= 2.17.8'
3
- end
4
-
5
- appraise 'sidekiq-3' do
6
- gem 'sidekiq', '~> 3.5', '>= 3.5.4'
7
- end
8
-
9
- appraise 'sidekiq-4' do
10
- gem 'sidekiq', '~> 4.2', '>= 4.2.10'
11
- end
12
-
13
- appraise 'sidekiq-5' do
14
- gem 'sidekiq', '~> 5.1', '>= 5.1'
15
- end
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source "https://rubygems.org"
2
- gemspec
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sidekiq", "~> 2.17", ">= 2.17.8"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sidekiq", "~> 3.5", ">= 3.5.4"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sidekiq", "~> 4.2", ">= 4.2.10"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sidekiq", "~> 5.1", ">= 5.1"
6
-
7
- gemspec path: "../"
data/sidekiq-lock.gemspec DELETED
@@ -1,30 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'sidekiq/lock/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "sidekiq-lock"
8
- spec.version = Sidekiq::Lock::VERSION
9
- spec.authors = ["Rafal Wojsznis"]
10
- spec.email = ["rafal.wojsznis@gmail.com"]
11
- spec.description = spec.summary = "Simple redis-based lock mechanism for your sidekiq workers"
12
- spec.homepage = "https://github.com/emq/sidekiq-lock"
13
- spec.license = "MIT"
14
-
15
- spec.files = `git ls-files`.split($/)
16
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
- spec.require_paths = ["lib"]
19
-
20
- spec.add_dependency "sidekiq", ">= 2.14.0"
21
- spec.add_dependency "redis", ">= 3.0.5"
22
-
23
- spec.add_development_dependency "bundler"
24
- spec.add_development_dependency "rake"
25
- spec.add_development_dependency "rack-test"
26
- spec.add_development_dependency "coveralls", "~> 0.8"
27
- spec.add_development_dependency "mocha", "~> 0.14.0"
28
- spec.add_development_dependency "minitest"
29
- spec.add_development_dependency "appraisal"
30
- end