action_subscriber 5.3.3 → 5.4.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 +4 -4
- data/.circleci/config.yml +72 -45
- data/action_subscriber.gemspec +7 -5
- data/changelog.md +5 -0
- data/lib/action_subscriber/configuration.rb +1 -1
- data/lib/action_subscriber/middleware/active_record/connection_management.rb +1 -1
- data/lib/action_subscriber/version.rb +1 -1
- data/spec/lib/action_subscriber/middleware/active_record/connection_management_spec.rb +1 -1
- metadata +17 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e0320917740c25ae4645497b201a6c57cc16b8040429be92edf556b3880fcd2
|
|
4
|
+
data.tar.gz: dc7d6241b0c664050544d0c9b6ec9dc38081b810508e4ec3a4dedd2a54d7de4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e39959171d84f2495fe710bfd3cdc26fd98089b43d79a1e29849e2ad9207ba2459adfb60c3af0c49e798d3d358469f4c0f30db3fa3cbc09230366e0dcb0a1b1
|
|
7
|
+
data.tar.gz: e257a4fa0c0e433e32c15fa97a6149f80a4a193ca44b34890394620eb42715faddef3e73f5d1c558e00dd1d2436d18214d443ba7770b5f049b3462404d4b7d95
|
data/.circleci/config.yml
CHANGED
|
@@ -1,63 +1,90 @@
|
|
|
1
|
-
# Inspired by: http://mikebian.co/running-tests-against-multiple-ruby-versions-using-circleci/
|
|
2
|
-
|
|
3
1
|
version: 2.1
|
|
4
2
|
|
|
5
|
-
orbs:
|
|
6
|
-
ruby: circleci/ruby@1.1
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# If you want to work on `action_subscriber` you will need to have a rabbitmq instance running locally on port 5672 with a management plugin enabled on port 15672. Usually the easiest way to accomplish this is to use docker and run the command:
|
|
10
|
-
|
|
11
|
-
# ```
|
|
12
|
-
|
|
13
3
|
jobs:
|
|
14
|
-
|
|
15
|
-
parallelism: 1
|
|
4
|
+
build_and_test:
|
|
16
5
|
parameters:
|
|
17
|
-
|
|
6
|
+
docker_image:
|
|
18
7
|
type: string
|
|
8
|
+
description: "The Ruby or JRuby Docker image to test against"
|
|
9
|
+
|
|
19
10
|
docker:
|
|
20
|
-
|
|
21
|
-
- image:
|
|
11
|
+
# 1. The Primary Container (where your code actually runs)
|
|
12
|
+
- image: << parameters.docker_image >>
|
|
13
|
+
environment:
|
|
14
|
+
JRUBY_OPTS: "-J-Xmx1024m"
|
|
15
|
+
RAILS_ENV: test
|
|
16
|
+
# Tell your app where to find RabbitMQ (if your app uses this ENV var)
|
|
17
|
+
RABBITMQ_URL: "amqp://guest:guest@localhost:5672"
|
|
18
|
+
|
|
19
|
+
# 2. The Service Container (runs in the background)
|
|
20
|
+
- image: rabbitmq:3.12-management
|
|
21
|
+
# If you need the management UI for debugging, use `rabbitmq:3-management` instead
|
|
22
|
+
# environment:
|
|
23
|
+
# RABBITMQ_DEFAULT_USER: guest
|
|
24
|
+
# RABBITMQ_DEFAULT_PASS: guest
|
|
25
|
+
|
|
26
|
+
working_directory: ~/project
|
|
22
27
|
|
|
23
28
|
steps:
|
|
24
|
-
- checkout
|
|
25
|
-
- run:
|
|
26
|
-
name: install dockerize
|
|
27
|
-
command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
|
|
28
|
-
environment:
|
|
29
|
-
DOCKERIZE_VERSION: v0.3.0
|
|
30
|
-
# - run:
|
|
31
|
-
# name: Wait for rabbitmq
|
|
32
|
-
# command: dockerize -wait tcp://localhost:5672 -timeout 1m
|
|
33
29
|
- run:
|
|
34
|
-
name: Install
|
|
35
|
-
command:
|
|
30
|
+
name: Install System Dependencies
|
|
31
|
+
command: |
|
|
32
|
+
if [ "$(id -u)" = "0" ]; then
|
|
33
|
+
apt-get update && apt-get install -y build-essential git
|
|
34
|
+
else
|
|
35
|
+
sudo apt-get update && sudo apt-get install -y build-essential git
|
|
36
|
+
fi
|
|
37
|
+
- checkout
|
|
38
|
+
# Note: We added the docker_image parameter to the cache key
|
|
39
|
+
# so MRI and JRuby gems don't conflict.
|
|
40
|
+
- restore_cache:
|
|
41
|
+
keys:
|
|
42
|
+
- v1-gems-<< parameters.docker_image >>-{{ checksum "Gemfile.lock" }}
|
|
43
|
+
- v1-gems-<< parameters.docker_image >>-
|
|
44
|
+
|
|
36
45
|
- run:
|
|
37
|
-
name:
|
|
38
|
-
command:
|
|
46
|
+
name: Install Ruby Dependencies
|
|
47
|
+
command: |
|
|
48
|
+
gem install bundler
|
|
49
|
+
bundle config set --local path 'vendor/bundle'
|
|
50
|
+
bundle install --jobs=4 --retry=3
|
|
51
|
+
|
|
52
|
+
- save_cache:
|
|
53
|
+
paths:
|
|
54
|
+
- ./vendor/bundle
|
|
55
|
+
key: v1-gems-<< parameters.docker_image >>-{{ checksum "Gemfile.lock" }}
|
|
56
|
+
|
|
57
|
+
# Wait for RabbitMQ to be ready before running tests.
|
|
58
|
+
# Service containers can sometimes take a few seconds to boot up.
|
|
39
59
|
- run:
|
|
40
|
-
name:
|
|
41
|
-
command:
|
|
60
|
+
name: Wait for RabbitMQ
|
|
61
|
+
command: |
|
|
62
|
+
if [ "$(id -u)" = "0" ]; then
|
|
63
|
+
apt-get install -y netcat-openbsd
|
|
64
|
+
else
|
|
65
|
+
sudo apt-get install -y netcat-openbsd
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
echo "Waiting for RabbitMQ to start..."
|
|
69
|
+
while ! nc -z localhost 5672; do
|
|
70
|
+
sleep 1
|
|
71
|
+
done
|
|
72
|
+
echo "RabbitMQ is ready!"
|
|
73
|
+
|
|
42
74
|
- run:
|
|
43
|
-
name:
|
|
75
|
+
name: Run Tests
|
|
44
76
|
command: bundle exec rspec
|
|
45
77
|
|
|
46
|
-
# strangely, there seems to be very little documentation about exactly how martix builds work.
|
|
47
|
-
# By defining a param inside your job definition, Circle CI will automatically spawn a job for
|
|
48
|
-
# unique param value passed via `matrix`. Neat!
|
|
49
|
-
# https://circleci.com/blog/circleci-matrix-jobs/
|
|
50
78
|
workflows:
|
|
51
|
-
|
|
79
|
+
version: 2
|
|
80
|
+
ruby_compatibility_matrix:
|
|
52
81
|
jobs:
|
|
53
|
-
-
|
|
82
|
+
- build_and_test:
|
|
83
|
+
name: test-<< matrix.docker_image >>
|
|
54
84
|
matrix:
|
|
55
85
|
parameters:
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- circleci/jruby:9.2
|
|
62
|
-
- circleci/jruby:9.3
|
|
63
|
-
- circleci/jruby:9.4
|
|
86
|
+
docker_image:
|
|
87
|
+
- "cimg/ruby:3.1"
|
|
88
|
+
- "cimg/ruby:3.4"
|
|
89
|
+
- "jruby:9.4"
|
|
90
|
+
- "jruby:10.0"
|
data/action_subscriber.gemspec
CHANGED
|
@@ -18,7 +18,9 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
19
|
spec.require_paths = ["lib"]
|
|
20
20
|
|
|
21
|
-
spec.
|
|
21
|
+
spec.required_ruby_version = '>= 3.1.0'
|
|
22
|
+
|
|
23
|
+
spec.add_dependency "activesupport", ">= 6.0"
|
|
22
24
|
|
|
23
25
|
if ENV["PLATFORM"] == "java" || ::RUBY_PLATFORM == "java"
|
|
24
26
|
spec.platform = "java"
|
|
@@ -30,11 +32,11 @@ Gem::Specification.new do |spec|
|
|
|
30
32
|
spec.add_dependency "middleware"
|
|
31
33
|
spec.add_dependency "thor"
|
|
32
34
|
|
|
33
|
-
spec.add_development_dependency "active_publisher", "
|
|
34
|
-
spec.add_development_dependency "activerecord", ">=
|
|
35
|
-
spec.add_development_dependency "bundler"
|
|
35
|
+
spec.add_development_dependency "active_publisher", "1.6.0.pre1"
|
|
36
|
+
spec.add_development_dependency "activerecord", ">= 6.0"
|
|
37
|
+
spec.add_development_dependency "bundler"
|
|
36
38
|
spec.add_development_dependency "pry-nav"
|
|
37
|
-
spec.add_development_dependency "rabbitmq_http_api_client", "~> 1.
|
|
39
|
+
spec.add_development_dependency "rabbitmq_http_api_client", "~> 1.15.0"
|
|
38
40
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
39
41
|
spec.add_development_dependency "rake"
|
|
40
42
|
spec.add_development_dependency "simplecov"
|
data/changelog.md
ADDED
|
@@ -67,7 +67,7 @@ module ActionSubscriber
|
|
|
67
67
|
|
|
68
68
|
yaml_config = {}
|
|
69
69
|
absolute_config_path = ::File.expand_path(::File.join("config", "action_subscriber.yml"))
|
|
70
|
-
if ::File.
|
|
70
|
+
if ::File.exist?(absolute_config_path)
|
|
71
71
|
erb_yaml = ::ERB.new(::File.read(absolute_config_path)).result
|
|
72
72
|
# Defined in Psych 3.2+ and the new canonical way to load trusted documents:
|
|
73
73
|
# https://github.com/ruby/psych/issues/533#issuecomment-1019363688
|
|
@@ -16,7 +16,7 @@ module ActionSubscriber
|
|
|
16
16
|
:execution_interval => ::ActionSubscriber.config.connection_reaping_interval,
|
|
17
17
|
:timeout_interval => ::ActionSubscriber.config.connection_reaping_timeout_interval) do
|
|
18
18
|
|
|
19
|
-
::ActiveRecord::Base.clear_active_connections!
|
|
19
|
+
::ActiveRecord::Base.connection_handler.clear_active_connections!
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
timed_task.execute
|
|
@@ -6,7 +6,7 @@ describe ActionSubscriber::Middleware::ActiveRecord::ConnectionManagement do
|
|
|
6
6
|
before {
|
|
7
7
|
pool = double("pool")
|
|
8
8
|
allow(pool).to receive(:with_connection).and_yield
|
|
9
|
-
allow(ActiveRecord::Base).to receive(:clear_active_connections!)
|
|
9
|
+
allow(ActiveRecord::Base.connection_handler).to receive(:clear_active_connections!)
|
|
10
10
|
allow(ActiveRecord::Base).to receive(:connection_pool).and_return(pool)
|
|
11
11
|
}
|
|
12
12
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: action_subscriber
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian Stien
|
|
@@ -9,10 +9,9 @@ authors:
|
|
|
9
9
|
- Brandon Dewitt
|
|
10
10
|
- Devin Christensen
|
|
11
11
|
- Michael Ries
|
|
12
|
-
autorequire:
|
|
13
12
|
bindir: bin
|
|
14
13
|
cert_chain: []
|
|
15
|
-
date:
|
|
14
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
16
15
|
dependencies:
|
|
17
16
|
- !ruby/object:Gem::Dependency
|
|
18
17
|
name: activesupport
|
|
@@ -20,14 +19,14 @@ dependencies:
|
|
|
20
19
|
requirements:
|
|
21
20
|
- - ">="
|
|
22
21
|
- !ruby/object:Gem::Version
|
|
23
|
-
version: '
|
|
22
|
+
version: '6.0'
|
|
24
23
|
type: :runtime
|
|
25
24
|
prerelease: false
|
|
26
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
27
26
|
requirements:
|
|
28
27
|
- - ">="
|
|
29
28
|
- !ruby/object:Gem::Version
|
|
30
|
-
version: '
|
|
29
|
+
version: '6.0'
|
|
31
30
|
- !ruby/object:Gem::Dependency
|
|
32
31
|
name: bunny
|
|
33
32
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -88,44 +87,44 @@ dependencies:
|
|
|
88
87
|
name: active_publisher
|
|
89
88
|
requirement: !ruby/object:Gem::Requirement
|
|
90
89
|
requirements:
|
|
91
|
-
- -
|
|
90
|
+
- - '='
|
|
92
91
|
- !ruby/object:Gem::Version
|
|
93
|
-
version: 0.
|
|
92
|
+
version: 1.6.0.pre1
|
|
94
93
|
type: :development
|
|
95
94
|
prerelease: false
|
|
96
95
|
version_requirements: !ruby/object:Gem::Requirement
|
|
97
96
|
requirements:
|
|
98
|
-
- -
|
|
97
|
+
- - '='
|
|
99
98
|
- !ruby/object:Gem::Version
|
|
100
|
-
version: 0.
|
|
99
|
+
version: 1.6.0.pre1
|
|
101
100
|
- !ruby/object:Gem::Dependency
|
|
102
101
|
name: activerecord
|
|
103
102
|
requirement: !ruby/object:Gem::Requirement
|
|
104
103
|
requirements:
|
|
105
104
|
- - ">="
|
|
106
105
|
- !ruby/object:Gem::Version
|
|
107
|
-
version: '
|
|
106
|
+
version: '6.0'
|
|
108
107
|
type: :development
|
|
109
108
|
prerelease: false
|
|
110
109
|
version_requirements: !ruby/object:Gem::Requirement
|
|
111
110
|
requirements:
|
|
112
111
|
- - ">="
|
|
113
112
|
- !ruby/object:Gem::Version
|
|
114
|
-
version: '
|
|
113
|
+
version: '6.0'
|
|
115
114
|
- !ruby/object:Gem::Dependency
|
|
116
115
|
name: bundler
|
|
117
116
|
requirement: !ruby/object:Gem::Requirement
|
|
118
117
|
requirements:
|
|
119
118
|
- - ">="
|
|
120
119
|
- !ruby/object:Gem::Version
|
|
121
|
-
version: '
|
|
120
|
+
version: '0'
|
|
122
121
|
type: :development
|
|
123
122
|
prerelease: false
|
|
124
123
|
version_requirements: !ruby/object:Gem::Requirement
|
|
125
124
|
requirements:
|
|
126
125
|
- - ">="
|
|
127
126
|
- !ruby/object:Gem::Version
|
|
128
|
-
version: '
|
|
127
|
+
version: '0'
|
|
129
128
|
- !ruby/object:Gem::Dependency
|
|
130
129
|
name: pry-nav
|
|
131
130
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -146,14 +145,14 @@ dependencies:
|
|
|
146
145
|
requirements:
|
|
147
146
|
- - "~>"
|
|
148
147
|
- !ruby/object:Gem::Version
|
|
149
|
-
version: 1.
|
|
148
|
+
version: 1.15.0
|
|
150
149
|
type: :development
|
|
151
150
|
prerelease: false
|
|
152
151
|
version_requirements: !ruby/object:Gem::Requirement
|
|
153
152
|
requirements:
|
|
154
153
|
- - "~>"
|
|
155
154
|
- !ruby/object:Gem::Version
|
|
156
|
-
version: 1.
|
|
155
|
+
version: 1.15.0
|
|
157
156
|
- !ruby/object:Gem::Dependency
|
|
158
157
|
name: rspec
|
|
159
158
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -220,6 +219,7 @@ files:
|
|
|
220
219
|
- Rakefile
|
|
221
220
|
- action_subscriber.gemspec
|
|
222
221
|
- bin/action_subscriber
|
|
222
|
+
- changelog.md
|
|
223
223
|
- examples/at_least_once.rb
|
|
224
224
|
- examples/at_most_once.rb
|
|
225
225
|
- examples/basic_subscriber.rb
|
|
@@ -285,7 +285,6 @@ homepage: https://github.com/mxenabled/action_subscriber
|
|
|
285
285
|
licenses:
|
|
286
286
|
- MIT
|
|
287
287
|
metadata: {}
|
|
288
|
-
post_install_message:
|
|
289
288
|
rdoc_options: []
|
|
290
289
|
require_paths:
|
|
291
290
|
- lib
|
|
@@ -293,15 +292,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
293
292
|
requirements:
|
|
294
293
|
- - ">="
|
|
295
294
|
- !ruby/object:Gem::Version
|
|
296
|
-
version:
|
|
295
|
+
version: 3.1.0
|
|
297
296
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
297
|
requirements:
|
|
299
298
|
- - ">="
|
|
300
299
|
- !ruby/object:Gem::Version
|
|
301
300
|
version: '0'
|
|
302
301
|
requirements: []
|
|
303
|
-
rubygems_version:
|
|
304
|
-
signing_key:
|
|
302
|
+
rubygems_version: 4.0.10
|
|
305
303
|
specification_version: 4
|
|
306
304
|
summary: ActionSubscriber is a DSL that allows a rails app to consume messages from
|
|
307
305
|
a RabbitMQ broker.
|