From 9ea14d298790b9efd3507fb56e0e6710b5ebf549 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Tue, 27 Aug 2013 17:14:55 -0500 Subject: [PATCH 1/2] Add additional github repo APIs Implements - listTag - listPulls - compare --- github.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/github.js b/github.js index 2fd811f0..1b353827 100644 --- a/github.js +++ b/github.js @@ -223,6 +223,42 @@ }); }; + // List all tags of a repository + // ------- + + this.listTags = function(cb) { + _request("GET", repoPath + "/tags", null, function(err, tags) { + if (err) return cb(err); + cb(null, tags); + }); + }; + + // List all pull requests of a respository + // ------- + + this.listPulls = function(state, cb) { + if (_.isFunction(state)) { + cb = state; + state = undefined; + } + + _request("GET", repoPath + "/pulls" + (state ? '?state=' + state : ''), null, function(err, pulls) { + if (err) return cb(err); + cb(null, pulls); + }); + }; + + + // Retrieve the changes made between base and head + // ------- + + this.compare = function(base, head, cb) { + _request("GET", repoPath + "/compare/" + base + "..." + head, null, function(err, diff) { + if (err) return cb(err); + cb(null, diff); + }); + }; + // Retrieve the contents of a blob // ------- From 2aef9c35563708cf9ae15ae736cbba9eb3347986 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Fri, 30 Aug 2013 00:33:38 -0500 Subject: [PATCH 2/2] Add getPull and listIssues APIs --- github.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/github.js b/github.js index 1b353827..73855254 100644 --- a/github.js +++ b/github.js @@ -248,6 +248,35 @@ }); }; + // Gets details for a specific pull request + // ------- + + this.getPull = function(number, cb) { + _request("GET", repoPath + "/pulls/" + number, null, function(err, pull) { + if (err) return cb(err); + cb(null, pull); + }); + }; + + // List all issues of a respository + // ------- + + this.listIssues = function(options, cb) { + if (_.isFunction(options)) { + cb = options; + options = undefined; + } + + var params = _.map(options, function(value, key) { + return encodeURIComponent(key) + '=' + encodeURIComponent(value); + }).join('&'); + + _request("GET", repoPath + "/issues" + (params ? "?" + params : ""), null, function(err, issues) { + if (err) return cb(err); + cb(null, issues); + }); + }, + // Retrieve the changes made between base and head // ------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy