Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated dependencies (added jugglingdb and mongo), updated extend.js …

…with more functionality and fixed issue with String.prototype.inject...
  • Loading branch information...
commit 74fb8f155b69637a40f8abdf9970f6b430a2853b 1 parent d3499fb
JimiB authored
8 app/config.json
View
@@ -1,3 +1,9 @@
{
- "port" : 3000
+ "port" : 3000,
+ "mongo":{
+ "host":"localhost",
+ "username":"USERNAME",
+ "password":"PASSWORD",
+ "database":"db-dev"
+ }
}
8 app/preinit/db.js
View
@@ -0,0 +1,8 @@
+var util = require("util");
+var Schema = require('jugglingdb').Schema;
+
+module.exports = function(app){
+ //create the schema for our other models to bind to
+ console.log("connected to db: "+ util.inspect(app.config));
+ app.db = new Schema('mongodb', app.config.mongo);
+}
17 app/preinit/extends.js
View
@@ -1,5 +1,5 @@
module.exports = function(app){
- String.prototype.injectParam = function(str, param, value){
+ String.injectParam = function(str, param, value){
var regexp = new RegExp(":"+param, "g");
return str.toString().replace(regexp, value);
}
@@ -103,6 +103,21 @@ module.exports = function(app){
var Class = require("uberclass");
var events = require("events");
+ Class.util = {
+ ExposeMethods : function(methods, target){
+ var result = {};
+
+ methods.forEach(function(method){
+ //link the methods
+ result[method] = function(){
+ target[method].apply(target, arguments);
+ }
+ });
+
+ return result;
+ }
+ }
+
Class.EventEmitterClass = Class.extend({},{
init : function(){
this.emitter = new events.EventEmitter();
4 package.json
View
@@ -11,6 +11,8 @@
"jade": "*",
"chauffeur" : "git://github.com/jimib/nodejs-chauffeur.git#master",
"earlybird" : "git://github.com/jimib/nodejs-earlybird.git#master",
- "uberclass" : "1.0.1"
+ "uberclass" : "1.0.1",
+ "jugglingdb" : "0.1.18",
+ "mongodb" : "1.1.7"
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.