Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dependancy fix 0.1.3

  • Loading branch information...
commit 8e7410b81f1ed84116717cf62f543bf34232b9f6 1 parent 5dde711
Paulius Uza pauliusuza authored
4 lib/cargobox.js
View
@@ -1,5 +1,5 @@
-var Class = require('classful')
+var Class = require('./classful')
, connect = require('connect')
, http = require('http')
, fs = require('fs')
@@ -46,7 +46,7 @@ var CargoBox = (function (){
var _server;
var _router;
var _routes;
- var _version = '0.1.2';
+ var _version = '0.1.3';
return Class.create ({
126 lib/classful.js
View
@@ -0,0 +1,126 @@
+/**
+ * @name Classful JS for Node.js.
+ * @description Library that eases the manipulation and usage of JavaScript prototypes.
+ *
+ * @author Gabriel Llamas
+ * @created 16/02/2012
+ * @modified 22/03/2012
+ * @version 1.1.2
+ */
+"use strict";
+
+module.exports = {
+ create: function (settings){
+ var Class = function (){
+ if (this !== undefined){
+ if (constructor) constructor.apply (this, arguments);
+ }else{
+ var o = Object.create (Class.prototype);
+ if (constructor) constructor.apply (o, arguments);
+ return o;
+ }
+ };
+
+ var constructor;
+
+ if (settings){
+ var p = settings["constructor"];
+ if (p !== Object){
+ constructor = p;
+ }
+
+ var extend = settings["extend"];
+ if (extend){
+ var type = typeof extend;
+ if (type === "function"){
+ Class.prototype = Object.create (extend.prototype);
+ Object.defineProperties (Class.prototype, {
+ "constructor": {
+ value: Class,
+ enumerable: false
+ },
+ "__super__": {
+ value: extend.prototype,
+ enumerable: false
+ }
+ });
+ }else if (type === "object"){
+ throw "Cannot extend a singleton.";
+ }else{
+ throw "Invalid class to extend.";
+ }
+ }
+
+ p = settings["properties"];
+ if (p){
+ if (extend){
+ for (var i in p){
+ Class.prototype[i] = p[i];
+ }
+ }else{
+ Class.prototype = p;
+ Object.defineProperty (Class.prototype, "constructor", {
+ value: Class,
+ enumerable: false
+ });
+ }
+ }
+
+ p = settings["singleton"];
+ if (p){
+ var proto = Class.prototype;
+ Class = {
+ "getInstance": (function (){
+ var instance;
+ return function (){
+ if (!instance){
+ instance = Object.create (Class.prototype);
+ if (constructor) constructor.call (instance);
+ this["getInstance"] = function (){
+ return instance;
+ };
+ return instance;
+ }
+ };
+ })()
+ };
+ Class.prototype = proto;
+ }
+
+ p = settings["onCreate"];
+ if (p){
+ p (Class);
+ }
+ }
+
+ return Class;
+ },
+ update: function (f, settings){
+ var p = settings["properties"];
+ if (p !== undefined){
+ for (var i in f.prototype){
+ if (f.prototype["hasOwnProperty"](i)){
+ delete f.prototype[i];
+ }
+ }
+
+ if (p !== null){
+ for (var i in p){
+ f.prototype[i] = p[i];
+ }
+ }
+ }
+
+ p = settings["augment"];
+ if (p){
+ for (var i in p){
+ f.prototype[i] = p[i];
+ }
+ }
+
+ p = settings["onUpdate"];
+ if (p){
+ p (f);
+ }
+ }
+};
2  lib/request.js
View
@@ -1,4 +1,4 @@
-var Class = require('classful')
+var Class = require('./classful')
, connect = require('connect')
, http = require('http')
, parse = require('url').parse
2  lib/response.js
View
@@ -1,4 +1,4 @@
-var Class = require('classful')
+var Class = require('./classful')
, http = require('http')
, mime = require('mime')
, connect = require('connect')
2  lib/route.js
View
@@ -1,4 +1,4 @@
-var Class = require('classful');
+var Class = require('./classful');
/**
* ==========================
2  lib/routecollection.js
View
@@ -1,4 +1,4 @@
-var Class = require('classful');
+var Class = require('./classful');
/**
* ==========================
2  lib/router.js
View
@@ -1,4 +1,4 @@
-var Class = require('classful')
+var Class = require('./classful')
, Route = require('./route')
, RouteCollection = require('./routecollection')
, utilities = require('./utilities')
3  lib/view.js
View
@@ -1,4 +1,4 @@
-var Class = require('classful')
+var Class = require('./classful')
, path = require('path')
, dirname = path.dirname
, basename = path.basename
@@ -84,7 +84,6 @@ var View = Class.create ({
}
return result;
};
-
if(layout != false) {
try {
options.body = res;
3  package.json
View
@@ -2,14 +2,13 @@
"name": "cargobox",
"description": "Web development framework for Node.JS",
"author": "Paulius Uza <pauliusuza@gmail.com>",
- "version": "0.1.2",
+ "version": "0.1.3",
"private": false,
"engines": {
"node": ">=0.6.x",
"npm": ">=1.1.x"
},
"dependencies": {
- "classful": "1.1.2",
"connect": "2.0.3",
"mime": "1.2.5"
},
Please sign in to comment.
Something went wrong with that request. Please try again.