dry-component 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fd0b3400c225e2c1f856aff61cf4e554b8f9fc5
4
- data.tar.gz: b9ead2e64ad32dee264b29973c932a1394dc6775
3
+ metadata.gz: 49f20f827f417aba585962b49de78f790635adad
4
+ data.tar.gz: e97bf0d7268da63ddb52de913a4367c3c6e246cc
5
5
  SHA512:
6
- metadata.gz: 6b38cbe04c32bd241421fe438551c8fc3d51ca9e23332f222f93f14c1afe33a4574848418298db8eeec621a679000d5eea01e42e2f389e5cfe43b1dcba339460
7
- data.tar.gz: 06af0944d5af7614a50e381b2ceb5efd850ae10519f1deb8487e9ed7f19b3a6ec413446f2ec32f52983b11a3e718b3f22c9b3189c4ce95a70f6aac97a9ed42a7
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|
@@ -15,7 +15,7 @@ module Dry
15
15
  setting :env
16
16
  setting :name
17
17
  setting :root, Pathname.pwd.freeze
18
- setting :core_dir, 'core'.freeze
18
+ setting :core_dir, 'component'.freeze
19
19
  setting :auto_register
20
20
  setting :options
21
21
  setting :loader, Dry::Component::Loader
@@ -10,15 +10,15 @@ module Dry
10
10
  attr_reader :injector
11
11
 
12
12
  # @api private
13
- def initialize(container, strategy: :args, strategies_cache: nil)
13
+ def initialize(container, strategy: nil, strategies_cache: nil)
14
14
  @container = container
15
15
  @strategies = strategies_cache
16
-
17
- @injector = if strategy == :args
18
- Dry::AutoInject(container)
19
- else
20
- Dry::AutoInject(container).send(strategy)
21
- end
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
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module Component
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
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.1.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-07 00:00:00.000000000 Z
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