Skip to content

Commit

Permalink
Merge pull request github-tools#42 from guidomb/master
Browse files Browse the repository at this point in the history
Adds support for repository issues
  • Loading branch information
mattpass committed Sep 27, 2013
2 parents 1942ce4 + b40dc9b commit efbdc06
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,13 @@ gist.update(delta, function(err, gist) {

});
```
## Issues API

To read all the issues of a given repository

```js
github.getIssues(owner, repo, function(err, issues) {})
```

## Tests

Expand Down
17 changes: 17 additions & 0 deletions github.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,26 @@
};
};

// Issues API
// ==========

Github.Issue = function(options) {
var path = "/repos/" + options.owner + "/" + options.repo + "/issues";

this.list = function(options, cb) {
_request("GET", path, options, function(err, res) {
cb(err,res)
});
};
};

// Top Level API
// -------

this.getIssues = function(owner, repo) {
return new Github.Issue({owner: owner, repo: repo});
};

this.getRepo = function(user, repo) {
return new Github.Repository({user: user, name: repo});
};
Expand Down

0 comments on commit efbdc06

Please sign in to comment.