action_subscriber 5.2.3-java → 5.3.1.pre-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +61 -0
- data/action_subscriber.gemspec +10 -9
- data/lib/action_subscriber/babou.rb +4 -1
- data/lib/action_subscriber/configuration.rb +3 -5
- data/lib/action_subscriber/version.rb +1 -1
- data/lib/action_subscriber.rb +12 -0
- metadata +24 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f05428bb77b503d9f6e17bcee140832d1e7ca4cab0aa5e503410689415bd1b64
|
4
|
+
data.tar.gz: a483aea4897bcbde90a8040e1f7f1a9928791dc9ee74d2e1099ab3a6c1001e24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e4f1104ea659038dc1a2dbfdbec86af4f92b240ae46480979c43b9edbdfd072315ca7195fdf656e622656323e84fbe8e561e788e4cad7d09572078dc04688b9
|
7
|
+
data.tar.gz: 30c99d861320c2790573f48bd80a49f07342b00f4968fe576c417526287adcc8e3465cee6d3b5d9633743f44f92fe474c623b117cf540fc8d2ac818c67922b00
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Inspired by: http://mikebian.co/running-tests-against-multiple-ruby-versions-using-circleci/
|
2
|
+
|
3
|
+
version: 2.1
|
4
|
+
|
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
|
+
jobs:
|
14
|
+
test:
|
15
|
+
parallelism: 1
|
16
|
+
parameters:
|
17
|
+
ruby-image:
|
18
|
+
type: string
|
19
|
+
docker:
|
20
|
+
- image: << parameters.ruby-image >>
|
21
|
+
- image: rabbitmq:3.6.6-management
|
22
|
+
|
23
|
+
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
|
+
- run:
|
34
|
+
name: Install bundler
|
35
|
+
command: gem install bundler
|
36
|
+
- run:
|
37
|
+
name: Which bundler?
|
38
|
+
command: bundle -v
|
39
|
+
- run:
|
40
|
+
name: bundle install
|
41
|
+
command: bundle install
|
42
|
+
- run:
|
43
|
+
name: rspec
|
44
|
+
command: bundle exec rspec
|
45
|
+
|
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
|
+
workflows:
|
51
|
+
build_and_test:
|
52
|
+
jobs:
|
53
|
+
- test:
|
54
|
+
matrix:
|
55
|
+
parameters:
|
56
|
+
ruby-image:
|
57
|
+
- circleci/ruby:2.5
|
58
|
+
- circleci/ruby:2.6
|
59
|
+
- circleci/ruby:2.7
|
60
|
+
- circleci/jruby:9.2
|
61
|
+
- circleci/jruby:9.3
|
data/action_subscriber.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "action_subscriber/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "action_subscriber"
|
@@ -18,17 +18,18 @@ 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.add_dependency
|
21
|
+
spec.add_dependency "activesupport", ">= 3.2"
|
22
22
|
|
23
|
-
if ENV[
|
23
|
+
if ENV["PLATFORM"] == "java" || ::RUBY_PLATFORM == "java"
|
24
24
|
spec.platform = "java"
|
25
|
-
spec.add_dependency
|
25
|
+
spec.add_dependency "march_hare", "~> 4.4"
|
26
26
|
else
|
27
|
-
spec.add_dependency
|
27
|
+
spec.add_dependency "bunny", ">= 1.5.0"
|
28
28
|
end
|
29
|
-
spec.add_dependency
|
30
|
-
spec.add_dependency
|
31
|
-
spec.add_dependency
|
29
|
+
spec.add_dependency "concurrent-ruby"
|
30
|
+
spec.add_dependency "middleware"
|
31
|
+
spec.add_dependency "psych", ">= 3.3.2"
|
32
|
+
spec.add_dependency "thor"
|
32
33
|
|
33
34
|
spec.add_development_dependency "active_publisher", "~> 0.1.5"
|
34
35
|
spec.add_development_dependency "activerecord", ">= 3.2"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "active_support/notifications"
|
2
|
+
|
1
3
|
module ActionSubscriber
|
2
4
|
module Babou
|
3
5
|
##
|
@@ -10,7 +12,7 @@ module ActionSubscriber
|
|
10
12
|
::ActionSubscriber.print_subscriptions
|
11
13
|
::ActionSubscriber.start_subscribers!
|
12
14
|
logger.info "Action Subscriber connected"
|
13
|
-
|
15
|
+
::ActiveSupport::Notifications.instrument("action_subscriber:server_started")
|
14
16
|
while true
|
15
17
|
sleep 1.0 #just hang around waiting for messages
|
16
18
|
break if shutting_down?
|
@@ -21,6 +23,7 @@ module ActionSubscriber
|
|
21
23
|
logger.info "Shutting down"
|
22
24
|
::ActionSubscriber::RabbitConnection.subscriber_disconnect!
|
23
25
|
logger.info "Shutdown complete"
|
26
|
+
::ActiveSupport::Notifications.instrument("action_subscriber:server_stopped")
|
24
27
|
exit(0)
|
25
28
|
end
|
26
29
|
|
@@ -69,11 +69,9 @@ module ActionSubscriber
|
|
69
69
|
absolute_config_path = ::File.expand_path(::File.join("config", "action_subscriber.yml"))
|
70
70
|
if ::File.exists?(absolute_config_path)
|
71
71
|
erb = ::ERB.new(::File.read(absolute_config_path)).result
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
yaml_config = ::YAML.load(erb)[env]
|
76
|
-
end
|
72
|
+
# Defined in Psych 3.2+ and the new canonical way to load trusted documents:
|
73
|
+
# https://github.com/ruby/psych/issues/533#issuecomment-1019363688
|
74
|
+
yaml_config = ::YAML.unsafe_load(erb)[env]
|
77
75
|
end
|
78
76
|
|
79
77
|
::ActionSubscriber::Configuration::DEFAULTS.each_pair do |key, value|
|
data/lib/action_subscriber.rb
CHANGED
@@ -87,6 +87,18 @@ module ActionSubscriber
|
|
87
87
|
route_set.wait_to_finish_with_timeout(timeout)
|
88
88
|
end
|
89
89
|
|
90
|
+
def self.after_server_start(&block)
|
91
|
+
::ActiveSupport::Notifications.subscribe("action_subscriber:server_started") do |*args|
|
92
|
+
block.call(*args)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.after_server_stop(&block)
|
97
|
+
::ActiveSupport::Notifications.subscribe("action_subscriber:server_stopped") do |*args|
|
98
|
+
block.call(*args)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
90
102
|
# Execution is delayed until after app loads when used with bin/action_subscriber
|
91
103
|
require "action_subscriber/railtie" if defined?(Rails)
|
92
104
|
::ActiveSupport.run_load_hooks(:action_subscriber, Base)
|
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.3.1.pre
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Brian Stien
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2022-04-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,17 +31,17 @@ dependencies:
|
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- - "
|
34
|
+
- - "~>"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
36
|
+
version: '4.4'
|
37
37
|
name: march_hare
|
38
38
|
prerelease: false
|
39
39
|
type: :runtime
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- - "
|
42
|
+
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
44
|
+
version: '4.4'
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
@@ -70,6 +70,20 @@ dependencies:
|
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
requirement: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 3.3.2
|
79
|
+
name: psych
|
80
|
+
prerelease: false
|
81
|
+
type: :runtime
|
82
|
+
version_requirements: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 3.3.2
|
73
87
|
- !ruby/object:Gem::Dependency
|
74
88
|
requirement: !ruby/object:Gem::Requirement
|
75
89
|
requirements:
|
@@ -209,6 +223,7 @@ executables:
|
|
209
223
|
extensions: []
|
210
224
|
extra_rdoc_files: []
|
211
225
|
files:
|
226
|
+
- ".circleci/config.yml"
|
212
227
|
- ".gitignore"
|
213
228
|
- ".rspec"
|
214
229
|
- ".travis.yml"
|
@@ -295,11 +310,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
295
310
|
version: '0'
|
296
311
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
297
312
|
requirements:
|
298
|
-
- - "
|
313
|
+
- - ">"
|
299
314
|
- !ruby/object:Gem::Version
|
300
|
-
version:
|
315
|
+
version: 1.3.1
|
301
316
|
requirements: []
|
302
|
-
rubygems_version: 3.
|
317
|
+
rubygems_version: 3.3.11
|
303
318
|
signing_key:
|
304
319
|
specification_version: 4
|
305
320
|
summary: ActionSubscriber is a DSL that allows a rails app to consume messages from
|