Skip to content
Browse files

Merge pull request #77 from jgable/addRepoReleases

Add repo releases
  • Loading branch information...
2 parents cb4beff + ab6aac4 commit fe1ce374e99387344f123db6048fecdda4d1c7d3 @pksunkara committed Dec 7, 2013
Showing with 26 additions and 0 deletions.
  1. +6 −0 README.md
  2. +13 −0 lib/octonode/repo.js
  3. +7 −0 src/octonode/repo.coffee
View
6 README.md
@@ -437,6 +437,12 @@ ghrepo.commit('18293abcd72', callback); //commit
ghrepo.tags(callback); //array of tags
```
+#### Get the releases for a repository (GET /repos/pksunkara/hub/releases)
+
+```js
+ghrepo.releases(callback); //array of releases
+```
+
#### Get the languages for a repository (GET /repos/pksunkara/hub/languages)
```js
View
13 lib/octonode/repo.js
@@ -88,6 +88,19 @@
});
};
+ Repo.prototype.releases = function(cb) {
+ return this.client.get("/repos/" + this.name + "/releases", function(err, s, b, h) {
+ if (err) {
+ return cb(err);
+ }
+ if (s !== 200) {
+ return cb(new Error("Repo releases error"));
+ } else {
+ return cb(null, b, h);
+ }
+ });
+ };
+
Repo.prototype.languages = function(cb) {
return this.client.get("/repos/" + this.name + "/languages", function(err, s, b, h) {
if (err) {
View
7 src/octonode/repo.coffee
@@ -57,6 +57,13 @@ class Repo
return cb(err) if err
if s isnt 200 then cb(new Error("Repo tags error")) else cb null, b, h
+ # Get the releases for a repository
+ # '/repos/pksunkara/hub/releases' GET
+ releases: (cb) ->
+ @client.get "/repos/#{@name}/releases", (err, s, b, h) ->
+ return cb(err) if err
+ if s isnt 200 then cb(new Error("Repo releases error")) else cb null, b, h
+
# Get the languages for a repository
# '/repos/pksunkara/hub/languages' GET
languages: (cb) ->

0 comments on commit fe1ce37

Please sign in to comment.
Something went wrong with that request. Please try again.