Skip to content

Commit

Permalink
made app name optional because we can pull it from the package.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Dec 3, 2014
1 parent 61dfa3e commit c639bde
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/Apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ CLI.prototype.afterPropertiesSet = function() {
.action(this._remote.generateSSLCertificate.bind(this._remote))

this._commander
.command('install <appName> <url>')
.command('install <url> [appName]')
.description('Installs an application from a git repository')
.option('-u, --user <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')
Expand Down
20 changes: 10 additions & 10 deletions test/lib/AppsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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 = {}
Expand All @@ -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 = {}
Expand All @@ -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',
Expand All @@ -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!'))
Expand Down

0 comments on commit c639bde

Please sign in to comment.