service_orchestrator 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +28 -22
- data/README.md +1 -1
- data/lib/service_orchestrator/container.rb +1 -1
- data/lib/service_orchestrator/service.rb +6 -2
- data/lib/service_orchestrator/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3c97c787f22f98d874162b9c1189c4d26ce68109739065c393afc035256d4f
|
4
|
+
data.tar.gz: 8e6641f68430162af12bc2c94e95b367ee7f54d2638f4bbcb6a0b07bfa1907e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37557e8ec0d226cb50adafba035b40e73038825adc085ed409cb0dcbe043d3032712f99801ba7e2458db095fe2010d0c8c7e2b583c861677e6d5361fd86de9c3
|
7
|
+
data.tar.gz: c6036c8c66d7075a08eba4ab26f66554a8cec73d9965ffd43b57ba5bb2fc860c58c25f398b2ecc0ec476c185733fea4531355dd6b7832e5d989dd310ca4446c2
|
data/Gemfile.lock
CHANGED
@@ -1,60 +1,66 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
service_orchestrator (0.
|
4
|
+
service_orchestrator (0.2.0)
|
5
5
|
activesupport
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (7.0.
|
10
|
+
activesupport (7.0.7)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 1.6, < 2)
|
13
13
|
minitest (>= 5.1)
|
14
14
|
tzinfo (~> 2.0)
|
15
15
|
ast (2.4.2)
|
16
|
-
|
16
|
+
base64 (0.1.1)
|
17
|
+
concurrent-ruby (1.2.2)
|
17
18
|
diff-lcs (1.5.0)
|
18
|
-
i18n (1.
|
19
|
+
i18n (1.14.1)
|
19
20
|
concurrent-ruby (~> 1.0)
|
20
21
|
json (2.6.3)
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
language_server-protocol (3.17.0.3)
|
23
|
+
minitest (5.19.0)
|
24
|
+
parallel (1.23.0)
|
25
|
+
parser (3.2.2.3)
|
24
26
|
ast (~> 2.4.1)
|
27
|
+
racc
|
28
|
+
racc (1.7.1)
|
25
29
|
rainbow (3.1.1)
|
26
30
|
rake (13.0.6)
|
27
|
-
regexp_parser (2.
|
28
|
-
rexml (3.2.
|
31
|
+
regexp_parser (2.8.1)
|
32
|
+
rexml (3.2.6)
|
29
33
|
rspec (3.12.0)
|
30
34
|
rspec-core (~> 3.12.0)
|
31
35
|
rspec-expectations (~> 3.12.0)
|
32
36
|
rspec-mocks (~> 3.12.0)
|
33
|
-
rspec-core (3.12.
|
37
|
+
rspec-core (3.12.2)
|
34
38
|
rspec-support (~> 3.12.0)
|
35
|
-
rspec-expectations (3.12.
|
39
|
+
rspec-expectations (3.12.3)
|
36
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
41
|
rspec-support (~> 3.12.0)
|
38
|
-
rspec-mocks (3.12.
|
42
|
+
rspec-mocks (3.12.6)
|
39
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
44
|
rspec-support (~> 3.12.0)
|
41
|
-
rspec-support (3.12.
|
42
|
-
rubocop (1.
|
45
|
+
rspec-support (3.12.1)
|
46
|
+
rubocop (1.56.0)
|
47
|
+
base64 (~> 0.1.1)
|
43
48
|
json (~> 2.3)
|
49
|
+
language_server-protocol (>= 3.17.0)
|
44
50
|
parallel (~> 1.10)
|
45
|
-
parser (>= 3.
|
51
|
+
parser (>= 3.2.2.3)
|
46
52
|
rainbow (>= 2.2.2, < 4.0)
|
47
53
|
regexp_parser (>= 1.8, < 3.0)
|
48
54
|
rexml (>= 3.2.5, < 4.0)
|
49
|
-
rubocop-ast (>= 1.
|
55
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
50
56
|
ruby-progressbar (~> 1.7)
|
51
|
-
unicode-display_width (>=
|
52
|
-
rubocop-ast (1.
|
53
|
-
parser (>= 3.
|
54
|
-
ruby-progressbar (1.
|
55
|
-
tzinfo (2.0.
|
57
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
58
|
+
rubocop-ast (1.29.0)
|
59
|
+
parser (>= 3.2.1.0)
|
60
|
+
ruby-progressbar (1.13.0)
|
61
|
+
tzinfo (2.0.6)
|
56
62
|
concurrent-ruby (~> 1.0)
|
57
|
-
unicode-display_width (2.
|
63
|
+
unicode-display_width (2.4.2)
|
58
64
|
|
59
65
|
PLATFORMS
|
60
66
|
x86_64-darwin-21
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ ServiceOrchestrator is a lightweight dependency injection framework, greatly ins
|
|
4
4
|
|
5
5
|
Compared to Morphine, it automatically wires dependencies between services thanks to some simple conventions.
|
6
6
|
|
7
|
-
If you wonder if you need this library, please check out [
|
7
|
+
If you wonder if you need this library, please check out [my article]() about Services in Rails.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -14,7 +14,7 @@ module ServiceOrchestrator
|
|
14
14
|
|
15
15
|
def self.register(name, class_name = nil, &block)
|
16
16
|
define_method name do |*args|
|
17
|
-
dependencies[name] ||= class_name ? service_class(class_name).wire(self) : instance_exec(*args, &block)
|
17
|
+
dependencies[name] ||= class_name ? service_class(class_name).wire(name, self) : instance_exec(*args, &block)
|
18
18
|
end
|
19
19
|
|
20
20
|
define_method "#{name}=" do |service|
|
@@ -7,6 +7,8 @@ module ServiceOrchestrator
|
|
7
7
|
class Service
|
8
8
|
class_attribute :registered_deps
|
9
9
|
|
10
|
+
attr_reader :service_name
|
11
|
+
|
10
12
|
def self.dependencies(*names)
|
11
13
|
names.each do |name|
|
12
14
|
dependency(name)
|
@@ -19,12 +21,14 @@ module ServiceOrchestrator
|
|
19
21
|
attr_accessor name
|
20
22
|
end
|
21
23
|
|
22
|
-
def self.wire(container)
|
24
|
+
def self.wire(name, container)
|
23
25
|
args = {}
|
24
26
|
(self.registered_deps || []).each do |name|
|
25
27
|
args[name] = container.send(name)
|
26
28
|
end
|
27
|
-
new(args)
|
29
|
+
new(args).tap do |service|
|
30
|
+
service.instance_variable_set(:"@service_name", name)
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
def initialize(args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: service_orchestrator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description:
|
27
|
+
description:
|
28
28
|
email:
|
29
29
|
- didier.lafforgue@gmail.com
|
30
30
|
executables: []
|
@@ -47,7 +47,7 @@ homepage: https://github.com/nocoffeehq/service_orchestrator
|
|
47
47
|
licenses:
|
48
48
|
- MIT
|
49
49
|
metadata: {}
|
50
|
-
post_install_message:
|
50
|
+
post_install_message:
|
51
51
|
rdoc_options: []
|
52
52
|
require_paths:
|
53
53
|
- lib
|
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
63
|
version: '0'
|
64
64
|
requirements: []
|
65
65
|
rubygems_version: 3.2.32
|
66
|
-
signing_key:
|
66
|
+
signing_key:
|
67
67
|
specification_version: 4
|
68
68
|
summary: A small library to help you manage services with dependency injection.
|
69
69
|
test_files: []
|