dotfiles/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/index.js.tpl
Cyryl Płotnicki 280bcab25f VSCode update
2016-09-24 13:12:34 +02:00

40 lines
931 B
Smarty

/**
* class <%name%>
*
* <%description%>
*
* Copyright 2012 Cloud9 IDE, Inc.
*
* This product includes software developed by
* Cloud9 IDE, Inc (http://c9.io).
*
* Author: Mike de Boer <info@mikedeboer.nl>
**/
"use strict";
var Fs = require("fs");
var Util = require("./../../util");
var error = require("./../../error");
var GithubHandler = module.exports = function(client) {
this.client = client;
this.routes = JSON.parse(Fs.readFileSync(__dirname + "/routes.json", "utf8"));
};
var proto = {
sendError: function(err, block, msg, callback) {
if (this.client.debug)
Util.log(err, block, msg.user, "error");
if (typeof err == "string")
err = new error.InternalServerError(err);
if (callback)
callback(err);
}
};
[<%scripts%>].forEach(function(api) {
Util.extend(proto, require("./" + api));
});
GithubHandler.prototype = proto;