dry-system 0.19.0 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +75 -0
- data/README.md +5 -4
- data/dry-system.gemspec +16 -15
- data/lib/dry/system/auto_registrar.rb +3 -15
- data/lib/dry/system/booter/component_registry.rb +3 -3
- data/lib/dry/system/booter.rb +4 -4
- data/lib/dry/system/component.rb +103 -45
- data/lib/dry/system/component_dir.rb +112 -45
- data/lib/dry/system/components/bootable.rb +10 -19
- data/lib/dry/system/config/component_dir.rb +74 -42
- data/lib/dry/system/config/component_dirs.rb +28 -41
- data/lib/dry/system/config/namespace.rb +71 -0
- data/lib/dry/system/config/namespaces.rb +121 -0
- data/lib/dry/system/constants.rb +1 -1
- data/lib/dry/system/container.rb +39 -42
- data/lib/dry/system/errors.rb +11 -20
- data/lib/dry/system/identifier.rb +57 -79
- data/lib/dry/system/indirect_component.rb +65 -0
- data/lib/dry/system/loader.rb +3 -4
- data/lib/dry/system/manual_registrar.rb +4 -8
- data/lib/dry/system/plugins/bootsnap.rb +1 -1
- data/lib/dry/system/plugins/dependency_graph.rb +4 -4
- data/lib/dry/system/plugins/env.rb +1 -1
- data/lib/dry/system/plugins/logging.rb +7 -6
- data/lib/dry/system/plugins.rb +1 -3
- data/lib/dry/system/provider.rb +6 -6
- data/lib/dry/system/provider_registry.rb +4 -4
- data/lib/dry/system/settings.rb +1 -4
- data/lib/dry/system/stubs.rb +1 -1
- data/lib/dry/system/version.rb +1 -1
- data/lib/dry/system.rb +5 -5
- metadata +14 -11
data/lib/dry/system/settings.rb
CHANGED
@@ -11,12 +11,9 @@ module Dry
|
|
11
11
|
module System
|
12
12
|
module Settings
|
13
13
|
class DSL < BasicObject
|
14
|
-
attr_reader :identifier
|
15
|
-
|
16
14
|
attr_reader :schema
|
17
15
|
|
18
|
-
def initialize(
|
19
|
-
@identifier = identifier
|
16
|
+
def initialize(&block)
|
20
17
|
@schema = {}
|
21
18
|
instance_eval(&block)
|
22
19
|
end
|
data/lib/dry/system/stubs.rb
CHANGED
data/lib/dry/system/version.rb
CHANGED
data/lib/dry/system.rb
CHANGED
@@ -8,17 +8,17 @@ module Dry
|
|
8
8
|
# Register external component provider
|
9
9
|
#
|
10
10
|
# @api public
|
11
|
-
def self.register_provider(
|
12
|
-
providers.register(
|
13
|
-
providers[
|
11
|
+
def self.register_provider(name, options)
|
12
|
+
providers.register(name, options)
|
13
|
+
providers[name].load_components
|
14
14
|
self
|
15
15
|
end
|
16
16
|
|
17
17
|
# Register an external component that can be booted within other systems
|
18
18
|
#
|
19
19
|
# @api public
|
20
|
-
def self.register_component(
|
21
|
-
providers[provider].register_component(
|
20
|
+
def self.register_component(name, provider:, &block)
|
21
|
+
providers[provider].register_component(name, block)
|
22
22
|
self
|
23
23
|
end
|
24
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-system
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -44,40 +44,40 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.13'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
50
|
+
version: 0.13.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '0.
|
57
|
+
version: '0.13'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
60
|
+
version: 0.13.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: dry-container
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
67
|
+
version: '0.9'
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.
|
70
|
+
version: 0.9.0
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '0.
|
77
|
+
version: '0.9'
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 0.
|
80
|
+
version: 0.9.0
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: dry-core
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,11 +197,14 @@ files:
|
|
197
197
|
- lib/dry/system/components/config.rb
|
198
198
|
- lib/dry/system/config/component_dir.rb
|
199
199
|
- lib/dry/system/config/component_dirs.rb
|
200
|
+
- lib/dry/system/config/namespace.rb
|
201
|
+
- lib/dry/system/config/namespaces.rb
|
200
202
|
- lib/dry/system/constants.rb
|
201
203
|
- lib/dry/system/container.rb
|
202
204
|
- lib/dry/system/errors.rb
|
203
205
|
- lib/dry/system/identifier.rb
|
204
206
|
- lib/dry/system/importer.rb
|
207
|
+
- lib/dry/system/indirect_component.rb
|
205
208
|
- lib/dry/system/lifecycle.rb
|
206
209
|
- lib/dry/system/loader.rb
|
207
210
|
- lib/dry/system/loader/autoloading.rb
|
@@ -240,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
243
|
requirements:
|
241
244
|
- - ">="
|
242
245
|
- !ruby/object:Gem::Version
|
243
|
-
version: 2.
|
246
|
+
version: 2.6.0
|
244
247
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
248
|
requirements:
|
246
249
|
- - ">="
|