dry-component 0.1.0 → 0.2.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/CHANGELOG.md +11 -0
- data/lib/dry/component/container.rb +1 -1
- data/lib/dry/component/injector.rb +7 -7
- data/lib/dry/component/version.rb +1 -1
- data/spec/fixtures/import_test/{core → component}/boot/bar.rb +0 -0
- data/spec/fixtures/lazytest/{core → component}/boot/bar.rb +0 -0
- data/spec/fixtures/test/{core → component}/boot/bar.rb +0 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49f20f827f417aba585962b49de78f790635adad
|
4
|
+
data.tar.gz: e97bf0d7268da63ddb52de913a4367c3c6e246cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51a1c8419c4d3d6675b24aa2b0b4065a65bbd14cd25a803a2ffcf3fb21781ecd7b4b41505a552ce1fdc99134f97cfbd3d5bfb5e09610667f06761993ffc3cf53
|
7
|
+
data.tar.gz: 1ec1d0d17d1dbbcd26680aee3dd03e0c14263b12c9fde320455a9efed5716a382bd4b1b07db42ae74f0e788547a5162ebcbb6b997282418fbd559dafcf015e30
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
# 0.2.0 - 2016-06-13
|
2
|
+
|
3
|
+
## Changed
|
4
|
+
|
5
|
+
- Injector default stragegy is now whatever dry-auto_inject's default is (rather than hard-coding a particular default strategy for dry-component) (timriley)
|
6
|
+
|
7
|
+
## Fixed
|
8
|
+
|
9
|
+
- Fixed bug where specified auto-inject strategies were not respected (timriley)
|
10
|
+
|
1
11
|
# 0.1.0 - 2016-06-07
|
2
12
|
|
3
13
|
## Added
|
@@ -5,6 +15,7 @@
|
|
5
15
|
* Provide a dependency injector as an `Inject` constant inside any subclass of `Dry::Component::Container`. This injector supports all of `dry-auto_inject`'s default injection strategies, and will lazily load any dependencies as they are injected. It also supports arbitrarily switching strategies, so they can be used in different classes as required (e.g. `include MyComponent::Inject.args["dep"]`) (timriley)
|
6
16
|
* Support aliased dependency names when calling the injector object (e.g. `MyComponent::Inject[foo: "my_app.foo", bar: "another.thing"]`) (timriley)
|
7
17
|
* Allow a custom dependency loader to be set on a container via its config (AMHOL)
|
18
|
+
|
8
19
|
```ruby
|
9
20
|
class MyContainer < Dry::Component::Container
|
10
21
|
configure do |config|
|
@@ -10,15 +10,15 @@ module Dry
|
|
10
10
|
attr_reader :injector
|
11
11
|
|
12
12
|
# @api private
|
13
|
-
def initialize(container, strategy:
|
13
|
+
def initialize(container, strategy: nil, strategies_cache: nil)
|
14
14
|
@container = container
|
15
15
|
@strategies = strategies_cache
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
@injector =
|
17
|
+
if strategy
|
18
|
+
Dry::AutoInject(container).send(strategy)
|
19
|
+
else
|
20
|
+
Dry::AutoInject(container)
|
21
|
+
end
|
22
22
|
end
|
23
23
|
|
24
24
|
# @api public
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.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: 2016-06-
|
11
|
+
date: 2016-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inflecto
|
@@ -142,12 +142,12 @@ files:
|
|
142
142
|
- spec/fixtures/components/bar.rb
|
143
143
|
- spec/fixtures/components/bar/baz.rb
|
144
144
|
- spec/fixtures/components/foo.rb
|
145
|
+
- spec/fixtures/import_test/component/boot/bar.rb
|
145
146
|
- spec/fixtures/import_test/config/application.yml
|
146
|
-
- spec/fixtures/import_test/core/boot/bar.rb
|
147
147
|
- spec/fixtures/import_test/lib/test/bar.rb
|
148
148
|
- spec/fixtures/import_test/lib/test/foo.rb
|
149
|
+
- spec/fixtures/lazytest/component/boot/bar.rb
|
149
150
|
- spec/fixtures/lazytest/config/application.yml
|
150
|
-
- spec/fixtures/lazytest/core/boot/bar.rb
|
151
151
|
- spec/fixtures/lazytest/lib/test/dep.rb
|
152
152
|
- spec/fixtures/lazytest/lib/test/foo.rb
|
153
153
|
- spec/fixtures/lazytest/lib/test/models.rb
|
@@ -159,9 +159,9 @@ files:
|
|
159
159
|
- spec/fixtures/other/lib/test/models.rb
|
160
160
|
- spec/fixtures/other/lib/test/models/book.rb
|
161
161
|
- spec/fixtures/other/lib/test/models/user.rb
|
162
|
+
- spec/fixtures/test/component/boot/bar.rb
|
162
163
|
- spec/fixtures/test/config/application.yml
|
163
164
|
- spec/fixtures/test/config/subapp.yml
|
164
|
-
- spec/fixtures/test/core/boot/bar.rb
|
165
165
|
- spec/fixtures/test/lib/test/dep.rb
|
166
166
|
- spec/fixtures/test/lib/test/foo.rb
|
167
167
|
- spec/fixtures/test/lib/test/models.rb
|
@@ -202,12 +202,12 @@ test_files:
|
|
202
202
|
- spec/fixtures/components/bar.rb
|
203
203
|
- spec/fixtures/components/bar/baz.rb
|
204
204
|
- spec/fixtures/components/foo.rb
|
205
|
+
- spec/fixtures/import_test/component/boot/bar.rb
|
205
206
|
- spec/fixtures/import_test/config/application.yml
|
206
|
-
- spec/fixtures/import_test/core/boot/bar.rb
|
207
207
|
- spec/fixtures/import_test/lib/test/bar.rb
|
208
208
|
- spec/fixtures/import_test/lib/test/foo.rb
|
209
|
+
- spec/fixtures/lazytest/component/boot/bar.rb
|
209
210
|
- spec/fixtures/lazytest/config/application.yml
|
210
|
-
- spec/fixtures/lazytest/core/boot/bar.rb
|
211
211
|
- spec/fixtures/lazytest/lib/test/dep.rb
|
212
212
|
- spec/fixtures/lazytest/lib/test/foo.rb
|
213
213
|
- spec/fixtures/lazytest/lib/test/models.rb
|
@@ -219,9 +219,9 @@ test_files:
|
|
219
219
|
- spec/fixtures/other/lib/test/models.rb
|
220
220
|
- spec/fixtures/other/lib/test/models/book.rb
|
221
221
|
- spec/fixtures/other/lib/test/models/user.rb
|
222
|
+
- spec/fixtures/test/component/boot/bar.rb
|
222
223
|
- spec/fixtures/test/config/application.yml
|
223
224
|
- spec/fixtures/test/config/subapp.yml
|
224
|
-
- spec/fixtures/test/core/boot/bar.rb
|
225
225
|
- spec/fixtures/test/lib/test/dep.rb
|
226
226
|
- spec/fixtures/test/lib/test/foo.rb
|
227
227
|
- spec/fixtures/test/lib/test/models.rb
|