Permalink
Browse files

Merge pull request #183 from janl/master

Accept url.parse() as options
  • Loading branch information...
2 parents 87d463b + 20acbab commit 6ad6a5304ab263866609e22cbd60697ec1259ff0 @cloudhead cloudhead committed Aug 15, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/cradle.js
View
@@ -65,6 +65,14 @@ cradle.Connection = function Connection(/* variable args */) {
}
});
+ if(typeof auth == "string") {
+ // probaby via a url.parse()
+ var userpass = auth.split(":");
+ auth = {};
+ auth.username = userpass[0];
+ auth.password = userpass[1] || null;
+ }
+
this.host = host || cradle.host;
this.port = port || cradle.port;
this.auth = auth || cradle.auth;

0 comments on commit 6ad6a53

Please sign in to comment.