diff --git a/gulpfile.js b/gulpfile.js index 43d57ec..e156c44 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -33,4 +33,8 @@ gulp.task('doc', function() { .pipe(jsdoc.generator('./doc', tpl, opts)); }); +gulp.task('watch', function() { + gulp.watch('*.js', ['doc']); +}); + gulp.task('default', ['doc']); diff --git a/project.js b/project.js index bafe41c..0024a50 100644 --- a/project.js +++ b/project.js @@ -71,17 +71,13 @@ function handleResponse(res) { /** -```js - +@example var Project = require('mozilla-treeherder/project'); var project = new Project('gaia', { consumerKey: 'key', - consumerSecret: 'yes' + consumerSecret: 'secret' }); -``` - - @param {String} project name. @param {Object} config for project. @param {String} config.consumerKey for oauth. @@ -145,6 +141,29 @@ Project.prototype = { /** Update or create a resultset. + @example + + var resultset = [{ + revision_hash: '435323', + // it's in seconds + push_timestamp: 111111 + type: 'push', + revisions: [{ + comment: 'I did stuff', + files: [ + 'dom/foo/bar', + ], + revision: '23333', + // this must match the project name + repository: 'gaia', + author: 'jlal@mozilla.com' + }] + }]; + + project.postResultset(resultset).then(function(result) { + // ... + }); + @see http://treeherder-dev.allizom.org/docs/#!/project/Result_Set_post_9 @param {Object} resultset full resultset object. @return {Promise}