potlock 0.2.0 → 0.3.0

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: d1b1d03ba7673ee19fa3bc43e646606eb5710c10b19857e5471fa5f15b6c7319
4
- data.tar.gz: f9337bc18212f014131d8de6c6efdb0abbf6b65b8458567c1206500730168ac4
3
+ metadata.gz: 34e0249ce15f65ab71348b7cbcf861ca353519a99d4db2fc467a143f34ed0200
4
+ data.tar.gz: cb61a3e35d9ea2f5fcf469739e64786d9bbccbe64b05d2aa76ae441b72bad56d
5
5
  SHA512:
6
- metadata.gz: 72dfb83f159611cce9173e61aec1c4f87f5006c782da69ff8e2e8c39af9b33042bc2fdeeb24709b7096e2726dcacb77b840c567846e7396ebe75732a31a0c090
7
- data.tar.gz: 1dc88859c43abf29cf3a252fbbd187d3f73a4009a311a4bcfa1de491a980c8234b006fe037027e703b816a033717ca4a56ff5b14ee3c6cab8207e4200d3ed0f2
6
+ metadata.gz: bdadc8671f86ada2c4174c30bd535ead19108ba05adf76deaa3fc1506fae16d948d458879a0cc10849e74f107c92f9e96f979ec7dee4bd378c7eec55ad33a204
7
+ data.tar.gz: 60019dd415833afcb37047fec4d527d7730052f97a82c3bc311a4f02522fe0e09303e4d883ca01a8af7824474e1bbc29967fa5b7b36520f939a599195bbab2dd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [0.3.0] - 2023-10-10
2
+
3
+ - 9ab3405 Add support for redis client option
4
+ - cefd13c Bump Redlock from ~1.2 to ~1.3
5
+
6
+ ## [0.2.1] - 2021-11-17
7
+
8
+ - 327bffe Bump version to 0.2.1
9
+ - 992aa0d Update potlock.gemspec
10
+ - 0f3dc42 Update Gemfile.lock
11
+
1
12
  ## [0.2.0] - 2021-11-16
2
13
 
3
14
  - 1faf6da Bump version to 0.2.0
data/Gemfile.lock CHANGED
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- potlock (0.2.0)
5
- redlock (~> 1.2)
4
+ potlock (0.3.0)
5
+ redlock (~> 1.3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
+ connection_pool (2.4.1)
11
12
  diff-lcs (1.4.4)
12
13
  mock_redis (0.29.0)
13
14
  ruby2_keywords
@@ -16,9 +17,12 @@ GEM
16
17
  ast (~> 2.4.1)
17
18
  rainbow (3.0.0)
18
19
  rake (13.0.6)
19
- redis (4.4.0)
20
- redlock (1.2.1)
21
- redis (>= 3.0.0, < 5.0)
20
+ redis (5.0.7)
21
+ redis-client (>= 0.9.0)
22
+ redis-client (0.17.0)
23
+ connection_pool
24
+ redlock (1.3.2)
25
+ redis (>= 3.0.0, < 6.0)
22
26
  regexp_parser (2.1.1)
23
27
  rexml (3.2.5)
24
28
  rspec (3.10.0)
@@ -33,24 +37,23 @@ GEM
33
37
  rspec-mocks (3.10.2)
34
38
  diff-lcs (>= 1.2.0, < 2.0)
35
39
  rspec-support (~> 3.10.0)
36
- rspec-support (3.10.2)
37
- rubocop (1.21.0)
40
+ rspec-support (3.10.3)
41
+ rubocop (1.23.0)
38
42
  parallel (~> 1.10)
39
43
  parser (>= 3.0.0.0)
40
44
  rainbow (>= 2.2.2, < 4.0)
41
45
  regexp_parser (>= 1.8, < 3.0)
42
46
  rexml
43
- rubocop-ast (>= 1.9.1, < 2.0)
47
+ rubocop-ast (>= 1.12.0, < 2.0)
44
48
  ruby-progressbar (~> 1.7)
45
49
  unicode-display_width (>= 1.4.0, < 3.0)
46
- rubocop-ast (1.11.0)
50
+ rubocop-ast (1.13.0)
47
51
  parser (>= 3.0.1.1)
48
- rubocop-rspec (2.4.0)
49
- rubocop (~> 1.0)
50
- rubocop-ast (>= 1.1.0)
52
+ rubocop-rspec (2.6.0)
53
+ rubocop (~> 1.19)
51
54
  ruby-progressbar (1.11.0)
52
55
  ruby2_keywords (0.0.5)
53
- unicode-display_width (2.0.0)
56
+ unicode-display_width (2.1.0)
54
57
 
55
58
  PLATFORMS
56
59
  ruby
data/README.md CHANGED
@@ -89,6 +89,8 @@ Potlock.configure do |config|
89
89
  config.redis_host = "localhost"
90
90
  config.redis_port = "6379"
91
91
  config.redis_db = "1"
92
+ # or
93
+ # config.redis = Redis.new(host: "localhost", port: 6379, db: 1)
92
94
  end
93
95
  ```
94
96
 
@@ -58,6 +58,8 @@ module Potlock
58
58
  end
59
59
 
60
60
  def redis
61
+ return Potlock.configuration.redis unless Potlock.configuration.redis.nil?
62
+
61
63
  @redis ||= Redis.new(
62
64
  host: Potlock.configuration.redis_host,
63
65
  db: Potlock.configuration.redis_db,
@@ -3,7 +3,7 @@
3
3
  module Potlock
4
4
  class Configuration
5
5
  # Redis connection information
6
- attr_accessor :redis_host, :redis_port, :redis_db
6
+ attr_accessor :redis, :redis_host, :redis_port, :redis_db
7
7
 
8
8
  # How many times it'll try to lock a resource
9
9
  attr_accessor :retry_count
@@ -12,9 +12,10 @@ module Potlock
12
12
  attr_accessor :retry_delay
13
13
 
14
14
  def initialize
15
- @redis_host = "localhost"
16
- @redis_port = "6379"
17
- @redis_db = "1"
15
+ @redis = nil
16
+ @redis_host = "localhost"
17
+ @redis_port = "6379"
18
+ @redis_db = "1"
18
19
  @retry_count = 25
19
20
  @retry_delay = 200
20
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Potlock
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: potlock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Couraud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-16 00:00:00.000000000 Z
11
+ date: 2023-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redlock
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: '1.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.2'
26
+ version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mock_redis
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -124,8 +124,9 @@ licenses:
124
124
  - MIT
125
125
  metadata:
126
126
  allowed_push_host: https://rubygems.org
127
- changelog_uri: https://github.com/potloc/potlock/CHANGELOG.md
127
+ changelog_uri: https://github.com/potloc/potlock/blob/main/CHANGELOG.md
128
128
  homepage_uri: https://github.com/potloc/potlock
129
+ rubygems_mfa_required: 'true'
129
130
  source_code_uri: https://github.com/potloc/potlock
130
131
  post_install_message:
131
132
  rdoc_options: []
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  requirements: []
145
- rubygems_version: 3.2.22
146
+ rubygems_version: 3.3.7
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: Distributed Read-Write lock using redis.