codependent 0.3 → 0.4
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 +14 -8
- data/codependent.gemspec +2 -2
- data/lib/codependent/container.rb +2 -2
- 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: 3e95ff65aa9757039480e0919e4089087d16f6bc
|
4
|
+
data.tar.gz: 74d94874315ceec73ffb328fd793625e1d388a5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf4e18b095c7ca8e0d068c67f9e3b4ed194eefb89db39194e10bbb06968d1d9e74c8de3fefd6e410c0bfb8ac0c4c93fa4a55ff96bdaf6169b578093bd0109341
|
7
|
+
data.tar.gz: c1741ea519d2fcf866b55771d6360175fe67c629e6549814cabee0232ee43d8722859a88599e950f78a0782416409bed1254df4c209d98106a5774b3cdb3b932
|
data/Changelog.md
CHANGED
@@ -1,8 +1,18 @@
|
|
1
|
-
## 0.
|
1
|
+
## 0.4 - Args in the container Constructor
|
2
2
|
|
3
3
|
### Features
|
4
4
|
|
5
|
-
*
|
5
|
+
* The Container constructor can accept an options hash, which is passed to the constructor block.
|
6
|
+
|
7
|
+
## 0.3 - Better error handling
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* Validation errors are more descriptive and contain the ID of the injectable.
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* Dependencies that appear in multiple places in the dependency graph are injected properly.
|
6
16
|
|
7
17
|
## 0.2 - New injection types!
|
8
18
|
|
@@ -14,12 +24,8 @@
|
|
14
24
|
* Dependency type checking
|
15
25
|
* New DSL syntax
|
16
26
|
|
17
|
-
## 0.
|
27
|
+
## 0.1 - Initial Release
|
18
28
|
|
19
29
|
### Features
|
20
30
|
|
21
|
-
*
|
22
|
-
|
23
|
-
### Bug Fixes
|
24
|
-
|
25
|
-
* Dependencies that appear in multiple places in the dependency graph are injected properly.
|
31
|
+
* Initial Release
|
data/codependent.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'codependent'
|
3
|
-
s.version = '0.
|
4
|
-
s.date = '2017-
|
3
|
+
s.version = '0.4'
|
4
|
+
s.date = '2017-03-05'
|
5
5
|
s.summary = "A simple dependency injection library for Ruby."
|
6
6
|
s.authors = ["Joshua Tompkins"]
|
7
7
|
s.email = 'josh@joshtompkins.com'
|
@@ -5,10 +5,10 @@ module Codependent
|
|
5
5
|
class Container
|
6
6
|
CONFIG_BLOCK_MISSING_ERROR = 'You must provide a config block.'.freeze
|
7
7
|
|
8
|
-
def initialize(&block)
|
8
|
+
def initialize(args = {}, &block)
|
9
9
|
@injectables = {}
|
10
10
|
|
11
|
-
|
11
|
+
instance_exec(args, &block) if block
|
12
12
|
end
|
13
13
|
|
14
14
|
def instance(id, &config_block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codependent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Tompkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|