unity-dependency-container 1.0.0 → 1.1.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95ecbf88cb30fe3a940f14fecab38aac375994201c59fccbe9669a403505685a
|
4
|
+
data.tar.gz: c6a856fbb143079767b55d7f44ae31203269eb768f9dfe91c5016befd0428a20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c53afd56a4df8801ffbcadfa3019d1d79ca49b397eb91fc201974553c6264bf9afb6942c18094cbaac455840db2b5933b3f8b3c46b120cfedbedfb834dd292ed
|
7
|
+
data.tar.gz: 775347c35a72973fa59ec0497e02bf4a6386878b8b737c9d6bc67f308f56b9bbee1720c5146fde68643d41059cd6a29610250eed1afa463ca5aa191362a2f693
|
@@ -11,11 +11,18 @@ module Unity
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def di_instances
|
14
|
-
|
14
|
+
Thread.current[:di_instances]
|
15
15
|
end
|
16
16
|
|
17
17
|
def di(name)
|
18
|
-
di_instances[name]
|
18
|
+
return di_instances[name] if !di_instances.nil? && di_instances.key?(name)
|
19
|
+
|
20
|
+
Thread.current[:di_instances] ||= {}
|
21
|
+
|
22
|
+
unless di_container_repository.key?(name)
|
23
|
+
raise Error, "Dependency '#{name}' does not exists"
|
24
|
+
end
|
25
|
+
Thread.current[:di_instances][name] = di_container_repository[name].call
|
19
26
|
end
|
20
27
|
|
21
28
|
def dependency(name, &block)
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unity-dependency-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saluzafa
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- lib/unity-dependency-container.rb
|
28
28
|
- lib/unity/dependency_container.rb
|
29
29
|
- lib/unity/dependency_container/version.rb
|
30
|
+
- unity-dependency-container-1.0.0.gem
|
30
31
|
homepage: https://github.com/pocketsizesun/unity-dependency-container
|
31
32
|
licenses: []
|
32
33
|
metadata:
|