dry-system 0.13.2 → 0.14.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 +89 -51
- data/LICENSE +1 -1
- data/README.md +16 -8
- data/dry-system.gemspec +41 -0
- data/lib/dry/system/auto_registrar.rb +7 -1
- data/lib/dry/system/constants.rb +1 -0
- data/lib/dry/system/errors.rb +9 -0
- data/lib/dry/system/plugins.rb +9 -7
- data/lib/dry/system/version.rb +1 -1
- metadata +17 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 147f6dffc6bc9ebb2773c136ba71789aa3d6ecc5330ea983b6943d257b8c14b8
|
4
|
+
data.tar.gz: 3479389ed0a9ba38ecbb55dd940b70ac2b59f0fa1ddb6de210dc0cf0732338fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06255e42cbdbf4aaff57a811c6e7c386bf4f8014e672db919e8f2d6ad1ee5310ed1e3f8655dd20b854d3c5cd1bec767c2c6089ca4b84620c76143e454e4408ac
|
7
|
+
data.tar.gz: 37b351fb70e5681d291b6ead72533ee5e5b5778bf86879136ad16fe20b144427e00af6b9a9cedc5010dda969125abe6dea6865eeb0926aecbe9dda450ed7e28a
|
data/CHANGELOG.md
CHANGED
@@ -1,25 +1,37 @@
|
|
1
|
-
|
1
|
+
## unreleased
|
2
|
+
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
|
6
|
+
- Misspelled plugin name raises meaningful error (issue #132) (@cgeorgii)
|
7
|
+
- Fail fast if auto_registrar config contains incorrect path (@cutalion)
|
8
|
+
|
9
|
+
|
10
|
+
[Compare v0.13.2...master](https://github.com/dry-rb/dry-system/compare/v0.13.2...master)
|
11
|
+
|
12
|
+
## 0.13.2 2019-12-28
|
13
|
+
|
2
14
|
|
3
15
|
### Fixed
|
4
16
|
|
5
17
|
- More keyword warnings (flash-gordon)
|
6
18
|
|
19
|
+
|
7
20
|
[Compare v0.13.1...v0.13.2](https://github.com/dry-rb/dry-system/compare/v0.13.1...v0.13.2)
|
8
21
|
|
9
|
-
|
22
|
+
## 0.13.1 2019-11-07
|
23
|
+
|
10
24
|
|
11
25
|
### Fixed
|
12
26
|
|
13
27
|
- Fixed keyword warnings reported by Ruby 2.7 (flash-gordon)
|
14
28
|
- Duplicates in `Dry::System::Plugins.loaded_dependencies` (AMHOL)
|
15
29
|
|
30
|
+
|
16
31
|
[Compare v0.13.0...v0.13.1](https://github.com/dry-rb/dry-system/compare/v0.13.0...v0.13.1)
|
17
32
|
|
18
|
-
|
33
|
+
## 0.13.0 2019-10-13
|
19
34
|
|
20
|
-
### Changed
|
21
|
-
|
22
|
-
- [BREAKING] `Container.key?` triggers lazy-loading for not finalized containers. If component wasn't found it returns `false` without raising an error. This is a breaking change, if you seek the previous behavior, use `Container.registered?` (flash-gordon)
|
23
35
|
|
24
36
|
### Added
|
25
37
|
|
@@ -28,9 +40,14 @@
|
|
28
40
|
App.resolve('missing.dep') { :fallback } # => :fallback
|
29
41
|
```
|
30
42
|
|
43
|
+
### Changed
|
44
|
+
|
45
|
+
- [BREAKING] `Container.key?` triggers lazy-loading for not finalized containers. If component wasn't found it returns `false` without raising an error. This is a breaking change, if you seek the previous behavior, use `Container.registered?` (flash-gordon)
|
46
|
+
|
31
47
|
[Compare v0.12.0...v0.13.0](https://github.com/dry-rb/dry-system/compare/v0.12.0...v0.13.0)
|
32
48
|
|
33
|
-
|
49
|
+
## 0.12.0 2019-04-24
|
50
|
+
|
34
51
|
|
35
52
|
### Changed
|
36
53
|
|
@@ -38,7 +55,8 @@
|
|
38
55
|
|
39
56
|
[Compare v0.11.0...v0.12.0](https://github.com/dry-rb/dry-system/compare/v0.11.0...v0.12.0)
|
40
57
|
|
41
|
-
|
58
|
+
## 0.11.0 2019-03-22
|
59
|
+
|
42
60
|
|
43
61
|
### Changed
|
44
62
|
|
@@ -47,7 +65,8 @@
|
|
47
65
|
|
48
66
|
[Compare v0.10.1...v0.11.0](https://github.com/dry-rb/dry-system/compare/v0.10.1...v0.11.0)
|
49
67
|
|
50
|
-
|
68
|
+
## 0.10.1 2018-07-05
|
69
|
+
|
51
70
|
|
52
71
|
### Added
|
53
72
|
|
@@ -57,9 +76,11 @@
|
|
57
76
|
|
58
77
|
- When using a non-finalized container, you can now resolve multiple different container objects registered using the same root key as a bootable component (timriley)
|
59
78
|
|
79
|
+
|
60
80
|
[Compare v0.10.0...v0.10.1](https://github.com/dry-rb/dry-system/compare/v0.10.0...v0.10.1)
|
61
81
|
|
62
|
-
|
82
|
+
## 0.10.0 2018-06-07
|
83
|
+
|
63
84
|
|
64
85
|
### Added
|
65
86
|
|
@@ -84,23 +105,28 @@
|
|
84
105
|
|
85
106
|
[Compare v0.9.2...v0.10.0](https://github.com/dry-rb/dry-system/compare/v0.9.2...v0.10.0)
|
86
107
|
|
87
|
-
|
108
|
+
## 0.9.2 2018-02-08
|
109
|
+
|
88
110
|
|
89
111
|
### Fixed
|
90
112
|
|
91
113
|
- Default namespace no longer breaks resolving dependencies with identifier that includes part of the namespace (ie `mail.mailer`) (GustavoCaso)
|
92
114
|
|
115
|
+
|
93
116
|
[Compare v0.9.1...v0.9.2](https://github.com/dry-rb/dry-system/compare/v0.9.1...v0.9.2)
|
94
117
|
|
95
|
-
|
118
|
+
## 0.9.1 2018-01-03
|
119
|
+
|
96
120
|
|
97
121
|
### Fixed
|
98
122
|
|
99
123
|
- Plugin dependencies are now auto-required and a meaningful error is raised when a dep failed to load (solnic)
|
100
124
|
|
125
|
+
|
101
126
|
[Compare v0.9.0...v0.9.1](https://github.com/dry-rb/dry-system/compare/v0.9.0...v0.9.1)
|
102
127
|
|
103
|
-
|
128
|
+
## 0.9.0 2018-01-02
|
129
|
+
|
104
130
|
|
105
131
|
### Added
|
106
132
|
|
@@ -116,22 +142,21 @@
|
|
116
142
|
|
117
143
|
- [BREAKING] renamed `Container.{require=>require_from_root}` (GustavoCaso)
|
118
144
|
|
119
|
-
### Internal
|
120
|
-
|
121
|
-
- `#bootable?` and `#boot_file` methods were moved from `Component` to `Booter` (GustavoCaso)
|
122
|
-
|
123
145
|
[Compare v0.8.1...v0.9.0](https://github.com/dry-rb/dry-system/compare/v0.8.1...v0.9.0)
|
124
146
|
|
125
|
-
|
147
|
+
## 0.8.1 2017-10-17
|
148
|
+
|
126
149
|
|
127
150
|
### Fixed
|
128
151
|
|
129
152
|
- Aliasing an external component works correctly (solnic)
|
130
153
|
- Manually calling `:init` will also finalize a component (solnic)
|
131
154
|
|
155
|
+
|
132
156
|
[Compare v0.8.0...v0.8.1](https://github.com/dry-rb/dry-system/compare/v0.8.0...v0.8.1)
|
133
157
|
|
134
|
-
|
158
|
+
## 0.8.0 2017-10-16
|
159
|
+
|
135
160
|
|
136
161
|
### Added
|
137
162
|
|
@@ -148,14 +173,19 @@
|
|
148
173
|
|
149
174
|
[Compare v0.7.3...v0.8.0](https://github.com/dry-rb/dry-system/compare/v0.7.3...v0.8.0)
|
150
175
|
|
151
|
-
|
176
|
+
## 0.7.3 2017-08-02
|
177
|
+
|
152
178
|
|
153
179
|
### Fixed
|
154
180
|
|
155
181
|
- `Container.enable_stubs!` calls super too, which actually adds `stub` API (solnic)
|
156
182
|
- Issues with lazy-loading and import in stub mode are gone (solnic)
|
157
183
|
|
158
|
-
|
184
|
+
|
185
|
+
[Compare v0.7.2...v0.7.3](https://github.com/dry-rb/dry-system/compare/v0.7.2...v0.7.3)
|
186
|
+
|
187
|
+
## 0.7.2 2017-08-02
|
188
|
+
|
159
189
|
|
160
190
|
### Added
|
161
191
|
|
@@ -169,13 +199,17 @@
|
|
169
199
|
|
170
200
|
[Compare v0.7.1...v0.7.2](https://github.com/dry-rb/dry-system/compare/v0.7.1...v0.7.2)
|
171
201
|
|
172
|
-
|
202
|
+
## 0.7.1 2017-06-16
|
203
|
+
|
173
204
|
|
174
205
|
### Changed
|
175
206
|
|
176
207
|
- Accept string values for Container's `root` config (timriley)
|
177
208
|
|
178
|
-
|
209
|
+
[Compare v0.7.0...v0.7.1](https://github.com/dry-rb/dry-system/compare/v0.7.0...v0.7.1)
|
210
|
+
|
211
|
+
## 0.7.0 2017-06-15
|
212
|
+
|
179
213
|
|
180
214
|
### Added
|
181
215
|
|
@@ -197,7 +231,6 @@
|
|
197
231
|
end
|
198
232
|
end
|
199
233
|
```
|
200
|
-
|
201
234
|
- A helpful error will be raised if a bootable component's finalize block name doesn't match its boot file name (GustavoCaso)
|
202
235
|
|
203
236
|
### Changed
|
@@ -208,7 +241,8 @@
|
|
208
241
|
|
209
242
|
[Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-system/compare/v0.6.0...v0.7.0)
|
210
243
|
|
211
|
-
|
244
|
+
## 0.6.0 2016-02-02
|
245
|
+
|
212
246
|
|
213
247
|
### Changed
|
214
248
|
|
@@ -217,17 +251,18 @@
|
|
217
251
|
|
218
252
|
[Compare v0.5.1...v0.6.0](https://github.com/dry-rb/dry-system/compare/v0.5.1...v0.6.0)
|
219
253
|
|
220
|
-
|
254
|
+
## 0.5.1 2016-08-23
|
255
|
+
|
221
256
|
|
222
257
|
### Fixed
|
223
258
|
|
224
259
|
- Undefined locals or method calls will raise proper exceptions in Lifecycle DSL (aradunovic)
|
225
260
|
|
261
|
+
|
226
262
|
[Compare v0.5.0...v0.5.1](https://github.com/dry-rb/dry-system/compare/v0.5.0...v0.5.1)
|
227
263
|
|
228
|
-
|
264
|
+
## 0.5.0 2016-08-15
|
229
265
|
|
230
|
-
This is a major refactoring with better internal APIs and improved support
|
231
266
|
for multi-container setups. As part of this release `dry-system` has been renamed to `dry-system`.
|
232
267
|
|
233
268
|
### Added
|
@@ -244,40 +279,40 @@ for multi-container setups. As part of this release `dry-system` has been rename
|
|
244
279
|
- [BREAKING] `core_dir` renameda to `system_dir` and defaults to `system` (solnic)
|
245
280
|
- [BREAKING] `auto_register!` yields `Component` objects (solnic)
|
246
281
|
|
247
|
-
### Internal improvements
|
248
|
-
|
249
|
-
- Use new `Dry::Container#merge` which accepts `:namespace` option (AMHOL)
|
250
|
-
- Auto-registration is handled by a `System::AutoRegistrar` object configured in a container (solnic)
|
251
|
-
- Booting is now handled by `System::Booter` object configured in a container (solnic)
|
252
|
-
- Importing containers is now handled by `System::Importer` object configured in a container (solnic)
|
253
|
-
|
254
282
|
[Compare v0.4.3...v0.5.0](https://github.com/dry-rb/dry-system/compare/v0.4.3...v0.5.0)
|
255
283
|
|
256
|
-
|
284
|
+
## 0.4.3 2016-08-01
|
285
|
+
|
257
286
|
|
258
287
|
### Fixed
|
259
288
|
|
260
289
|
- Return immediately from `Container.load_component` if the requested component key already exists in the container. This fixes a crash when requesting to load a manually registered component with a name that doesn't map to a filename (timriley in [#24](https://github.com/dry-rb/dry-system/pull/24))
|
261
290
|
|
291
|
+
|
262
292
|
[Compare v0.4.2...v0.4.3](https://github.com/dry-rb/dry-system/compare/v0.4.2...v0.4.3)
|
263
293
|
|
264
|
-
|
294
|
+
## 0.4.2 2016-07-26
|
295
|
+
|
265
296
|
|
266
297
|
### Fixed
|
267
298
|
|
268
299
|
- Ensure file components can be loaded when they're requested for the first time using their shorthand container identifier (i.e. with the container's default namespace removed) (timriley)
|
269
300
|
|
301
|
+
|
270
302
|
[Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-system/compare/v0.4.1...v0.4.2)
|
271
303
|
|
272
|
-
|
304
|
+
## 0.4.1 2016-07-26
|
305
|
+
|
273
306
|
|
274
307
|
### Fixed
|
275
308
|
|
276
309
|
- Require the 0.4.0 release of dry-auto_inject for the features below (in 0.4.0) to work properly (timriley)
|
277
310
|
|
311
|
+
|
278
312
|
[Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-system/compare/v0.4.0...v0.4.1)
|
279
313
|
|
280
|
-
|
314
|
+
## 0.4.0 2016-07-26
|
315
|
+
|
281
316
|
|
282
317
|
### Added
|
283
318
|
|
@@ -304,7 +339,6 @@ for multi-container setups. As part of this release `dry-system` has been rename
|
|
304
339
|
end
|
305
340
|
end
|
306
341
|
```
|
307
|
-
|
308
342
|
- Support for supplying to options directly to dry-auto_inject's `Builder` via `Dry::Component::Container#injector(options)`. This allows you to provide dry-auto_inject customizations like your own container of injection strategies (timriley in [#20](https://github.com/dry-rb/dry-system/pull/20))
|
309
343
|
- Support for accessing all available injector strategies, not just the defaults (e.g. `MyContainer.injector.some_custom_strategy`) (timriley in [#19](https://github.com/dry-rb/dry-system/pull/19))
|
310
344
|
|
@@ -314,32 +348,35 @@ for multi-container setups. As part of this release `dry-system` has been rename
|
|
314
348
|
|
315
349
|
[Compare v0.3.0...v0.4.0](https://github.com/dry-rb/dry-system/compare/v0.3.0...v0.4.0)
|
316
350
|
|
317
|
-
|
318
|
-
|
319
|
-
### Changed
|
351
|
+
## 0.3.0 2016-06-18
|
320
352
|
|
321
353
|
Removed two pieces that are moving to dry-web:
|
322
354
|
|
355
|
+
### Changed
|
356
|
+
|
357
|
+
- Removed two pieces that are moving to dry-web:
|
323
358
|
- Removed `env` setting from `Container` (timriley)
|
324
359
|
- Removed `Dry::Component::Config` and `options` setting from `Container` (timriley)
|
325
360
|
- Changed `Component#configure` behavior so it can be run multiple times for configuration to be applied in multiple passes (timriley)
|
326
361
|
|
327
362
|
[Compare v0.2.0...v0.3.0](https://github.com/dry-rb/dry-system/compare/v0.2.0...v0.3.0)
|
328
363
|
|
329
|
-
|
364
|
+
## 0.2.0 2016-06-13
|
330
365
|
|
331
|
-
### Changed
|
332
|
-
|
333
|
-
- Component core directory is now `component/` by default (timriley)
|
334
|
-
- Injector default stragegy is now whatever dry-auto_inject's default is (rather than hard-coding a particular default strategy for dry-system) (timriley)
|
335
366
|
|
336
367
|
### Fixed
|
337
368
|
|
338
369
|
- Fixed bug where specified auto-inject strategies were not respected (timriley)
|
339
370
|
|
371
|
+
### Changed
|
372
|
+
|
373
|
+
- Component core directory is now `component/` by default (timriley)
|
374
|
+
- Injector default stragegy is now whatever dry-auto_inject's default is (rather than hard-coding a particular default strategy for dry-system) (timriley)
|
375
|
+
|
340
376
|
[Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-system/compare/v0.1.0...v0.2.0)
|
341
377
|
|
342
|
-
|
378
|
+
## 0.1.0 2016-06-07
|
379
|
+
|
343
380
|
|
344
381
|
### Added
|
345
382
|
|
@@ -367,7 +404,8 @@ Removed two pieces that are moving to dry-web:
|
|
367
404
|
|
368
405
|
[Compare v0.0.2...v0.1.0](https://github.com/dry-rb/dry-system/compare/v0.0.2...v0.1.0)
|
369
406
|
|
370
|
-
|
407
|
+
## 0.0.2 2015-12-24
|
408
|
+
|
371
409
|
|
372
410
|
### Added
|
373
411
|
|
@@ -380,6 +418,6 @@ Removed two pieces that are moving to dry-web:
|
|
380
418
|
|
381
419
|
[Compare v0.0.1...v0.0.2](https://github.com/dry-rb/dry-system/compare/v0.0.1...v0.0.2)
|
382
420
|
|
383
|
-
|
421
|
+
## 0.0.1 2015-12-24
|
384
422
|
|
385
423
|
First public release, extracted from rodakase project
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,21 +1,29 @@
|
|
1
1
|
[gem]: https://rubygems.org/gems/dry-system
|
2
|
-
[
|
3
|
-
[
|
4
|
-
[inchpages]: http://inch-ci.org/github/dry-rb/dry-system
|
2
|
+
[actions]: https://github.com/dry-rb/dry-system/actions
|
3
|
+
[codacy]: https://www.codacy.com/gh/dry-rb/dry-system
|
5
4
|
[chat]: https://dry-rb.zulipchat.com
|
5
|
+
[inchpages]: http://inch-ci.org/github/dry-rb/dry-system
|
6
6
|
|
7
7
|
# dry-system [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
|
8
8
|
|
9
9
|
[![Gem Version](https://badge.fury.io/rb/dry-system.svg)][gem]
|
10
|
-
[![
|
11
|
-
[![
|
12
|
-
[![
|
10
|
+
[![CI Status](https://github.com/dry-rb/dry-system/workflows/ci/badge.svg)][actions]
|
11
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3a0e30d0ae2542c7ba047ba5f923c0bb)][codacy]
|
12
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/3a0e30d0ae2542c7ba047ba5f923c0bb)][codacy]
|
13
13
|
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-system.svg?branch=master)][inchpages]
|
14
14
|
|
15
15
|
## Links
|
16
16
|
|
17
|
-
|
17
|
+
* [User documentation](http://dry-rb.org/gems/dry-system)
|
18
|
+
* [API documentation](http://rubydoc.info/gems/dry-system)
|
19
|
+
|
20
|
+
## Supported Ruby versions
|
21
|
+
|
22
|
+
This library officially supports the following Ruby versions:
|
23
|
+
|
24
|
+
* MRI >= `2.4`
|
25
|
+
* jruby >= `9.2`
|
18
26
|
|
19
|
-
##
|
27
|
+
## License
|
20
28
|
|
21
29
|
See `LICENSE` file.
|
data/dry-system.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# this file is managed by dry-rb/devtools project
|
3
|
+
|
4
|
+
lib = File.expand_path('lib', __dir__)
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
+
require 'dry/system/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = 'dry-system'
|
10
|
+
spec.authors = ["Piotr Solnica"]
|
11
|
+
spec.email = ["piotr.solnica@gmail.com"]
|
12
|
+
spec.license = 'MIT'
|
13
|
+
spec.version = Dry::System::VERSION.dup
|
14
|
+
|
15
|
+
spec.summary = "Organize your code into reusable components"
|
16
|
+
spec.description = spec.summary
|
17
|
+
spec.homepage = 'https://dry-rb.org/gems/dry-system'
|
18
|
+
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-system.gemspec", "lib/**/*"]
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
22
|
+
spec.metadata['changelog_uri'] = 'https://github.com/dry-rb/dry-system/blob/master/CHANGELOG.md'
|
23
|
+
spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-system'
|
24
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/dry-rb/dry-system/issues'
|
25
|
+
|
26
|
+
spec.required_ruby_version = '>= 2.4.0'
|
27
|
+
|
28
|
+
# to update dependencies edit project.yml
|
29
|
+
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
|
30
|
+
spec.add_runtime_dependency "dry-auto_inject", ">= 0.4.0"
|
31
|
+
spec.add_runtime_dependency "dry-configurable", "~> 0.7"
|
32
|
+
spec.add_runtime_dependency "dry-container", "~> 0.7", ">= 0.7.2"
|
33
|
+
spec.add_runtime_dependency "dry-core", "~> 0.3", ">= 0.3.1"
|
34
|
+
spec.add_runtime_dependency "dry-equalizer", "~> 0.2"
|
35
|
+
spec.add_runtime_dependency "dry-inflector", "~> 0.1", ">= 0.1.2"
|
36
|
+
spec.add_runtime_dependency "dry-struct", "~> 1.0"
|
37
|
+
|
38
|
+
spec.add_development_dependency "bundler"
|
39
|
+
spec.add_development_dependency "rake"
|
40
|
+
spec.add_development_dependency "rspec"
|
41
|
+
end
|
@@ -56,7 +56,13 @@ module Dry
|
|
56
56
|
|
57
57
|
# @api private
|
58
58
|
def files(dir)
|
59
|
-
|
59
|
+
components_dir = File.join(root, dir)
|
60
|
+
|
61
|
+
unless ::Dir.exist?(components_dir)
|
62
|
+
raise ComponentsDirMissing, "Components dir '#{components_dir}' not found"
|
63
|
+
end
|
64
|
+
|
65
|
+
::Dir["#{components_dir}/**/#{RB_GLOB}"].sort
|
60
66
|
end
|
61
67
|
|
62
68
|
# @api private
|
data/lib/dry/system/constants.rb
CHANGED
data/lib/dry/system/errors.rb
CHANGED
@@ -75,5 +75,14 @@ module Dry
|
|
75
75
|
super("component +#{component_name}+ has not been started")
|
76
76
|
end
|
77
77
|
end
|
78
|
+
|
79
|
+
# Error raised when trying to use a plugin that does not exist.
|
80
|
+
#
|
81
|
+
# @api public
|
82
|
+
PluginNotFoundError = Class.new(StandardError) do
|
83
|
+
def initialize(plugin_name)
|
84
|
+
super("Plugin #{plugin_name.inspect} does not exist")
|
85
|
+
end
|
86
|
+
end
|
78
87
|
end
|
79
88
|
end
|
data/lib/dry/system/plugins.rb
CHANGED
@@ -81,7 +81,8 @@ module Dry
|
|
81
81
|
@loaded_dependencies ||= []
|
82
82
|
end
|
83
83
|
|
84
|
-
#
|
84
|
+
# Enables a plugin if not already enabled.
|
85
|
+
# Raises error if plugin cannot be found in the plugin registry.
|
85
86
|
#
|
86
87
|
# Plugin identifier
|
87
88
|
#
|
@@ -92,13 +93,14 @@ module Dry
|
|
92
93
|
#
|
93
94
|
# @api public
|
94
95
|
def use(name, options = {})
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
return self if enabled_plugins.include?(name)
|
97
|
+
raise PluginNotFoundError, name unless (plugin = Plugins.registry[name])
|
98
|
+
|
99
|
+
plugin.load_dependencies
|
100
|
+
plugin.apply_to(self, options)
|
101
|
+
|
102
|
+
enabled_plugins << name
|
99
103
|
|
100
|
-
enabled_plugins << name
|
101
|
-
end
|
102
104
|
self
|
103
105
|
end
|
104
106
|
|
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.14.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:
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -45,9 +45,6 @@ dependencies:
|
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.7'
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 0.7.0
|
51
48
|
type: :runtime
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -55,9 +52,6 @@ dependencies:
|
|
55
52
|
- - "~>"
|
56
53
|
- !ruby/object:Gem::Version
|
57
54
|
version: '0.7'
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 0.7.0
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: dry-container
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,6 +76,9 @@ dependencies:
|
|
82
76
|
name: dry-core
|
83
77
|
requirement: !ruby/object:Gem::Requirement
|
84
78
|
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0.3'
|
85
82
|
- - ">="
|
86
83
|
- !ruby/object:Gem::Version
|
87
84
|
version: 0.3.1
|
@@ -89,6 +86,9 @@ dependencies:
|
|
89
86
|
prerelease: false
|
90
87
|
version_requirements: !ruby/object:Gem::Requirement
|
91
88
|
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0.3'
|
92
92
|
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 0.3.1
|
@@ -182,7 +182,7 @@ dependencies:
|
|
182
182
|
- - ">="
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '0'
|
185
|
-
description:
|
185
|
+
description: Organize your code into reusable components
|
186
186
|
email:
|
187
187
|
- piotr.solnica@gmail.com
|
188
188
|
executables: []
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- CHANGELOG.md
|
193
193
|
- LICENSE
|
194
194
|
- README.md
|
195
|
+
- dry-system.gemspec
|
195
196
|
- lib/dry-system.rb
|
196
197
|
- lib/dry/system.rb
|
197
198
|
- lib/dry/system/auto_registrar.rb
|
@@ -227,10 +228,14 @@ files:
|
|
227
228
|
- lib/dry/system/stubs.rb
|
228
229
|
- lib/dry/system/system_components/settings.rb
|
229
230
|
- lib/dry/system/version.rb
|
230
|
-
homepage:
|
231
|
+
homepage: https://dry-rb.org/gems/dry-system
|
231
232
|
licenses:
|
232
233
|
- MIT
|
233
|
-
metadata:
|
234
|
+
metadata:
|
235
|
+
allowed_push_host: https://rubygems.org
|
236
|
+
changelog_uri: https://github.com/dry-rb/dry-system/blob/master/CHANGELOG.md
|
237
|
+
source_code_uri: https://github.com/dry-rb/dry-system
|
238
|
+
bug_tracker_uri: https://github.com/dry-rb/dry-system/issues
|
234
239
|
post_install_message:
|
235
240
|
rdoc_options: []
|
236
241
|
require_paths:
|
@@ -246,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
251
|
- !ruby/object:Gem::Version
|
247
252
|
version: '0'
|
248
253
|
requirements: []
|
249
|
-
rubygems_version: 3.
|
254
|
+
rubygems_version: 3.0.3
|
250
255
|
signing_key:
|
251
256
|
specification_version: 4
|
252
257
|
summary: Organize your code into reusable components
|