message_bus 4.3.8 → 4.3.9

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: 8919c0fad186b16833bee6f60c2cbab838be989395dbb63d5ea83ea25770a817
4
- data.tar.gz: 12223e8d6cb7c4ef043ea4bfed14e0993a0d826380c4a3f5d8faed4fa55bfc1a
3
+ metadata.gz: 258a314e3749265bd7fbaa9fadcaba10a3e4fdb46d204787ccc96effecdcbc7c
4
+ data.tar.gz: b14add0ef9b398c2adf721adb725d7dbeb2719066f694e753fde7073a06da502
5
5
  SHA512:
6
- metadata.gz: ecc907090650eb544f36dee2f1ffac2e5e27408ff570d91d104ba118f20c03d9815dc441e08929128d60bb54640e929ea1ca0123bf9790f9caf562e6860441ee
7
- data.tar.gz: a899cf220f0838916462e97146d50c0a297237c0f0569abf92da8d401a02f5a303ef769cb3318e33c4ffcef99092b01845bb6070c9b4282eb8c0cd08de37091e
6
+ metadata.gz: ebc4a907f665282f748fef892398b203b71888c98800350d7061ee870d7848a8a3f1034d501ccb162c5d099dee9edbc411a950921ce063ccac7a7ac58e60e995
7
+ data.tar.gz: 9b454a1f78c88351865bb277c2831b4f9772113ad865793f7d05ef531816600f828a4cc18f461a969db002038a30b5ae2d472bdd4128b7a0ccf8d2bfab6e6067
@@ -7,7 +7,34 @@ on:
7
7
  pull_request:
8
8
 
9
9
  jobs:
10
- build:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ timeout-minutes: 5
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: "3.3"
20
+ bundler-cache: true
21
+
22
+ - name: Set up Node.js
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: 20
26
+ cache: npm
27
+
28
+ - name: Setup npm
29
+ run: npm install
30
+
31
+ - name: Rubocop
32
+ run: bundle exec rubocop
33
+
34
+ - name: ESLint
35
+ run: npx eslint .
36
+
37
+ test:
11
38
  runs-on: ubuntu-latest
12
39
  name: Ruby ${{ matrix.ruby }} (redis ${{ matrix.redis }})
13
40
  timeout-minutes: 10
@@ -20,12 +47,12 @@ jobs:
20
47
  strategy:
21
48
  fail-fast: false
22
49
  matrix:
23
- ruby: [2.6, 2.7, '3.0', 3.1]
50
+ ruby: ["2.6", "2.7", "3.0", "3.1"]
24
51
  redis: [5, 6]
25
52
 
26
53
  services:
27
54
  postgres:
28
- image: postgres:14
55
+ image: postgres:16
29
56
  env:
30
57
  POSTGRES_DB: message_bus_test
31
58
  POSTGRES_PASSWORD: postgres
@@ -43,41 +70,28 @@ jobs:
43
70
  --health-retries 5
44
71
 
45
72
  steps:
46
- - uses: actions/checkout@v3
73
+ - uses: actions/checkout@v4
47
74
 
48
75
  - uses: ruby/setup-ruby@v1
49
76
  with:
50
77
  ruby-version: ${{ matrix.ruby }}
51
78
  bundler-cache: true
52
79
 
53
- - name: Set up Node.js
54
- uses: actions/setup-node@v3
55
- with:
56
- node-version: 18
57
- cache: npm
58
-
59
- - name: Setup npm
60
- run: npm install
61
-
62
80
  - name: Tests
63
81
  env:
64
82
  TESTOPTS: --verbose
65
83
  run: bundle exec rake
66
- timeout-minutes: 3
67
-
68
- - name: Linting
69
- run: npx eslint .
70
84
 
71
85
  publish:
72
86
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
73
- needs: build
87
+ needs: [lint, test]
74
88
  runs-on: ubuntu-latest
75
89
 
76
90
  steps:
77
- - uses: actions/checkout@v3
91
+ - uses: actions/checkout@v4
78
92
 
79
93
  - name: Release gem
80
- uses: discourse/publish-rubygems-action@v2
94
+ uses: discourse/publish-rubygems-action@v3
81
95
  id: publish-gem
82
96
  env:
83
97
  RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
@@ -95,7 +109,7 @@ jobs:
95
109
  git commit -m 'bump'
96
110
 
97
111
  - name: Publish package
98
- uses: JS-DevTools/npm-publish@v1
112
+ uses: JS-DevTools/npm-publish@v3
99
113
  if: steps.publish-gem.outputs.new_version == 'true'
100
114
  with:
101
115
  token: ${{ secrets.NPM_TOKEN }}
data/.rubocop.yml CHANGED
@@ -1,11 +1,15 @@
1
1
  inherit_gem:
2
- rubocop-discourse: .rubocop.yml
2
+ rubocop-discourse: stree-compat.yml
3
3
  inherit_mode:
4
4
  merge:
5
5
  - Exclude
6
+
6
7
  AllCops:
7
8
  Exclude:
8
- - 'examples/**/*'
9
+ - "examples/**/*"
10
+
11
+ Discourse/Plugins:
12
+ Enabled: false
9
13
 
10
14
  RSpec:
11
15
  Enabled: false
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 18-02-2025
2
+
3
+ - Version 4.3.9
4
+
5
+ - Prevent deprecation warning when using Rails 7.1
6
+
1
7
  14-09-2023
2
8
 
3
9
  - Version 4.3.8
@@ -42,13 +48,13 @@
42
48
 
43
49
  06-01-2023
44
50
 
45
- - Version 4.2.1
51
+ - Version 4.3.1
46
52
 
47
53
  - FIX: Ensure non-long-polling requests are always spaced out
48
54
 
49
55
  04-11-2022
50
56
 
51
- - Version 4.2.0
57
+ - Version 4.3.0
52
58
 
53
59
  - FIX: Add redis gem version 5 support
54
60
  - FEATURE: Allow disabling subscriptions without disabling publication
data/Rakefile CHANGED
@@ -4,12 +4,10 @@ require 'rake/testtask'
4
4
  require 'bundler'
5
5
  require 'bundler/gem_tasks'
6
6
  require 'bundler/setup'
7
- require 'rubocop/rake_task'
8
7
  require 'yard'
9
8
 
10
9
  Bundler.require(:default, :test)
11
10
 
12
- RuboCop::RakeTask.new
13
11
  YARD::Rake::YardocTask.new
14
12
 
15
13
  BACKENDS = Dir["lib/message_bus/backends/*.rb"].map { |file| file.match(%r{backends/(?<backend>.*).rb})[:backend] } - ["base"]
@@ -99,5 +97,5 @@ task :performance do
99
97
  end
100
98
  end
101
99
 
102
- desc "Run all tests, link checks and confirms documentation compiles without error"
103
- task default: [:spec, :rubocop, :test_doc]
100
+ desc "Run all tests and confirm the documentation compiles without error"
101
+ task default: [:spec, :test_doc]
@@ -48,7 +48,6 @@ module MessageBus
48
48
  #
49
49
  # @abstract
50
50
  class Base
51
- # rubocop:disable Lint/UnusedMethodArgument
52
51
 
53
52
  # Raised to indicate that the concrete backend implementation does not implement part of the API
54
53
  ConcreteClassMustImplementError = Class.new(StandardError)
@@ -406,7 +406,7 @@ module MessageBus
406
406
  on.message do |_c, m|
407
407
  if m == UNSUB_MESSAGE
408
408
  @subscribed = false
409
- return
409
+ return # rubocop:disable Lint/NonLocalExitFromIterator
410
410
  end
411
411
  m = MessageBus::Message.decode m
412
412
 
@@ -300,7 +300,7 @@ LUA
300
300
  if m == UNSUB_MESSAGE
301
301
  @subscribed = false
302
302
  global_redis.unsubscribe
303
- return
303
+ return # rubocop:disable Lint/NonLocalExitFromIterator
304
304
  end
305
305
  m = MessageBus::Message.decode m
306
306
 
@@ -200,7 +200,11 @@ class MessageBus::Rack::Middleware
200
200
  # this means connections are not returned until rack.async is
201
201
  # closed
202
202
  if defined? ActiveRecord::Base.connection_handler
203
- ActiveRecord::Base.connection_handler.clear_active_connections!
203
+ if Gem::Version.new(Rails.version) >= "7.1"
204
+ ActiveRecord::Base.connection_handler.clear_active_connections!(:all)
205
+ else
206
+ ActiveRecord::Base.connection_handler.clear_active_connections!
207
+ end
204
208
  elsif defined? ActiveRecord::Base.clear_active_connections!
205
209
  ActiveRecord::Base.clear_active_connections!
206
210
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MessageBus
4
- VERSION = "4.3.8"
4
+ VERSION = "4.3.9"
5
5
  end
data/lib/message_bus.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "monitor"
4
- require "set"
5
4
 
6
5
  require_relative "message_bus/version"
7
6
  require_relative "message_bus/message"
@@ -772,7 +771,7 @@ module MessageBus::Implementation
772
771
  globals, locals, local_globals, global_globals = nil
773
772
 
774
773
  @mutex.synchronize do
775
- return if @destroyed
774
+ return if @destroyed # rubocop:disable Lint/NonLocalExitFromIterator
776
775
  next unless @subscriptions
777
776
 
778
777
  globals = @subscriptions[nil]
data/message_bus.gemspec CHANGED
@@ -35,6 +35,8 @@ Gem::Specification.new do |gem|
35
35
  gem.add_development_dependency 'byebug'
36
36
  gem.add_development_dependency 'oj'
37
37
  gem.add_development_dependency 'yard'
38
- gem.add_development_dependency 'rubocop-discourse'
39
- gem.add_development_dependency 'rubocop-rspec'
38
+
39
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
40
+ gem.add_development_dependency 'rubocop-discourse', '3.8.1'
41
+ end
40
42
  end