No capitalize step

This commit is contained in:
Raul Ochoa 2015-03-16 00:21:55 +01:00
parent 336491b54c
commit 8c09dfd230
8 changed files with 41 additions and 41 deletions

View File

@ -14,7 +14,7 @@
"immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
// "indent" : 4, // {int} Number of spaces to use for indentation
// "latedef" : false, // true: Require variables/functions to be defined before being used
// "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
// "noempty" : true, // true: Prohibit use of empty blocks
"nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters.

View File

@ -1,6 +1,6 @@
var sqlApi = require('../sql/sql_api');
var PSQL = require('cartodb-psql');
var Step = require('step');
var step = require('step');
function QueryTablesApi(pgConnection, metadataBackend) {
this.pgConnection = pgConnection;
@ -78,7 +78,7 @@ QueryTablesApi.prototype.runQuery = function(username, query, queryHandler, call
var params = {};
Step(
step(
function setAuth() {
self.pgConnection.setDBAuth(username, params, this);
},
@ -109,7 +109,7 @@ QueryTablesApi.prototype.runQuery = function(username, query, queryHandler, call
} else {
Step(
step(
function getApiKey() {
self.metadataBackend.getUserMapKey(username, this);
},

View File

@ -1,4 +1,4 @@
var Step = require('step');
var step = require('step');
var _ = require('underscore');
function PgConnection(metadataBackend) {
@ -24,7 +24,7 @@ PgConnection.prototype.setDBAuth = function(username, params, callback) {
var user_params = {};
var auth_user = global.environment.postgres_auth_user;
var auth_pass = global.environment.postgres_auth_pass;
Step(
step(
function getId() {
self.metadataBackend.getUserId(username, this);
},
@ -76,7 +76,7 @@ PgConnection.prototype.setDBConn = function(dbowner, params, callback) {
dbhost: global.environment.postgres.host,
dbport: global.environment.postgres.port
});
Step(
step(
function getConnectionParams() {
self.metadataBackend.getUserDBConnectionParams(dbowner, this);
},

View File

@ -1,5 +1,5 @@
var _ = require('underscore');
var Step = require('step');
var step = require('step');
var Windshaft = require('windshaft');
var Cache = require('./cache_validator');
var os = require('os');
@ -102,7 +102,7 @@ var CartodbWindshaft = function(serverOptions) {
}
}
var req = res.req;
Step (
step (
function addCacheChannel() {
if ( ! req ) {
// having no associated request can happen when
@ -172,7 +172,7 @@ var CartodbWindshaft = function(serverOptions) {
*/
ws.get(serverOptions.base_url + '/infowindow', function(req, res){
ws.doCORS(res);
Step(
step(
function(){
serverOptions.getInfowindow(req, this);
},
@ -193,7 +193,7 @@ var CartodbWindshaft = function(serverOptions) {
*/
ws.get(serverOptions.base_url + '/map_metadata', function(req, res){
ws.doCORS(res);
Step(
step(
function(){
serverOptions.getMapMetadata(req, this);
},

View File

@ -1,4 +1,4 @@
var Step = require('step');
var step = require('step');
var _ = require('underscore');
function TemplateMapsController(app, serverOptions, templateMaps, metadataBackend, templateBaseUrl, surrogateKeysCache,
@ -35,7 +35,7 @@ TemplateMapsController.prototype.create = function(req, res) {
var cdbuser = self.serverOptions.userByReq(req);
Step(
step(
function checkPerms(){
self.serverOptions.authorizedByAPIKey(req, this);
},
@ -83,7 +83,7 @@ TemplateMapsController.prototype.update = function(req, res) {
var cdbuser = this.serverOptions.userByReq(req);
var template;
var tpl_id;
Step(
step(
function checkPerms(){
self.serverOptions.authorizedByAPIKey(req, this);
},
@ -142,7 +142,7 @@ TemplateMapsController.prototype.retrieve = function(req, res) {
var cdbuser = this.serverOptions.userByReq(req);
var tpl_id;
Step(
step(
function checkPerms(){
self.serverOptions.authorizedByAPIKey(req, this);
},
@ -203,7 +203,7 @@ TemplateMapsController.prototype.destroy = function(req, res) {
var cdbuser = this.serverOptions.userByReq(req);
var tpl_id;
Step(
step(
function checkPerms(){
self.serverOptions.authorizedByAPIKey(req, this);
},
@ -256,7 +256,7 @@ TemplateMapsController.prototype.list = function(req, res) {
var cdbuser = this.serverOptions.userByReq(req);
Step(
step(
function checkPerms(){
self.serverOptions.authorizedByAPIKey(req, this);
},
@ -296,7 +296,7 @@ TemplateMapsController.prototype.instantiate = function(req, res) {
if ( req.profiler && req.profiler.statsd_client) {
req.profiler.start('windshaft-cartodb.instance_template_post');
}
Step(
step(
function() {
if ( ! req.headers['content-type'] || req.headers['content-type'].split(';')[0] != 'application/json') {
throw new Error('template POST data must be of type application/json, it is instead ');
@ -323,7 +323,7 @@ TemplateMapsController.prototype.jsonp = function(req, res) {
if ( req.profiler && req.profiler.statsd_client) {
req.profiler.start('windshaft-cartodb.instance_template_get');
}
Step(
step(
function() {
if ( req.query.callback === undefined || req.query.callback.length === 0) {
throw new Error('callback parameter should be present and be a function name');
@ -367,7 +367,7 @@ TemplateMapsController.prototype.instantiateTemplate = function(req, res, templa
tpl_id = tpl_id[1];
}
var auth_token = req.query.auth_token;
Step(
step(
function getTemplate(){
self.templateMaps.getTemplate(cdbuser, tpl_id, this);
},
@ -460,7 +460,7 @@ TemplateMapsController.prototype.finish_instantiation = function(err, response,
TemplateMapsController.prototype.setDBParams = function(cdbuser, params, callback) {
var self = this;
Step(
step(
function setAuth() {
self.pgConnection.setDBAuth(cdbuser, params, this);
},

View File

@ -1,7 +1,7 @@
var dot = require('dot');
var fs = require('fs');
var path = require('path');
var Step = require('step');
var step = require('step');
function HealthCheck(metadataBackend, tilelive) {
this.metadataBackend = metadataBackend;
@ -41,7 +41,7 @@ HealthCheck.prototype.check = function(config, callback) {
};
var mapnikXmlParams = config;
Step(
step(
function getDBParams() {
startTime = Date.now();
self.metadataBackend.getAllUserDBParams(config.username, this);

View File

@ -1,5 +1,5 @@
var _ = require('underscore');
var Step = require('step');
var step = require('step');
var QueryTablesApi = require('./api/query_tables_api');
var PgConnection = require('./backends/pg_connection');
var crypto = require('crypto');
@ -147,7 +147,7 @@ module.exports = function(redisPool) {
var that = this;
Step (
step (
function checkCached() {
if ( me.channelCache.hasOwnProperty(cacheKey) ) {
callback(null, me.channelCache[cacheKey]);
@ -167,7 +167,7 @@ module.exports = function(redisPool) {
}
var next = this;
var mapStore = app.mapStore;
Step(
step(
function loadFromStore() {
mapStore.load(req.params.token, this);
},
@ -333,7 +333,7 @@ module.exports = function(redisPool) {
var dbName = req.params.dbname;
var cacheKey = dbName + ':' + token;
Step(
step(
function getAffectedTablesAndLastUpdatedTime() {
queryTablesApi.getAffectedTablesAndLastUpdatedTime(username, sql, this);
},
@ -444,7 +444,7 @@ module.exports = function(redisPool) {
}
//console.log("given ApiKey: " + givenKey);
var user = me.userByReq(req);
Step(
step(
function (){
cartoData.getUserMapKey(user, this);
},
@ -468,7 +468,7 @@ module.exports = function(redisPool) {
var that = this;
var user = me.userByReq(req);
Step(
step(
function (){
that.authorizedByAPIKey(req, this);
},
@ -618,7 +618,7 @@ module.exports = function(redisPool) {
if (req.profiler) req.profiler.done('req2params.setup');
Step(
step(
function getPrivacy(){
me.authorize(req, this);
},
@ -671,7 +671,7 @@ module.exports = function(redisPool) {
var that = this;
var user = me.userByReq(req);
Step(
step(
function(){
// TODO: if this step really needed ?
that.req2params(req, this);
@ -699,7 +699,7 @@ module.exports = function(redisPool) {
var that = this;
var user = me.userByReq(req);
Step(
step(
function(){
// TODO: if this step really needed ?
that.req2params(req, this);

View File

@ -1,7 +1,7 @@
var crypto = require('crypto'),
Step = require('step'),
_ = require('underscore'),
dot = require('dot');
var crypto = require('crypto');
var step = require('step');
var _ = require('underscore');
var dot = require('dot');
var EventEmitter = require('events').EventEmitter;
@ -71,7 +71,7 @@ o._redisCmd = function(redisFunc, redisArgs, callback) {
var that = this;
var db = that.db_signatures;
Step(
step(
function getRedisClient() {
that.redis_pool.acquire(db, this);
},
@ -204,7 +204,7 @@ o.addTemplate = function(owner, template, callback) {
var userTemplatesKey = this.key_usr_tpl({ owner:owner });
var limit = this._userTemplateLimit();
Step(
step(
function checkLimit() {
if ( ! limit ) {
return 0;
@ -252,7 +252,7 @@ o.addTemplate = function(owner, template, callback) {
//
o.delTemplate = function(owner, tpl_id, callback) {
var self = this;
Step(
step(
function deleteTemplate() {
self._redisCmd('HDEL', [ self.key_usr_tpl({ owner:owner }), tpl_id ], this);
},
@ -310,7 +310,7 @@ o.updTemplate = function(owner, tpl_id, template, callback) {
var userTemplatesKey = this.key_usr_tpl({ owner:owner });
Step(
step(
function getExistingTemplate() {
self._redisCmd('HGET', [ userTemplatesKey, tpl_id ], this);
},
@ -365,7 +365,7 @@ o.listTemplates = function(owner, callback) {
//
o.getTemplate = function(owner, tpl_id, callback) {
var self = this;
Step(
step(
function getTemplate() {
self._redisCmd('HGET', [ self.key_usr_tpl({owner:owner}), tpl_id ], this);
},