Comparing version 1.0.3 to 1.1.0
@@ -66,3 +66,3 @@ var GitHub = require('node-github') | ||
Octopie.prototype.listen = function(port) { | ||
Octopie.prototype.listen = function(port, cb) { | ||
if (!port) { throw new Error("Can't start listening without a port!") } | ||
@@ -72,10 +72,16 @@ | ||
function combineEvents(obj, repo) { | ||
obj[repo] = self.events | ||
return obj | ||
} | ||
syncHooks({ | ||
// Interpolate our repos and events into a repo: [events] hash | ||
hooks: this.repos.reduce(function(obj, repo) { obj[repo] = self.events }, {}), | ||
eventsHash: this.repos.reduce(combineEvents, {}), | ||
auth: { type: 'oauth', token: this.authToken }, | ||
url: this.url | ||
}, function(err, results) { | ||
this.server.listen(port) | ||
console.log('Now listening on port', port) | ||
self.server.listen(port, function() { | ||
if (typeof cb === 'function') { cb.call(null, arguments) } | ||
}) | ||
}) | ||
@@ -82,0 +88,0 @@ } |
{ | ||
"name": "octopie", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "An easy way to add GitHub hooks to your project", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -92,29 +92,2 @@ var assert = require("assert") | ||
}) | ||
it("should not find hooks on a repo that is inaccessible", function (done) { | ||
var octopie = octoFactory(); | ||
octopie.add('fullscreeninc/bacon'); | ||
octopie._configureHooks(function (err, hooks) { | ||
assert.deepEqual(hooks, []) | ||
done(); | ||
}); | ||
}); | ||
it("should create our hook in response to not finding our hook", function (done) { | ||
var octopie = octoFactory(); | ||
octopie.add('ryancbarry/underscore'); | ||
octopie.on('issues', function () {}); | ||
octopie.on('pull_request', function () {}); | ||
octopie._configureHooks(function (err, hooks) { | ||
console.log('configured : hooks:\n', hooks); | ||
// assert.deepEqual(hooks, []) | ||
// var hook = hooks[0]; | ||
// assert(hook.config.url === 'http://google.com'); | ||
// assert(hook.name === 'web'); | ||
// assert.deepEqual(hook.events, ['issues', 'pull_request']); | ||
// assert(hook.config.content_type === 'json'); | ||
// assert(hook.config.insecure_ssl === '1'); | ||
done(); | ||
}); | ||
}); | ||
}); |
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
6761
161