nodejitsu/nodejitsu-api — pull request #5 by skyisle (2012-01-17 07:29:25+00:00)
Title: Broken jinsu create and deploy

jitsu@0.7.7 with nodejitsu-api@0.2.4 failed to call "jitsu deploy" for new apps"

I'm attaching callstacks.

```/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/helpers.js:9
if (appName.search('/') === -1) {
^
TypeError: Cannot call method 'search' of undefined
at [object Object]. (/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/helpers.js:9:15)
at [object Object].available (/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/apps.js:154:29)
at Object.available (/usr/local/lib/node_modules/jitsu/lib/jitsu/package.js:473:14)
at /usr/local/lib/node_modules/jitsu/lib/jitsu/commands/apps.js:200:21
at /usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/apps.js:38:5
at Request._callback (/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/client.js:99:5)
at Request.callback (/usr/local/lib/node_modules/jitsu/node_modules/request/main.js:104:22)
at Request. (/usr/local/lib/node_modules/jitsu/node_modules/request/main.js:458:18)
at Request.emit (events.js:67:17)
at IncomingMessage. (/usr/local/lib/node_modules/jitsu/node_modules/request/main.js:423:16)
```
After change appName to app.name,

```/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/apps.js:50
this.request('POST', ['apps', username, app.name], app, callback, function (
^
ReferenceError: username is not defined
at [object Object].create (/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/apps.js:50:33)
at createApp (/usr/local/lib/node_modules/jitsu/lib/jitsu/commands/apps.js:193:20)
at /usr/local/lib/node_modules/jitsu/lib/jitsu/package.js:501:5
at /usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/apps.js:158:5
at Request._callback (/usr/local/lib/node_modules/jitsu/node_modules/nodejitsu-api/lib/client/client.js:99:5)
at Request.callback (/usr/local/lib/node_modules/jitsu/node_modules/request/main.js:104:22)
at Request. (/usr/local/lib/node_modules/jitsu/node_modules/request/main.js:458:18)
at Request.emit (events.js:67:17)
at IncomingMessage. (/usr/local/lib/node_modules/jitsu/node_modules/request/main.js:423:16)
```