dry-system 0.18.2 → 0.19.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 +88 -4
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/dry-system.gemspec +3 -4
- data/lib/dry/system/auto_registrar.rb +16 -58
- data/lib/dry/system/booter.rb +34 -15
- data/lib/dry/system/component.rb +56 -94
- data/lib/dry/system/component_dir.rb +128 -0
- data/lib/dry/system/config/component_dir.rb +202 -0
- data/lib/dry/system/config/component_dirs.rb +184 -0
- data/lib/dry/system/container.rb +78 -144
- data/lib/dry/system/errors.rb +21 -12
- data/lib/dry/system/identifier.rb +157 -0
- data/lib/dry/system/loader/autoloading.rb +26 -0
- data/lib/dry/system/loader.rb +40 -41
- data/lib/dry/system/plugins/logging.rb +4 -1
- data/lib/dry/system/version.rb +1 -1
- metadata +16 -26
- data/lib/dry/system/auto_registrar/configuration.rb +0 -43
data/lib/dry/system/version.rb
CHANGED
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.19.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-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -44,20 +44,20 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.12'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
50
|
+
version: 0.12.1
|
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.12'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
60
|
+
version: 0.12.1
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: dry-container
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,34 +84,20 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '0.
|
87
|
+
version: '0.5'
|
88
88
|
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.
|
90
|
+
version: '0.5'
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '0.
|
97
|
+
version: '0.5'
|
98
98
|
- - ">="
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: 0.
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: dry-equalizer
|
103
|
-
requirement: !ruby/object:Gem::Requirement
|
104
|
-
requirements:
|
105
|
-
- - "~>"
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version: '0.2'
|
108
|
-
type: :runtime
|
109
|
-
prerelease: false
|
110
|
-
version_requirements: !ruby/object:Gem::Requirement
|
111
|
-
requirements:
|
112
|
-
- - "~>"
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
version: '0.2'
|
100
|
+
version: '0.5'
|
115
101
|
- !ruby/object:Gem::Dependency
|
116
102
|
name: dry-inflector
|
117
103
|
requirement: !ruby/object:Gem::Requirement
|
@@ -202,19 +188,23 @@ files:
|
|
202
188
|
- lib/dry-system.rb
|
203
189
|
- lib/dry/system.rb
|
204
190
|
- lib/dry/system/auto_registrar.rb
|
205
|
-
- lib/dry/system/auto_registrar/configuration.rb
|
206
191
|
- lib/dry/system/booter.rb
|
207
192
|
- lib/dry/system/booter/component_registry.rb
|
208
193
|
- lib/dry/system/component.rb
|
194
|
+
- lib/dry/system/component_dir.rb
|
209
195
|
- lib/dry/system/components.rb
|
210
196
|
- lib/dry/system/components/bootable.rb
|
211
197
|
- lib/dry/system/components/config.rb
|
198
|
+
- lib/dry/system/config/component_dir.rb
|
199
|
+
- lib/dry/system/config/component_dirs.rb
|
212
200
|
- lib/dry/system/constants.rb
|
213
201
|
- lib/dry/system/container.rb
|
214
202
|
- lib/dry/system/errors.rb
|
203
|
+
- lib/dry/system/identifier.rb
|
215
204
|
- lib/dry/system/importer.rb
|
216
205
|
- lib/dry/system/lifecycle.rb
|
217
206
|
- lib/dry/system/loader.rb
|
207
|
+
- lib/dry/system/loader/autoloading.rb
|
218
208
|
- lib/dry/system/magic_comments_parser.rb
|
219
209
|
- lib/dry/system/manual_registrar.rb
|
220
210
|
- lib/dry/system/plugins.rb
|
@@ -250,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
250
240
|
requirements:
|
251
241
|
- - ">="
|
252
242
|
- !ruby/object:Gem::Version
|
253
|
-
version: 2.
|
243
|
+
version: 2.5.0
|
254
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
245
|
requirements:
|
256
246
|
- - ">="
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Dry
|
4
|
-
module System
|
5
|
-
class AutoRegistrar
|
6
|
-
# Default auto_registrar configuration
|
7
|
-
#
|
8
|
-
# This is currently configured by default for every System::Container.
|
9
|
-
# Configuration allows to define custom initialization as well as exclusion
|
10
|
-
# logic, for each component that is being registered by Dry::System
|
11
|
-
# auto-registration.
|
12
|
-
#
|
13
|
-
# @api private
|
14
|
-
class Configuration
|
15
|
-
DEFAULT_INSTANCE = -> component { component.instance }.freeze
|
16
|
-
FALSE_PROC = -> * { false }.freeze
|
17
|
-
|
18
|
-
def self.setting(name)
|
19
|
-
define_method(name) do |&block|
|
20
|
-
ivar = "@#{name}"
|
21
|
-
if block
|
22
|
-
instance_variable_set(ivar, block)
|
23
|
-
else
|
24
|
-
instance_variable_get(ivar)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
setting :exclude
|
30
|
-
setting :instance
|
31
|
-
|
32
|
-
attr_accessor :memoize
|
33
|
-
|
34
|
-
# @api private
|
35
|
-
def initialize
|
36
|
-
@instance = DEFAULT_INSTANCE
|
37
|
-
@exclude = FALSE_PROC
|
38
|
-
@memoize = false
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|