Browse files

Update for github api changes

* nixes the require.paths--that doesn't seem to be valid anymore for
  node.js
* updates the github api to the new api version

jig now runs and it'll respond to messages like:

    pull #50

and:

    botsnack

I don't know offhand what else I can do to test it.
  • Loading branch information...
1 parent df648bd commit 17a39b07b5d2508f1dec33ca1a300519bfb24634 Will Kahn-Greene committed Jul 11, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 jig.js
View
7 jig.js
@@ -1,4 +1,3 @@
-require.paths.unshift('./node_modules');
var http = require('http'),
https = require('https'),
qs = require('querystring'),
@@ -12,8 +11,8 @@ var http = require('http'),
}).parseArgs(),
daemon = require('daemon'),
IniReader = require('inireader').IniReader,
- GitHubApi = require('github').GitHubApi,
- github = new GitHubApi(),
+ GitHubApi = require('github'),
+ github = new GitHubApi({version: "3.0.0"}),
PULLREQRE = /pull\s+(?:req\s+)?#?(\d+)/i,
TAGRE = /\/tags\/(.+)$/i;
@@ -66,7 +65,7 @@ client.on('message', function(from, to, msg) {
client.say(to, 'YUMMY');
} else if (PULLREQRE.test(msg)) {
var m = PULLREQRE.exec(msg);
- github.getPullApi().show(CONFIG.github.user, CONFIG.github.repo, m[1], function(err, pull) {
+ github.pullRequests.get({user: CONFIG.github.user, repo: CONFIG.github.repo, number: m[1]}, function(err, pull) {
if (err || !pull) {
console.log(err);
return;

0 comments on commit 17a39b0

Please sign in to comment.