Better docs and watch for gulpfile
This commit is contained in:
Родитель
425f5d9011
Коммит
c94dbce33a
|
@ -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']);
|
||||
|
|
31
project.js
31
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<Object>}
|
||||
|
|
Загрузка…
Ссылка в новой задаче