ekylibre-plugin_system 0.5.1 → 0.6.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/ekylibre-plugin_system.gemspec +1 -1
- data/lib/ekylibre/plugin_system/middleware/sidekiq_middleware.rb +4 -4
- data/lib/ekylibre/plugin_system/middleware/sidekiq_middleware/client_middleware.rb +1 -10
- data/lib/ekylibre/plugin_system/mixin/test_case_mixin.rb +30 -0
- data/lib/ekylibre/plugin_system/rails/railtie.rb +1 -1
- data/lib/ekylibre/plugin_system/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f489278c56ee14505f74b3670446f8bcee9615593883ec4f6c5d093b78dde4fd
|
4
|
+
data.tar.gz: 296cbdf74855727bd85dcc2675d1554e46609c256025814c00bc808028e73560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bdada763a72c4cd932a3d6acd922bffc362c5bf49a42c6ec3f5d41b6ba7f04b9d76cae562b9f3a291c914a202e5d0918c293cb7d64ac576d3b9c8caf1e3ad44
|
7
|
+
data.tar.gz: 5e4665ba7af9d0b922c65194efb41b5e7b5b537767705b9bd74b95cefc8d5f74a0ca386784b05ff82be76aff638327dbc780036cf5b4dbe86a0e2a6c85ba03f2
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.add_dependency 'corindon', '~> 0.
|
22
|
+
spec.add_dependency 'corindon', '~> 0.8.0'
|
23
23
|
spec.add_dependency 'railties', '> 4'
|
24
24
|
spec.add_dependency 'request_store', '~> 1.5.0'
|
25
25
|
spec.add_dependency 'zeitwerk', '~> 2.4'
|
@@ -14,11 +14,11 @@ module Ekylibre
|
|
14
14
|
#
|
15
15
|
def setup(container:)
|
16
16
|
::Sidekiq.configure_client do |config|
|
17
|
-
configure_client(config
|
17
|
+
configure_client(config)
|
18
18
|
end
|
19
19
|
|
20
20
|
::Sidekiq.configure_server do |config|
|
21
|
-
configure_client(config
|
21
|
+
configure_client(config)
|
22
22
|
|
23
23
|
configure_server(config, container: container)
|
24
24
|
end
|
@@ -26,9 +26,9 @@ module Ekylibre
|
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
|
-
def configure_client(config
|
29
|
+
def configure_client(config)
|
30
30
|
config.client_middleware do |chain|
|
31
|
-
chain.add ClientMiddleware
|
31
|
+
chain.add ClientMiddleware
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -7,20 +7,11 @@ module Ekylibre
|
|
7
7
|
# so that all other middlewares can access it for configuring newly enqueued jobs.
|
8
8
|
module SidekiqMiddleware
|
9
9
|
class ClientMiddleware
|
10
|
-
def initialize(container)
|
11
|
-
@container = container
|
12
|
-
end
|
13
|
-
|
14
10
|
def call(worker_class, item, queue, redis_pool = nil)
|
15
|
-
item['container'] =
|
11
|
+
item['container'] = GlobalContainer.get
|
16
12
|
|
17
13
|
yield
|
18
14
|
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
# @return [Corindon::DependencyInjection::Container]
|
23
|
-
attr_reader :container
|
24
15
|
end
|
25
16
|
end
|
26
17
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Ekylibre
|
4
|
+
module PluginSystem
|
5
|
+
module Mixin
|
6
|
+
module TestCaseMixin
|
7
|
+
def before_setup
|
8
|
+
container = Ekylibre::Application.instance.system.container
|
9
|
+
|
10
|
+
RequestStore.clear!
|
11
|
+
|
12
|
+
Ekylibre::PluginSystem::GlobalContainer.set(container.dup)
|
13
|
+
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
17
|
+
def after_teardown
|
18
|
+
super
|
19
|
+
ensure
|
20
|
+
Ekylibre::PluginSystem::GlobalContainer.unset
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [Corindon::DependencyInjection::Container]
|
24
|
+
def container
|
25
|
+
Ekylibre::PluginSystem::GlobalContainer.get
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -10,7 +10,7 @@ module Ekylibre
|
|
10
10
|
initializer(:register_application) do |app|
|
11
11
|
container = app.system.container
|
12
12
|
|
13
|
-
container.set_parameter(Ekylibre::PluginSystem::Parameters::RAILS_APPLICATION
|
13
|
+
container.set_parameter(Ekylibre::PluginSystem::Parameters::RAILS_APPLICATION, app)
|
14
14
|
end
|
15
15
|
|
16
16
|
initializer(:register_middleware, after: :engines_blank_point) do |app|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ekylibre-plugin_system
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ekylibre developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: corindon
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.8.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.8.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: railties
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- lib/ekylibre/plugin_system/middleware/sidekiq_middleware.rb
|
153
153
|
- lib/ekylibre/plugin_system/middleware/sidekiq_middleware/client_middleware.rb
|
154
154
|
- lib/ekylibre/plugin_system/middleware/sidekiq_middleware/server_middleware.rb
|
155
|
+
- lib/ekylibre/plugin_system/mixin/test_case_mixin.rb
|
155
156
|
- lib/ekylibre/plugin_system/parameters.rb
|
156
157
|
- lib/ekylibre/plugin_system/plugin.rb
|
157
158
|
- lib/ekylibre/plugin_system/plugin_registration.rb
|