Summary of changes:

- updated copyright
 - several tempalate changes for the docs
 - added a config for grunt-contrib-watch
 - updated nock commit number
 - fixed the coverage script
 - removed the export_docs script
 - added error message for legacy "es" users who don't have a version locked and have not upgraded
 - host will now add auth to urls created with `#makeUrl()`
 - Log class no longer looks for `config.loggers`
 - The log class now properly escapes single quotes in trace logs
 - Removed compiled yaml_tests.js from the repo
 - Yaml suite will only log error and warning messages unless the VERBOSE env var is set
 - createDefer is now a global setting, changed by modifying Transport.createDefer fubction
 - wrote tests for Content-Type checking
 - callbacks will now return the body and status of the request (if the request has completed) when an error occurs
 - Stdio logger now adds "Elasticsearch " to the front of log messages to distinguish it from other output to stdout.
This commit is contained in:
Spencer Alger
2013-12-15 14:08:29 -07:00
parent 0c8bd328fe
commit 37cd2f4f6c
20 changed files with 229 additions and 34803 deletions

View File

@ -1,74 +0,0 @@
var path = require('path');
var argv = require('optimist')
.default({
outputDir: '.',
verbose: false
})
.alias({
o: 'outputDir',
v: 'verbose'
})
.argv;
require('./_steps')(argv, [
['runInModule', {
cmd: 'node',
args: ['scripts/generate', '--force']
}],
['copy', {
from: path.join(__dirname, '../docs/_methods.jade'),
to: path.join(argv.outputDir, '_methods.jade')
}],
['copy', {
from: path.join(__dirname, '../docs/_method_list.jade'),
to: path.join(argv.outputDir, '_method_list.jade')
}]
]);
// function runInModule(cmd, args, exitCb) {
// log('running', cmd, args.join(' '));
// var proc = cp.spawn(cmd, args, {
// stdio: argv.verbose ? 'inherit' : 'ignore'
// });
// proc.on('error', function (err) {
// console.error('Error! --', err.message);
// process.exit(1);
// });
// proc.on('exit', function (status) {
// if (status) {
// console.error('Error! --', cmd, 'exit status was', status);
// process.exit(1);
// } else {
// exitCb();
// }
// });
// }
// function copy(from, to, done) {
// log('copying', from, 'to', to);
// var read = fs.createReadStream(from);
// var write = fs.createWriteStream(to);
// read.pipe(write);
// read.on('error', function (err) {
// console.error('unable to read: ' + from);
// console.error(err.message);
// process.exit(1);
// });
// write.on('error', function (err) {
// console.error('unable to write to: ' + to);
// console.error(err.message);
// process.exit(1);
// });
// write.on('finish', function () {
// done();
// });
// }

View File

@ -7,14 +7,12 @@ var actionId = action.name.toLowerCase().replace(/[^\w]+/g, '-');
h2#<%= actionId %>.fn
span.name <%= action.name %>
span.args (params, [callback])
a.perma(href="api.html#<%= actionId %>", title="Permalink")
a.esdoc(href="<%= action.docUrl %>", title="Endpoint Docs")
//-
h4 Spec:
pre
code <%= JSON.stringify(action, null, ' ').split('\n').map(function (line, i) {
return (i > 0 ? ' | ' : '') + line;
}).join('\n') %>
include _descriptions/<%= action.name %>.jade
a.esdoc(href="<%= action.docUrl %>", title="<%= action.name %> at elasticsearch.org").
<%= action.docUrl %>
p.tight.
The default method is <code><%= action.spec.method || 'GET' %></code> and
the usual <a href="#api-conventions">params and return values</a> apply.
<% if (_.size(action.allParams)) { %>
h3 Params:
@ -26,10 +24,6 @@ dl.params.api
<%= indent(param.description || '', 4) %><%
}); %>
<% } %>
p.
Default method: <%= action.spec.method || 'GET' %><br>
Includes <a href="#api-conventions-return">the usual</a>
include _examples/<%= action.name %>.jade<%
});
%>

View File

@ -1,7 +1,13 @@
#!/bin/bash
# let the dust settle and ensure that es is ready for us.
sleep 15s
# generate the latest version of the yaml-tests
node scripts/generate/ --no-api 2>&1 > /dev/null
export VERBOSE="true"
# unit tests
./node_modules/.bin/mocha test/unit/test_*.js \
--require should \