From c639bde65dc1a2e9a31bbffab22be6c490733819 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Wed, 3 Dec 2014 13:21:53 +0000 Subject: [PATCH] made app name optional because we can pull it from the package.json file --- lib/Apps.js | 4 ++-- lib/CLI.js | 4 ++-- test/lib/AppsTest.js | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/Apps.js b/lib/Apps.js index a059bdc5..e9932eb1 100644 --- a/lib/Apps.js +++ b/lib/Apps.js @@ -11,7 +11,7 @@ var Apps = function() { } util.inherits(Apps, Actions) -Apps.prototype.deployApplication = function(name, url, options) { +Apps.prototype.installApplication = function(url, name, options) { this._do(options, function(boss) { var user = options.user || this._user.name @@ -29,7 +29,7 @@ Apps.prototype.listApplications = function(options) { boss.listApplications(function(error, deployedApplications) { if(error) throw error - var table = new Table('No applications have been deployed') + var table = new Table('No applications have been installed') table.addHeader(['Name', 'User', 'URL']) deployedApplications.forEach(function(app) { diff --git a/lib/CLI.js b/lib/CLI.js index 531eb819..7368eb63 100644 --- a/lib/CLI.js +++ b/lib/CLI.js @@ -162,11 +162,11 @@ CLI.prototype.afterPropertiesSet = function() { .action(this._remote.generateSSLCertificate.bind(this._remote)) this._commander - .command('install ') + .command('install [appName]') .description('Installs an application from a git repository') .option('-u, --user ', 'The user to install as - n.b. the current user must be able to su to that user') .option('-v, --verbose', 'Prints detailed internal logging output') - .action(this._apps.deployApplication.bind(this._apps)) + .action(this._apps.installApplication.bind(this._apps)) this._commander .command('lsapps') diff --git a/test/lib/AppsTest.js b/test/lib/AppsTest.js index dfe65bde..af9314cc 100644 --- a/test/lib/AppsTest.js +++ b/test/lib/AppsTest.js @@ -45,19 +45,19 @@ describe('Apps', function() { console.error = error }) - it('should deploy an application', function() { + it('should install an application', function() { var name = 'name' var url = 'url' var options = {} boss.deployApplication = sinon.stub() boss.deployApplication.callsArg(5) - apps.deployApplication(name, url, options) + apps.installApplication(url, name, options) expect(boss.disconnect.called).to.be.true }) - it('should relay stdout when deploying an application', function(done) { + it('should relay stdout when installing an application', function(done) { var name = 'name' var url = 'url' var options = {} @@ -70,10 +70,10 @@ describe('Apps', function() { done() } - apps.deployApplication(name, url, options) + apps.installApplication(url, name, options) }) - it('should relay stderr when deploying an application', function(done) { + it('should relay stderr when installing an application', function(done) { var name = 'name' var url = 'url' var options = {} @@ -86,10 +86,10 @@ describe('Apps', function() { done() } - apps.deployApplication(name, url, options) + apps.installApplication(url, name, options) }) - it('should fail to deploy application', function() { + it('should fail to install application', function() { var name = 'name' var url = 'url' var options = {} @@ -99,13 +99,13 @@ describe('Apps', function() { boss.deployApplication.callsArgWith(5, new Error('urk!')) try { - apps.deployApplication(name, url, options) + apps.installApplication(url, name, options) } catch(e) { if(e.message != 'urk!') throw e } }) - it('should list deployed applications', function(done) { + it('should list installed applications', function(done) { var options = {} var applications = [{ name: 'foo', @@ -131,7 +131,7 @@ describe('Apps', function() { apps.listApplications(options) }) - it('should fail to list deployed applications', function() { + it('should fail to list installed applications', function() { var options = {} boss.listApplications = sinon.stub() boss.listApplications.callsArgWith(0, new Error('urk!'))