updated the grunt tasks, and the jquery connector will now properly parse json response bodies

This commit is contained in:
Spencer Alger
2013-12-21 00:36:41 -07:00
parent 77e3dcb95b
commit d17217929a
4 changed files with 39 additions and 19 deletions

View File

@ -1,30 +1,37 @@
module.exports = function (grunt) {
grunt.registerTask('browser_clients:test', [
'build',
'browserify:yaml_tests',
'run:browser_unit_tests',
'run:browser_integration_tests'
]);
grunt.registerTask('browser_clients:build', [
'clean:dist',
'browserify',
'browserify:browser_client',
'browserify:angular_client',
'browserify:jquery_client',
'uglify:dist',
'concat:dist_banners'
]);
grunt.registerTask('browser_clients:publish', [
grunt.registerTask('browser_clients:distribute', [
'clean:dist',
'browser_clients:build',
'compress:dist_zip',
'compress:dist_tarball',
'copy:dist_to_named_dir',
'compress:master_zip',
'compress:master_tarball',
's3:latest'
]);
grunt.registerTask('browser_clients:release', [
'prompt:confirm_release',
'__check_for_confirmation',
'clean:dist',
'browser_clients:build',
'compress:dist_zip',
'compress:dist_tarball',
'copy:dist_to_named_dir',
'compress:release_zip',
'compress:release_tarball',
's3:release'
]);

View File

@ -1,14 +1,17 @@
// make it dry
function archive(out) {
return {
cwd: '<%= distDir %>',
src: 'elasticsearch-js',
options: {
archive: '<%= distDir %>/archives/' + out
}
};
}
module.exports = {
dist_zip: {
src: '<%= distDir %>/*.js',
options: {
archive: '<%= distDir %>/archives/elasticsearch-js.zip'
}
},
dist_tarball: {
src: '<%= distDir %>/*.js',
options: {
archive: '<%= distDir %>/archives/elasticsearch-js.tar.gz'
}
}
master_zip: archive('elasticsearch-js-master.zip'),
master_tarball: archive('elasticsearch-js-master.tar.gz'),
release_zip: archive('elasticsearch-js-<%= package.version %>.zip'),
release_tarball: archive('elasticsearch-js-<%= package.version %>.tar.gz')
};

8
grunt/config/copy.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
dist_to_named_dir: {
cwd: '<%= distDir %>',
src: '*.js',
dest: '<%= distDir %>/elasticsearch-js/',
expand: true
}
};

View File

@ -34,7 +34,9 @@ JqueryConnector.prototype.request = function (params, cb) {
var jqXHR = jQuery.ajax(ajax)
.done(function (data, textStatus, jqXHR) {
cb(null, data, jqXHR.statusCode(), jqXHR.getAllResponseHeaders());
cb(null, data, jqXHR.statusCode(), {
'content-type': jqXHR.getResponseHeader('content-type')
});
})
.fail(function (jqXHR, textStatus, err) {
cb(new ConnectionFault(err && err.message));