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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 824b117cef6d2000cb55df3ed8793c75f2119d42
4
- data.tar.gz: d83e83d6c90f343853e26a8f6d154798bc2e32ef
3
+ metadata.gz: 3e95ff65aa9757039480e0919e4089087d16f6bc
4
+ data.tar.gz: 74d94874315ceec73ffb328fd793625e1d388a5d
5
5
  SHA512:
6
- metadata.gz: 16364a8df976b2b7a6da996898d16c4210248d25bb3774d0a446001d10d2fdf73395027979d87c6e359efd086b713a33b40dece6127330b356519e2249956da6
7
- data.tar.gz: 2c27d0c05a78fcf297225a43cfa2cefe69cec7ed20e644841750dfee3acb253b33ce58a1efda727e8ec5ee7fe3f645bc997c2caa11dcb09b4188155e2c198d1f
6
+ metadata.gz: cf4e18b095c7ca8e0d068c67f9e3b4ed194eefb89db39194e10bbb06968d1d9e74c8de3fefd6e410c0bfb8ac0c4c93fa4a55ff96bdaf6169b578093bd0109341
7
+ data.tar.gz: c1741ea519d2fcf866b55771d6360175fe67c629e6549814cabee0232ee43d8722859a88599e950f78a0782416409bed1254df4c209d98106a5774b3cdb3b932
@@ -1,8 +1,18 @@
1
- ## 0.1 - Initial Release
1
+ ## 0.4 - Args in the container Constructor
2
2
 
3
3
  ### Features
4
4
 
5
- * Initial Release
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.3 - Better error handling
27
+ ## 0.1 - Initial Release
18
28
 
19
29
  ### Features
20
30
 
21
- * Validation errors are more descriptive and contain the ID of the injectable.
22
-
23
- ### Bug Fixes
24
-
25
- * Dependencies that appear in multiple places in the dependency graph are injected properly.
31
+ * Initial Release
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'codependent'
3
- s.version = '0.3'
4
- s.date = '2017-02-24'
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
- instance_eval(&block) if block
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.3'
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-02-24 00:00:00.000000000 Z
11
+ date: 2017-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec