Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removes some deprecated Q calls

  • Loading branch information...
commit fde719fda38effd96ec7cc8b97bca4cda8dd6a79 1 parent 9b53689
Seth Purcell authored
View
24 lib/App.js
@@ -29,7 +29,7 @@
var Class = require('capsela-util').Class;
var Log = require('capsela-util').Log;
var Logger = require('capsela-util').Logger;
-var capsela = require('capsela');
+var capsela = require('../');
var Q = require('q');
var App = Class.extend(
@@ -115,7 +115,16 @@ var App = Class.extend(
t.log(Log.INFO, "starting " + service.name);
- return Q.call(service.start, service).then(
+ var starting;
+
+ try {
+ starting = service.start();
+ }
+ catch (err) {
+ return Q.reject(err);
+ }
+
+ return starting.then(
function(result) {
return launchService(index + 1);
});
@@ -156,7 +165,16 @@ var App = Class.extend(
t.log(Log.INFO, "stopping " + service.name);
- return Q.call(service.stop, service).then(
+ var stopping;
+
+ try {
+ stopping = service.stop();
+ }
+ catch (err) {
+ return Q.reject(err);
+ }
+
+ return stopping.then(
function() {
return stopService();
},
View
2  lib/HttpClient.js
@@ -169,6 +169,6 @@ var HttpClient = Class.extend(
exports.HttpClient = HttpClient;
-var Request = require('capsela').Request;
+var Request = require('../').Request;
var ClientResponse = require('./ClientResponse').ClientResponse;
var StreamUtil = require('capsela-util').StreamUtil;
View
2  lib/Server.js
@@ -258,4 +258,4 @@ var Server = Service.extend(
exports.Server = Server;
-var capsela = require('capsela');
+var capsela = require('../');
View
2  lib/stages/Dispatcher.js
@@ -31,7 +31,7 @@
*/
var Log = require('capsela-util').Log;
-var capsela = require('capsela');
+var capsela = require('../../');
var fs = require('q-fs');
var Q = require('q');
View
2  lib/stages/ErrorHandler.js
@@ -26,7 +26,7 @@
"use strict";
-var capsela = require('capsela');
+var capsela = require('../../');
var Q = require('q');
var ErrorHandler = capsela.Stage.extend({
View
6 lib/stages/FileServer.js
@@ -27,7 +27,7 @@
"use strict";
var pathUtils = require('path');
-var capsela = require('capsela');
+var capsela = require('../../');
var Stage = capsela.Stage;
var qfs = require('q-fs');
var Q = require('q');
@@ -140,5 +140,5 @@ var FileServer = Stage.extend({
exports.FileServer = FileServer;
-var Response = require('capsela').Response;
-var FileResponse = require('capsela').FileResponse;
+var Response = require('../../').Response;
+var FileResponse = require('../../').FileResponse;
View
2  lib/stages/PreferredHost.js
@@ -26,7 +26,7 @@
"use strict";
-var capsela = require('capsela');
+var capsela = require('../../');
var Q = require('q');
var PreferredHost = capsela.Stage.extend({
View
4 lib/stages/Router.js
@@ -26,7 +26,7 @@
"use strict";
-var capsela = require('capsela');
+var capsela = require('../../');
var Route = require('../Route').Route;
var Q = require('q');
@@ -137,4 +137,4 @@ var Router = capsela.Stage.extend({
exports.Router = Router;
-var Response = require('capsela').Response;
+var Response = require('../../').Response;
View
8 lib/stages/SessionManager.js
@@ -26,7 +26,7 @@
"use strict";
-var Stage = require('capsela').Stage;
+var Stage = require('../../').Stage;
var Q = require('q');
var DEFAULT_SESSION_ID_KEY = '_sid';
@@ -163,6 +163,6 @@ var SessionManager = Stage.extend({
exports.SessionManager = SessionManager;
var Cookie = require('../Cookie').Cookie;
-var Session = require('capsela').Session;
-var SessionStore = require('capsela').SessionStore;
-var Response = require('capsela').Response;
+var Session = require('../../').Session;
+var SessionStore = require('../../').SessionStore;
+var Response = require('../../').Response;
View
2  lib/stages/ViewRenderer.js
@@ -32,7 +32,7 @@
* render themselves.
*/
-var capsela = require('capsela');
+var capsela = require('../../');
var Log = require('capsela-util').Log;
var Q = require('q');
View
2  lib/views/Ejs.js
@@ -8,7 +8,7 @@
"use strict";
-var capsela = require('capsela');
+var capsela = require('../../');
var ejs = require('../../deps/ejs/ejs.js');
var Ejs = capsela.View.extend({
View
2  lib/views/JsonML.js
@@ -26,7 +26,7 @@
"use strict";
-var capsela = require('capsela');
+var capsela = require('../../');
var emptyTags = {
'img': true,
View
2  lib/views/JsonTemplate.js
@@ -28,7 +28,7 @@
var jsontemplate = require('../../deps/json-template');
-var capsela = require('capsela');
+var capsela = require('../../');
var JsonTemplate = capsela.View.extend({
},
View
2  testing/tests/AppTest.js
@@ -26,7 +26,7 @@
"use strict";
-var capsela = require('capsela');
+var capsela = require('../../');
var App = capsela.App;
var mp = require('capsela-util').MonkeyPatcher;
var Log = require('capsela-util').Log;
Please sign in to comment.
Something went wrong with that request. Please try again.