Skip to content

Commit

Permalink
Added me.orgs method to list orgs, Fixes pksunkara#25
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Jul 15, 2012
1 parent fc4ffa4 commit ee02645
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -230,13 +230,19 @@ ghme.keys(1, {"title":"desktop", "key":"ssh-rsa AAA..."}, callback); //key
ghme.keys(1);
```

### List your public and private organizations (GET /user/orgs)

```js
ghme.orgs(callback); // array of orgs
```

### List your repositories (GET /user/repos)

```js
ghme.repos(callback); //array of repos
```

### Create a repository (POST /user/respos)
### Create a repository (POST /user/repos)

```js
ghme.repos({
Expand Down
13 changes: 13 additions & 0 deletions lib/octonode/me.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/octonode/me.coffee
Expand Up @@ -140,10 +140,17 @@ class Me
@client.del "/user/keys/#{id}", {}, (err, s, b) =>
@deleteKey(id) if err? or s isnt 204

# Get an organisation
# Get an organization
org: (name) ->
new Org name, @client

# List your public and private organizations
# '/user/orgs' GET
orgs: (cb) ->
@client.get "/user/orgs", (err, s, b) ->
return cb(err) if err
if s isnt 200 then cb(new Error('User orgs error')) else cb null, b

# List your repositories
# '/user/repos' GET
repos: (cbOrRepo, cb) ->
Expand Down

0 comments on commit ee02645

Please sign in to comment.