dry-component 0.4.2 → 0.4.3
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 -1
- data/lib/dry/component/container.rb +4 -0
- data/lib/dry/component/version.rb +1 -1
- data/spec/unit/container_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71fded9ea102f66efa6c00cc6249f74cd8c497b7
|
4
|
+
data.tar.gz: 9a8abe72737921f3ef16539b733002884d25e9b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 411c457ecc7cb1365764a84f29854f53ce36afdf832acff7af145e1660d2a740b130c003631392330e16b5c49f673ecb6eb894a67df40f096aa2f1f4456cf3e2
|
7
|
+
data.tar.gz: dc30846c1bec2bfdcd410c3f3eded9749ba3465d6d92449864d5bd0e5fb7de8051bae72600ac3e99b5b9bc6db3160885d5c682b8e5590d4c3332cdfca5f5fe7f
|
data/CHANGELOG.md
CHANGED
@@ -1,16 +1,26 @@
|
|
1
|
+
# 0.4.3 - 2016-08-01
|
2
|
+
|
3
|
+
### Fixed
|
4
|
+
|
5
|
+
- 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-component/pull/24))
|
6
|
+
|
7
|
+
[Compare v0.4.2...v0.4.3](https://github.com/dry-rb/dry-component/compare/v0.4.2...v0.4.3)
|
8
|
+
|
1
9
|
# 0.4.2 - 2016-07-26
|
2
10
|
|
3
11
|
### Fixed
|
4
12
|
|
5
13
|
- 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)
|
6
14
|
|
15
|
+
[Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-component/compare/v0.4.1...v0.4.2)
|
16
|
+
|
7
17
|
# 0.4.1 - 2016-07-26 [YANKED]
|
8
18
|
|
9
19
|
### Fixed
|
10
20
|
|
11
21
|
- Require the 0.4.0 release of dry-auto_inject for the features below (in 0.4.0) to work properly (timriley)
|
12
22
|
|
13
|
-
[Compare v0.
|
23
|
+
[Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-component/compare/v0.4.0...v0.4.1)
|
14
24
|
|
15
25
|
# 0.4.0 - 2016-07-26 [YANKED]
|
16
26
|
|
@@ -123,6 +123,8 @@ module Dry
|
|
123
123
|
end
|
124
124
|
|
125
125
|
def self.load_component(key)
|
126
|
+
return self if key?(key)
|
127
|
+
|
126
128
|
component = loader.load(key)
|
127
129
|
src_key = component.namespaces[0]
|
128
130
|
|
@@ -145,6 +147,8 @@ module Dry
|
|
145
147
|
end
|
146
148
|
end
|
147
149
|
end
|
150
|
+
|
151
|
+
self
|
148
152
|
end
|
149
153
|
|
150
154
|
def self.require_component(component, &block)
|
data/spec/unit/container_spec.rb
CHANGED
@@ -42,6 +42,16 @@ RSpec.describe Dry::Component::Container do
|
|
42
42
|
|
43
43
|
expect(Test::Foo.new.dep).to be_instance_of(Test::Dep)
|
44
44
|
end
|
45
|
+
|
46
|
+
it "raises an error if a component's file can't be found" do
|
47
|
+
expect { container.load_component('test.missing') }.to raise_error Dry::Component::FileNotFoundError
|
48
|
+
end
|
49
|
+
|
50
|
+
it "is a no op if a matching component is already registered" do
|
51
|
+
container.register "test.no_matching_file", Object.new
|
52
|
+
|
53
|
+
expect { container.load_component("test.no_matching_file") }.not_to raise_error
|
54
|
+
end
|
45
55
|
end
|
46
56
|
end
|
47
57
|
|
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.
|
4
|
+
version: 0.4.3
|
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-
|
11
|
+
date: 2016-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inflecto
|