diamond.js
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -5,3 +5,4 @@ // Generated by CoffeeScript 1.7.1 | ||
__hasProp = {}.hasOwnProperty, | ||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
__slice = [].slice; | ||
@@ -18,2 +19,23 @@ Controller = (function(_super) { | ||
Controller.prototype.send = function() { | ||
var args, _ref; | ||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
return (_ref = this.response).send.apply(_ref, args); | ||
}; | ||
Controller.prototype.json = function() { | ||
var args, _ref; | ||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
return (_ref = this.response).json.apply(_ref, args); | ||
}; | ||
Controller.prototype.error = function() { | ||
var args, type, _ref; | ||
type = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | ||
this.response.writeHead(type, { | ||
"Content-type": "text/plain" | ||
}); | ||
return (_ref = this.response).end.apply(_ref, args); | ||
}; | ||
return Controller; | ||
@@ -20,0 +42,0 @@ |
@@ -66,13 +66,7 @@ // Generated by CoffeeScript 1.7.1 | ||
return function(req, res) { | ||
if (req == null) { | ||
req = {}; | ||
} | ||
if (res == null) { | ||
res = {}; | ||
} | ||
controller.request = req || {}; | ||
controller.response = res || {}; | ||
controller.body = req.body || {}; | ||
controller.params = req.params || {}; | ||
return controller[action].call(controller); | ||
controller.body = controller.request.body || {}; | ||
controller.params = controller.request.params || {}; | ||
return controller[action].call(controller, req, res); | ||
}; | ||
@@ -79,0 +73,0 @@ }; |
{ | ||
"name": "diamond.js", | ||
"description": "MVC web framework", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Arthur Xavier", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27634
493