Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Completed the repo API.

  • Loading branch information...
commit 519fd0af0080fe7fc71a24c34c62802f0b57c45b 1 parent 745d4a4
@Raynes authored
Showing with 81 additions and 5 deletions.
  1. +81 −5 src/cake_github/tasks.clj
View
86 src/cake_github/tasks.clj
@@ -6,15 +6,14 @@
;; Repos ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(deftask github.repos.show
"Display information about repositories that a user has. Pass the username
- of the user you'd like to stalk. You can optionally pass --results=n to limit
- the number of results shown. The default limit is 3. Supply --results=all to not
- limit results."
+ of the user you'd like to stalk. You can optionally pass --results to limit
+ the number of results shown. The default limit is three. "
(format-result (show-repos auth ((:github.repos.show *opts*) 0))
:max (:results *opts*) :generate-clone-urls true))
(deftask github.repos.search
"Search for repos on github. Pass in the query string. You can optionally pass
- --results=n to limit results (=max to not limit results), default being three.
+ --results to limit results, default being three.
Optionally supply --language and --start-page to narrow results."
(format-result
(apply search-repos auth ((:github.repos.search *opts*) 0)
@@ -66,4 +65,81 @@
"List the tags on a repo. Pass in the owner of the repo and it's name."
(format-result
(show-tags auth ((:github.repos.tags *opts*) 0) ((:github.repos.tags *opts*) 1))
- :map-type :generic))
+ :map-type :generic))
+
+(deftask github.repos.pushable
+ "List all the repos that you don't own that you can push to. Limit results with --results.
+ the default limit is three."
+ (format-result (show-pushable auth) :max (:results *opts*)))
+
+(deftask github.repos.network
+ "Show a repository's full network. Pass in the owner and name of the repository.
+ Limit results with --results. The default limit is three."
+ (format-result
+ (show-network auth ((:github.repos.network *opts*) 0) ((:github.repos.network *opts*) 1))
+ :max (:results *opts*)))
+
+(deftask github.repos.languages
+ "List the languages used in a project. Values are in bytes. Limit results with --results.
+ The default limit is three."
+ (format-result
+ (show-languages auth ((:github.repos.languages *opts*) 0) ((:github.repos.languages *opts*) 1))
+ :max (:results *opts*) :map-type :generic))
+
+(deftask github.repos.contributors
+ "List everybody who has contributed to a repo, including non-github-users.
+ Pass the owner and name of the repository. Limit results with --results. Default limit is three."
+ (format-result
+ (show-contributors auth
+ ((:github.repos.contributors *opts*) 0)
+ ((:github.repos.contributors *opts*) 1))
+ :map-type :user :max (:results *opts*)))
+
+(deftask github.repos.collaborators
+ "List collaborators on a repo. Pass the owner and name of the repo."
+ (format-result
+ (show-collaborators auth
+ ((:github.repos.collaborators *opts*) 0)
+ ((:github.repos.collaborators *opts*) 1))))
+
+(deftask github.repos.add-collaborator
+ "Add a collaborator to your Github repository. Pass in the username you want to add and the
+ name of the repo."
+ (format-result
+ (add-collaborator auth
+ ((:github.repos.add-collaborator *opts*) 0)
+ ((:github.repos.add-collaborator *opts*) 1))))
+
+(deftask github.repos.rm-collaborator
+ "Remove a collaborator from your Github repository. Pass in the username you want to remove
+ and the name of the repo."
+ (format-result
+ (remove-collaborator auth
+ ((:github.repos.rm-collaborator *opts*) 0)
+ ((:github.repos.rm-collaborator *opts*) 1))))
+
+(deftask github.repos.deploy
+ "List the deploy keys for a repository. Pass in the name of the repo."
+ (format-result
+ (show-deploy-keys auth ((:github.repos.deploy *opts*) 0))))
+
+(deftask github.repos.add-deploy
+ "Add a deploy key to a repository. Pass in the name of the repository, title of the key
+ and the key itself."
+ (format-result
+ (add-deploy-key auth
+ ((:github.repos.add-deploy *opts*) 0)
+ ((:github.repos.add-deploy *opts*) 1)
+ ((:github.repos.add-deploy *opts*) 2))))
+
+(deftask github.repos.rm-deploy
+ "Remove a deploy key from a repository. Pass in the name of the repo and the title of the key."
+ (format-result
+ (remove-deploy-key auth
+ ((:github.repos.rm-deploy *opts*) 0)
+ ((:github.repos.rm-deploy *opts*) 1))))
+
+(deftask github.repos.visibility
+ "Set a repository's visibility. Pass in the name of the repo and either 'public' or 'private'."
+ (format-result
+ (set-repo-visibility ((:github.repos.visibility *opts*) 0) ((:github.repos.visibility *opts*) 1))))

0 comments on commit 519fd0a

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