Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

package-ified, depends on hubhook

  • Loading branch information...
commit 81a890bb84e03440a05fa61f6ed5374f703b9018 1 parent 63d5af1
@jfhbrook authored
View
17 example.js
@@ -1,17 +0,0 @@
-var hook = require('./hook')(),
- pullover = require('./pullover')('/tmp/repos');
-
-var http = require('http');
-
-http.createServer(function (req, res) {
- if (req.url === '/api/webhooks/git') {
- return hook.handle(req, res);
- }
- res.end('lolno');
-}).listen(7005);
-
-hook.on('payload', function (payload) {
- pullover.pull(payload, function (err) {
- console.log(err || 'success!');
- });
-});
View
35 hook.js
@@ -1,35 +0,0 @@
-var EventEmitter = require('events').EventEmitter,
- util = require('util');
-
-var qs = require('querystring');
-
-var Hook = module.exports = function () {
- if (!(this instanceof Hook)) {
- return new Hook();
- }
-};
-util.inherits(Hook, EventEmitter);
-
-Hook.prototype.handle = function (req, res) {
- var payload = [],
- self = this;
- try {
- req.on('data', function (data) {
- payload.push(data.toString());
- });
- req.on('end', function () {
- self.emit('payload', JSON.parse(qs.parse(payload.join('')).payload));
- res.end(JSON.stringify({ ok: true }) + '\n');
- });
- }
- catch (err) {
- if (!self.listeners('error')) {
- return self.emit('error', err);
- }
- throw err;
- }
-};
-
-Hook.handle = function (req, res) {
- return new Hook().handle(req, res);
-};
View
0  pullover.js → index.js
File renamed without changes
View
22 package.json
@@ -0,0 +1,22 @@
+{
+ "name": "pullover",
+ "version": "0.0.0",
+ "description": "Pull git repos. A counterpart to pushover.",
+ "main": "index.js",
+ "directories": {
+ "example": "examples"
+ },
+ "scripts": {
+ "test": "tests-of-the-sierra-madre && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jesusabdullah/pullover.git"
+ },
+ "keywords": [
+ "git",
+ "pull"
+ ],
+ "author": "Joshua Holbrook",
+ "license": "MIT/X11"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.