Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Doc example show di instance with params in wrong order #7

Closed
NervosaX opened this issue Apr 2, 2016 · 3 comments
Closed

Doc example show di instance with params in wrong order #7

NervosaX opened this issue Apr 2, 2016 · 3 comments

Comments

@NervosaX
Copy link

NervosaX commented Apr 2, 2016

Ie the api example is:

GulpDI(object gulp, object options)

The code example is:

let di = GulpDI({
  DEBUG: false, // when set to true, the plugin will log info to console. Useful for bug reporting and issue debugging
  pattern: ['gulp-*', 'gulp.*'], // the glob(s) to search for
  config: 'package.json', // where to find the plugins, by default searched up from process.cwd()
  scope: ['dependencies', 'devDependencies', 'peerDependencies'], // which keys in the config to look within
  replaceString: /^gulp(-|\.)/, // what to remove from the name of the module when adding it to the context
  rename: {}, // a mapping of plugins to rename
  renameFn: function (name) { ... } // a function to handle the renaming of plugins (the default works)
}, require('gulp'));

Subsequently the error for putting them in the wrong order doesn't make it very obvious. :)

$ gulp
/home/adam/Programming/work/salespreso-gulp-v2/node_modules/gulp-di/contrib/help.js:104
    return _task.apply(gulp, args);
                ^

TypeError: Cannot read property 'apply' of undefined
    at Object.HelpTask.gulp.task (/home/adam/Programming/work/salespreso-gulp-v2/node_modules/gulp-di/contrib/help.js:104:17)
    at GulpDI.HelpTask (/home/adam/Programming/work/salespreso-gulp-v2/node_modules/gulp-di/contrib/help.js:109:8)
    at GulpDI.$injector (/home/adam/Programming/work/salespreso-gulp-v2/node_modules/gulp-di/lib/di.js:56:20)
    at GulpDI.inject (/home/adam/Programming/work/salespreso-gulp-v2/node_modules/gulp-di/lib/di.js:192:30)
    at GulpDI.parseOptions (/home/adam/Programming/work/salespreso-gulp-v2/node_modules/gulp-di/lib/di.js:161:14)
    at new GulpDI (/home/adam/Programming/work/salespreso-gulp-v2/node_modules/gulp-di/lib/di.js:118:12)
    at /home/adam/Programming/work/salespreso-gulp-v2/node_modules/gulp-di/lib/di.js:330:12
    at module.exports (/home/adam/Programming/work/salespreso-gulp-v2/index.js:6:14)
    at Object.<anonymous> (/home/adam/Programming/work/salespreso-gulp-v2/examples/jspm/gulpfile.js:4:1)
    at Module._compile (module.js:413:34)

@cmtt cmtt closed this as completed in eb1571b Apr 2, 2016
@cmtt
Copy link
Owner

cmtt commented Apr 2, 2016

Hi NervosaX, thank you for the heads up.
This might have been very frustrating when attempting to use this framework.

@NervosaX
Copy link
Author

NervosaX commented Apr 2, 2016

It caught me off guard for a bit, but not too much harm done. It looks like there could be a few other things out of date in the docs, too.

@cmtt
Copy link
Owner

cmtt commented Apr 4, 2016

Hi @NervosaX, time constraints forbid me currently to update the entire documentation, but feel free to file another issue in case you think something can be done in a better way. Thanks a lot for the help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants