Skip to content

Commit

Permalink
Merge pull request #257 from raveljs/bugfix/256
Browse files Browse the repository at this point in the history
getDependencies within injector not including @autoinjected deps
  • Loading branch information
Ghnuberath authored Jul 26, 2018
2 parents 5e23d4a + 524728b commit 3e6d21d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion documentation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Ravel API
version: 1.0.0-rc.3
version: 1.0.0-rc.4
versions:
- 1.0.0-rc.4
- 1.0.0-rc.3
- 1.0.0-rc.2
- 1.0.0-rc.1
Expand Down
2 changes: 1 addition & 1 deletion jest/integration/ravel-lifecycle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('Ravel lifeycle test', () => {
app.set('public directory', '/public');
app.set('favicon path', '/favicon.ico');

app.load(Another, Users, UsersResource, TestRoutes);
app.load(Users, UsersResource, TestRoutes, Another);
});

describe('#init()', () => {
Expand Down
7 changes: 4 additions & 3 deletions lib/core/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ class Injector {

/**
* @param {Class} DIClass - A class to retrieve injection metadata from.
* @returns {Array<string>} The modules which have been marked as DI dependencies
* for the target class (`@autoinject`ed).
* @returns {Object} The modules (keys) which have been marked as DI dependencies
* for the target class (`@autoinject`ed), as well as the name (values) they will be
* assigned to on the current scope.
* @private
*/
getAutoinjectedDependencies (DIClass) {
Expand All @@ -53,7 +54,7 @@ class Injector {
* @private
*/
getDependencies (DIClass) {
return this.getInjectedDependencies(DIClass).concat(this.getAutoinjectedDependencies(DIClass));
return this.getInjectedDependencies(DIClass).concat(Object.keys(this.getAutoinjectedDependencies(DIClass)));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ravel",
"version": "1.0.0-rc.3",
"version": "1.0.0-rc.4",
"author": "Sean McIntyre <[email protected]>",
"description": "Ravel Rapid Application Development Framework",
"engines": {
Expand Down

0 comments on commit 3e6d21d

Please sign in to comment.