changed the tarballUrl in the generator script to the documented version, fixed the order of the default grunt task

This commit is contained in:
Spencer Alger
2013-11-11 15:10:49 -07:00
3 changed files with 11 additions and 5 deletions

View File

@ -176,8 +176,8 @@ module.exports = function (grunt) {
grunt.registerTask('default', [
/*jshint scripturl:true*/
'jshint',
'mochaTest:unit',
'build',
'mochaTest:unit',
'mochaTest:yaml_suite'
]);

View File

@ -16,7 +16,7 @@ elasticsearch.js works great in node, as well as modern browsers (many thanks to
- Node:
[![Build Status](https://magnum.travis-ci.com/spenceralger/elasticsearch-js.png?token=tsFxSKHtVKG8EZavSjXY)](https://magnum.travis-ci.com/spenceralger/elasticsearch-js)
[![Build Status](https://travis-ci.com/elasticsearch/elasticsearch-js)](https://magnum.travis-ci.com/spenceralger/elasticsearch-js)
- Browsers (see [browser builds](#browser-builds)):

View File

@ -6,7 +6,8 @@ var zlib = require('zlib');
var path = require('path');
var _ = require('lodash');
var url = require('url');
var tarUrl = 'https://github.com/elasticsearch/elasticsearch-rest-api-spec/archive/master.tar.gz';
var tarUrl = 'https://github.com/elasticsearch/elasticsearch-rest-api-spec/tarball/master';
var topDir = null; // remove the lowest directory, which changes with each commit.
exports.get = function (pattern) {
var stream = new EventEmitter();
@ -27,9 +28,14 @@ exports.get = function (pattern) {
console.error('request failed', incoming.statusCode, incoming.headers);
}
} else {
incoming.pipe(zlib.createGunzip()).pipe(tar.Parse())
incoming
.pipe(zlib.createGunzip())
.pipe(tar.Parse())
.on('entry', function (entry) {
entry.path = path.relative('elasticsearch-rest-api-spec-master', entry.path);
if (!topDir) {
topDir = entry.path.split('/').shift();
}
entry.path = path.relative(topDir, entry.path);
if (matcher.match(entry.path)) {
collectData(entry);
} else {