redis-single-file 0.1.4 → 0.1.6

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: 78126af09e0d0f2da2535334d0916d59aedfcb092aaa724bb1524649f2394ca8
4
- data.tar.gz: f6e5a79071e40858b22adb3c46223fc0b4749f349515c3d5997242ce1245d711
3
+ metadata.gz: 757e8b6e5ddd02090dbe6d402740d7545afa1416e24d17380281864a8c7e58c6
4
+ data.tar.gz: d4523e1a31505a3c8a8ddb93cf045c956c754ab2841d84d760826ec37bdff76d
5
5
  SHA512:
6
- metadata.gz: d3424746f18a52165067124042e1a8f543669b9b5605c53c87108cf2947278a03d325fb5dc8a44ea18eb5d4ab1371db9c4241581aa2f2eae1f17c3ec22b7ab6e
7
- data.tar.gz: ada3dc29dc1f04f30ab4baf5f3726d4ab83d3ccec3ab64897c2a0d739a5e1d8c3a3cf751613cd737de0116505570d4830c6c589fb1d5ca9544b067f403a5fd55
6
+ metadata.gz: 71b48d5cd291dae2411bafa3c04dabd3a759672851fe4d1b87bccf82d368eb0be2d50b3facde55951209a45c6d4403a58ecec05bc14d81f870424ac0c43f6a83
7
+ data.tar.gz: 46dcc1b76dd078f18e1eea7b4c1cd9cb7b57a9009fbd337646315058470c0201e2e054c8dbbf9b2f626a85accaf0cceea2ff2d3882b1a7a52e08db38b274dabb
data/.rubocop.yml CHANGED
@@ -21,6 +21,10 @@ Style/NumericPredicate:
21
21
  Exclude:
22
22
  - lib/redis_single_file/semaphore.rb
23
23
 
24
+ Naming/FileName:
25
+ Exclude:
26
+ - lib/redis-single-file.rb
27
+
24
28
  #
25
29
  # rspec stuff
26
30
  #
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.6
1
+ 3.4.10
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [0.1.6] - 2026-08-27
2
+
3
+ ## What's Changed
4
+
5
+ * Return a semaphore permit only after `BLPOP` successfully acquires one.
6
+ * Publish through a verified, MFA-protected RubyGems trusted publisher.
7
+ * Update the development and release runtime to Ruby 3.4.10 and test
8
+ compatibility across Ruby 3.2, 3.3, 3.4, and 4.0.
9
+
10
+ ---
11
+ <br />
12
+
1
13
  ## [0.1.3] - 2025-02-08
2
14
 
3
15
  ## What's Changed
data/README.md CHANGED
@@ -161,9 +161,14 @@ Redlock is not susceptible to this given the use of the multi-master deployment
161
161
 
162
162
  ```spec
163
163
  Finished in 0.00818 seconds (files took 0.09999 seconds to load)
164
- 22 examples, 0 failures
164
+ 30 examples, 0 failures
165
165
  ```
166
166
 
167
+ ## Releasing
168
+
169
+ See [RELEASING.md](RELEASING.md) for the trusted-publishing setup and the
170
+ versioned release procedure.
171
+
167
172
  ## Benchmark
168
173
 
169
174
  $ bundle exec ruby benchmark.rb
data/RELEASING.md ADDED
@@ -0,0 +1,41 @@
1
+ # Releasing
2
+
3
+ Releases are published from `.github/workflows/release.yml` through RubyGems
4
+ trusted publishing. The workflow accepts only a `v<gem-version>` tag attached
5
+ to a commit contained in `main`, runs the test, lint, and package-build gates,
6
+ and then enters the protected `release` environment before publishing.
7
+
8
+ ## Publisher configuration
9
+
10
+ 1. In the GitHub repository settings, create an environment named `release`.
11
+ 2. Add a required reviewer and restrict deployment branches and tags to the
12
+ protected tag pattern `v*`.
13
+ 3. Ensure every owner of the `redis-single-file` gem has MFA enabled on
14
+ RubyGems.org.
15
+ 4. Configure RubyGems trusted publishing for
16
+ `.github/workflows/release.yml` using the `release` environment.
17
+ 5. After the first trusted release succeeds, remove the obsolete
18
+ `RUBYGEMS_API_KEY` secret from the GitHub repository.
19
+
20
+ The trusted publisher should be registered only after `release.yml` is present
21
+ on the repository's default branch.
22
+
23
+ ## Release procedure
24
+
25
+ 1. Update `RedisSingleFile::VERSION`, `Gemfile.lock`, and `CHANGELOG.md` in a
26
+ pull request.
27
+ 2. Merge the pull request after every required check passes.
28
+ 3. Create an annotated tag on the release commit and push it:
29
+
30
+ ```bash
31
+ git switch main
32
+ git pull --ff-only origin main
33
+ version="$(ruby -Ilib -rredis_single_file/version -e 'print RedisSingleFile::VERSION')"
34
+ git tag -a "v${version}" -m "Release ${version}"
35
+ git push origin "v${version}"
36
+ ```
37
+
38
+ 4. Approve the `release` environment deployment after verifying the tag,
39
+ commit, and version shown by the workflow.
40
+
41
+ Do not tag a feature branch or rerun an old tag for a different gem version.
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'redis_single_file'
@@ -112,10 +112,14 @@ module RedisSingleFile
112
112
  def synchronize!(timeout: 0, concurrency: @concurrency)
113
113
  return unless block_given?
114
114
 
115
+ token_acquired = false
116
+
115
117
  with_retry_protection do
116
118
  prime_queue(concurrency) unless redis.getset(mutex_key, mutex_val)
117
119
  raise QueueTimeoutError unless redis.blpop(queue_key, timeout:)
118
120
 
121
+ token_acquired = true
122
+
119
123
  redis.multi do
120
124
  redis.persist(mutex_key) # unexpire during execution
121
125
  redis.persist(queue_key) # unexpire during execution
@@ -124,8 +128,8 @@ module RedisSingleFile
124
128
 
125
129
  yield
126
130
  ensure
127
- # always cycle the queue when exiting
128
- unlock_queue(concurrency) if block_given?
131
+ # only return a token this client successfully acquired
132
+ unlock_queue(concurrency) if token_acquired
129
133
  end
130
134
 
131
135
  private #===================================================================
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedisSingleFile
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-single-file
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - LifeBCE
@@ -50,8 +50,10 @@ files:
50
50
  - CHANGELOG.md
51
51
  - LICENSE.txt
52
52
  - README.md
53
+ - RELEASING.md
53
54
  - Rakefile
54
55
  - benchmark.rb
56
+ - lib/redis-single-file.rb
55
57
  - lib/redis_single_file.rb
56
58
  - lib/redis_single_file/cluster_client_builder.rb
57
59
  - lib/redis_single_file/configuration.rb
@@ -66,7 +68,7 @@ metadata:
66
68
  homepage_uri: https://github.com/lifeBCE/redis-single-file
67
69
  allowed_push_host: https://rubygems.org
68
70
  changelog_uri: https://github.com/lifeBCE/redis-single-file/blob/main/CHANGELOG.md
69
- rubygems_mfa_required: 'false'
71
+ rubygems_mfa_required: 'true'
70
72
  rdoc_options: []
71
73
  require_paths:
72
74
  - lib