dependency-injection
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -48,3 +48,3 @@ // Generated by CoffeeScript 1.7.1 | ||
DI.prototype.addService = function(name, service, args) { | ||
var originalService; | ||
var arg, i, originalService, _i, _len; | ||
if (args == null) { | ||
@@ -68,2 +68,6 @@ args = []; | ||
} | ||
for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { | ||
arg = args[i]; | ||
args[i] = this.tryCallArgument(arg); | ||
} | ||
this.services[name] = new Service(this, name, service, args); | ||
@@ -93,2 +97,5 @@ this.services[name].setInstantiate(this.instantiate); | ||
} | ||
if (this.config !== null && (match = arg.match(/^%([a-zA-Z.-_]+)%$/))) { | ||
return this.getParameter(match[1]); | ||
} | ||
if (!arg.match(/^(factory\:)?[@$]/)) { | ||
@@ -95,0 +102,0 @@ return arg; |
{ | ||
"name": "dependency-injection", | ||
"description": "Dependency injection with configuration and autowire for node js and browser", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "David Kudera", |
@@ -522,3 +522,3 @@ [![NPM version](https://badge.fury.io/js/dependency-injection.png)](http://badge.fury.io/js/dependency-injection) | ||
* 2.3.1 | ||
* 2.3.1 - 2.3.2 | ||
+ Fixed bug with passing list of parameters in method calls [https://github.com/sakren/node-dependency-injection/issues/7](#7) | ||
@@ -525,0 +525,0 @@ |
// Generated by CoffeeScript 1.7.1 | ||
(function() { | ||
var Configuration, DI, DIFactory, Database, Http, di, dir, expect, factory, path; | ||
var Configuration, DI, DIFactory, Database, Http, Mail, di, dir, expect, factory, path; | ||
@@ -19,2 +19,4 @@ expect = require('chai').expect; | ||
Mail = require('../../data/Mail'); | ||
dir = path.resolve(__dirname + '/../../data'); | ||
@@ -48,3 +50,3 @@ | ||
}); | ||
return it('should create database service with list of parameters', function() { | ||
it('should create database service from factory with list of parameters', function() { | ||
var db; | ||
@@ -62,2 +64,16 @@ factory = new DIFactory(dir + '/database.json'); | ||
}); | ||
return it('should create service with list of parameters', function() { | ||
var mail; | ||
factory = new DIFactory(dir + '/mail.json'); | ||
di = factory.create(); | ||
mail = di.get('mail'); | ||
expect(mail).to.be.an["instanceof"](Mail); | ||
return expect(mail.setup).to.be.eql({ | ||
type: 'SMTP', | ||
auth: { | ||
user: 'root', | ||
pass: 'toor' | ||
} | ||
}); | ||
}); | ||
}); | ||
@@ -64,0 +80,0 @@ describe('#parameters', function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218945
53
3752