with_advisory_lock 5.0.0 → 5.1.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: 784812e261b5a57a5d3da8c878e536949245b29372b40b2baf15a52d7c65b854
4
- data.tar.gz: ba2f6fc8bf78c89d56635c4f56500117f79a443404d3574d8b54b2a45d1811de
3
+ metadata.gz: 6918df100f32e829701a38ad6b7dd30db20d7a83635b82cbd8ccc7f3022a88d5
4
+ data.tar.gz: f231c4fa8b5c403de000054839603e2297215929a64cccc63c21c577bc19ecd7
5
5
  SHA512:
6
- metadata.gz: bb7dc11c1f206639943daa363a4d917bfe93792e7db764c7860ef68151e99defaa03f58640fae0480b566e3d4a0697695f5b60ae8af09838bb176979c328d8ae
7
- data.tar.gz: 10132a0c47ed8070a0661a7b6ae0409be76ef14693be65c12a8e8cdd9c5a506ba25c60bda264f7c60bd92952e4cd4c5513a5e566a3e0d757f0ab6fc4311ffcd5
6
+ metadata.gz: 21a2201433600aa26b0f7b0176b3b4e87606a00459b70d9dfb10a385c00a53fa5f0365cd426c2b5793d1b0022fa37e663567b0daf185e4be93d5a59e10695e2e
7
+ data.tar.gz: b1e707a2115e83cd1667bb6b1842c7150b28da3603bd3ec668fc9918de01553fc10d44e65d89d94a3f7a183489da49b0348d1cc59650487d48482648041445df
@@ -0,0 +1,20 @@
1
+ name: release-please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ release-please:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: google-github-actions/release-please-action@v4
18
+ id: release
19
+ with:
20
+ command: manifest
@@ -0,0 +1 @@
1
+ {".":"5.1.0"}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  ## Changelog
2
2
 
3
+ ## [5.1.0](https://github.com/ClosureTree/with_advisory_lock/compare/with_advisory_lock/v5.0.1...with_advisory_lock/v5.1.0) (2024-01-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * use zeitwerk loader instead of ActiveSupport::Autoload ([b5082fd](https://github.com/ClosureTree/with_advisory_lock/commit/b5082fddacacacff48139f5bf509601a37945a0e))
9
+
10
+ ## 5.0.1 (2024-01-21)
11
+
12
+
13
+ ### Features
14
+
15
+ * add release workflow ([5d32520](https://github.com/ClosureTree/with_advisory_lock/commit/5d325201c82974991381a9fbc4d1714c9739dc4f))
16
+ * add ruby 3.1 test/support ([#60](https://github.com/ClosureTree/with_advisory_lock/issues/60)) ([514f042](https://github.com/ClosureTree/with_advisory_lock/commit/514f0420d957ef30911a00d54685385bec5867c3))
17
+ * Add testing for activerecord 7.1 and support for trilogy adapter ([#77](https://github.com/ClosureTree/with_advisory_lock/issues/77)) ([69c23fe](https://github.com/ClosureTree/with_advisory_lock/commit/69c23fe09887fc5d97ac7b0194825c21efe244a5))
18
+ * add truffleruby support ([#62](https://github.com/ClosureTree/with_advisory_lock/issues/62)) ([ec34bd4](https://github.com/ClosureTree/with_advisory_lock/commit/ec34bd448e3505e5df631daaf47bb83f2f5316dc))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * User may sometimes pass in non-strings, such as integers ([#55](https://github.com/ClosureTree/with_advisory_lock/issues/55)) ([9885597](https://github.com/ClosureTree/with_advisory_lock/commit/988559747363ef00958fcf782317e76c40ffa2a3))
24
+
3
25
  ### 5.0.0
4
26
  - Drop support for EOL rubies and activerecord (ruby below 2.7 and activerecord below 6.1).
5
27
  - Allow lock name to be integer
@@ -79,7 +79,7 @@ module WithAdvisoryLock
79
79
  else
80
80
  # Ruby MRI's String#hash is randomly seeded as of Ruby 1.9 so
81
81
  # make sure we use a deterministic hash.
82
- Zlib.crc32(input.to_s)
82
+ Zlib.crc32(input.to_s, 0)
83
83
  end
84
84
  end
85
85
 
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/concern'
4
-
5
3
  module WithAdvisoryLock
6
4
  module Concern
7
5
  extend ActiveSupport::Concern
@@ -15,9 +13,7 @@ module WithAdvisoryLock
15
13
 
16
14
  def with_advisory_lock!(lock_name, options = {}, &block)
17
15
  result = with_advisory_lock_result(lock_name, options, &block)
18
- unless result.lock_was_acquired?
19
- raise WithAdvisoryLock::FailedToAcquireLock, lock_name
20
- end
16
+ raise WithAdvisoryLock::FailedToAcquireLock, lock_name unless result.lock_was_acquired?
21
17
 
22
18
  result.result
23
19
  end
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WithAdvisoryLock
2
4
  class FailedToAcquireLock < StandardError
3
5
  def initialize(lock_name)
4
6
  super("Failed to acquire lock #{lock_name}")
5
7
  end
6
8
  end
7
- end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WithAdvisoryLock
4
- VERSION = Gem::Version.new('5.0.0')
4
+ VERSION = Gem::Version.new('5.1.0')
5
5
  end
@@ -1,16 +1,15 @@
1
1
  require 'with_advisory_lock/version'
2
2
  require 'active_support'
3
- require_relative 'with_advisory_lock/failed_to_acquire_lock'
3
+ require 'zeitwerk'
4
4
 
5
- module WithAdvisoryLock
6
- extend ActiveSupport::Autoload
5
+ loader = Zeitwerk::Loader.for_gem
6
+ loader.inflector.inflect(
7
+ 'mysql' => 'MySQL',
8
+ 'postgresql' => 'PostgreSQL',
9
+ )
10
+ loader.setup
7
11
 
8
- autoload :Concern
9
- autoload :Base
10
- autoload :DatabaseAdapterSupport
11
- autoload :Flock
12
- autoload :MySQL, 'with_advisory_lock/mysql'
13
- autoload :PostgreSQL, 'with_advisory_lock/postgresql'
12
+ module WithAdvisoryLock
14
13
  end
15
14
 
16
15
  ActiveSupport.on_load :active_record do
@@ -0,0 +1,9 @@
1
+ {
2
+ "release-type": "ruby",
3
+ "packages": {
4
+ ".": {
5
+ "release-type": "ruby",
6
+ "package-name": "with_advisory_lock"
7
+ }
8
+ }
9
+ }
@@ -16,11 +16,16 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
17
  spec.test_files = spec.files.grep(%r{^test/})
18
18
  spec.require_paths = %w[lib]
19
- spec.metadata = { "rubyspecs_mfa_required" => "true" }
19
+ spec.metadata = { 'rubyspecs_mfa_required' => 'true' }
20
20
  spec.required_ruby_version = '>= 2.7.0'
21
- spec.metadata["yard.run"] = "yri"
21
+ spec.metadata['yard.run'] = 'yri'
22
+
23
+ spec.metadata['homepage_uri'] = spec.homepage
24
+ spec.metadata['source_code_uri'] = 'https://github.com/ClosureTree/with_advisory_lock'
25
+ spec.metadata['changelog_uri'] = 'https://github.com/ClosureTree/with_advisory_lock/blob/master/CHANGELOG.md'
22
26
 
23
27
  spec.add_runtime_dependency 'activerecord', '>= 6.1'
28
+ spec.add_runtime_dependency 'zeitwerk', '>= 2.6'
24
29
 
25
30
  spec.add_development_dependency 'appraisal'
26
31
  spec.add_development_dependency 'maxitest'
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: with_advisory_lock
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew McEachen
8
8
  - Abdelkader Boudih
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-10-29 00:00:00.000000000 Z
12
+ date: 2024-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '6.1'
28
+ - !ruby/object:Gem::Dependency
29
+ name: zeitwerk
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '2.6'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '2.6'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: appraisal
30
44
  requirement: !ruby/object:Gem::Requirement
@@ -104,7 +118,9 @@ extensions: []
104
118
  extra_rdoc_files: []
105
119
  files:
106
120
  - ".github/workflows/ci.yml"
121
+ - ".github/workflows/release.yml"
107
122
  - ".gitignore"
123
+ - ".release-please-manifest.json"
108
124
  - ".tool-versions"
109
125
  - Appraisals
110
126
  - CHANGELOG.md
@@ -124,6 +140,7 @@ files:
124
140
  - lib/with_advisory_lock/mysql.rb
125
141
  - lib/with_advisory_lock/postgresql.rb
126
142
  - lib/with_advisory_lock/version.rb
143
+ - release-please-config.json
127
144
  - test/concern_test.rb
128
145
  - test/lock_test.rb
129
146
  - test/nesting_test.rb
@@ -141,7 +158,10 @@ licenses:
141
158
  metadata:
142
159
  rubyspecs_mfa_required: 'true'
143
160
  yard.run: yri
144
- post_install_message:
161
+ homepage_uri: https://github.com/ClosureTree/with_advisory_lock
162
+ source_code_uri: https://github.com/ClosureTree/with_advisory_lock
163
+ changelog_uri: https://github.com/ClosureTree/with_advisory_lock/blob/master/CHANGELOG.md
164
+ post_install_message:
145
165
  rdoc_options: []
146
166
  require_paths:
147
167
  - lib
@@ -156,8 +176,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
176
  - !ruby/object:Gem::Version
157
177
  version: '0'
158
178
  requirements: []
159
- rubygems_version: 3.4.12
160
- signing_key:
179
+ rubygems_version: 3.4.10
180
+ signing_key:
161
181
  specification_version: 4
162
182
  summary: Advisory locking for ActiveRecord
163
183
  test_files: