Skip to content

Commit

Permalink
added config object into DIConfigurator Carrooi#1
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kudera committed Dec 28, 2013
1 parent 25d452c commit a0be5c9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ $ npm test

## Changelog

* 2.1.0
+ Added [config](https://github.com/sakren/node-easy-configuration) object do DIConfigurator

* 2.0.1
+ Injecting by arguments and hints was not working

Expand Down
14 changes: 8 additions & 6 deletions lib/DIConfigurator.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dependency-injection",
"description": "Dependency injection with configuration and autowire for node js and browser",
"version": "2.0.1",
"version": "2.1.0",
"author": {
"name": "David Kudera",
"email": "sakren@gmail.com"
Expand Down
10 changes: 6 additions & 4 deletions src/DIConfigurator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class DIConfigurator
@EXPOSE_NAME = 'di'


config: null

path: null

defaultSetup:
Expand All @@ -26,10 +28,10 @@ class DIConfigurator


create: ->
config = new Configuration(@path)
@config = new Configuration(@path)

defaultService = @defaultService
config.addSection('services').loadConfiguration = ->
@config.addSection('services').loadConfiguration = ->
config = @getConfig()

for name of config
Expand All @@ -39,10 +41,10 @@ class DIConfigurator
return config

defaultSetup = @defaultSetup
config.addSection('setup').loadConfiguration = ->
@config.addSection('setup').loadConfiguration = ->
return @getConfig(defaultSetup)

configuration = config.load()
configuration = @config.load()
di = new DI

if configuration.setup.windowExpose != null
Expand Down

0 comments on commit a0be5c9

Please sign in to comment.