Permalink
Browse files

Using two segment namespaces (the latter two) now.

  • Loading branch information...
1 parent 6f7c578 commit 410d3d184c6970dbe4d542d41fab7f3ea9d953b5 @Raynes committed Oct 14, 2010
Showing with 91 additions and 90 deletions.
  1. +10 −9 src/cake_github/gists.clj
  2. +22 −22 src/cake_github/issues.clj
  3. +43 −43 src/cake_github/repos.clj
  4. +16 −16 src/cake_github/users.clj
@@ -1,31 +1,32 @@
(ns cake-github.gists
(:use cake cake.core
cake-github.core
- clj-github.gists))
+ clj-github.gists)
+ (:import java.awt.Toolkit))
-(deftask github.gists.new
+(deftask gists.new
"Gist a file. Pass in the path to the file relative to where this task is called."
(format-result
(str
"http://gist.github.com/"
(:repo
- (let [gist-file ((:github.gists.new *opts*) 0)]
+ (let [gist-file ((:gists.new *opts*) 0)]
(new-gist auth
(last (.split gist-file "/"))
(slurp (str (System/getProperty "user.dir") "/" gist-file))))))))
-(deftask github.gists.contents
+(deftask gists.contents
"Show the contents of a gist. Pass in the id of the gist and the file name."
- {[one two] :github.gists.contents}
+ {[one two] :gists.contents}
(format-result (show-gist auth one two)))
-(deftask github.gists.show
+(deftask gists.show
"Show metadata for another user's gists. Pass in the name of the user. Pass in --results
to limit results. The default limit is three."
(format-result
- (show-users-gists auth ((:github.gists.show *opts*) 0))
+ (show-users-gists auth ((:gists.show *opts*) 0))
:map-type :gist :max (:results *opts*)))
-(deftask github.gists.meta
+(deftask gists.meta
"Show a gist's metadata. Pass in the gist's ID."
- (format-result (show-gist-meta auth ((:github.gists.meta *opts*) 0)) :map-type :gist))
+ (format-result (show-gist-meta auth ((:gists.meta *opts*) 0)) :map-type :gist))
@@ -3,70 +3,70 @@
cake-github.core
clj-github.issues))
-(deftask github.issues.open
+(deftask issues.open
"Open an issue. Pass in the owner of the repo, name of the repo,
title of the issue, and body of the issue."
- {[one two three four] :github.issues.open}
+ {[one two three four] :issues.open}
(format-result (open-issue auth one two three four) :map-type :issue))
-(deftask github.issues.info
+(deftask issues.info
"Show data about an issue. Pass in the owner of the repo, name of the repo,
and number of the issue."
- {[one two three] :github.issues.info}
+ {[one two three] :issues.info}
(format-result (show-issue auth one two three) :map-type :issue))
-(deftask github.issues.close
+(deftask issues.close
"Close an issue. Pass in the owner of the repo, name of the repo, and issue number."
- {[one two three] :github.issues.close}
+ {[one two three] :issues.close}
(format-result (close-issue auth one two three) :map-type :issue))
-(deftask github.issues.comment
+(deftask issues.comment
"Comment on an issue. Pass in the owner of the repo, name of the repo, issue number,
and the comment you want to add."
- {[one two three four] :github.issues.comment}
+ {[one two three four] :issues.comment}
(format-result (comment-issue auth one two three four) :map-type :comment))
-(deftask github.issues.tag
+(deftask issues.tag
"Add a label to an issue or the system. Pass in the owner of the repo, name of the repo,
the label you want to add, and the number of the issue or no number if you're adding
the label to the system rather than to an issue."
- {[one two three four] :github.issues.tag}
+ {[one two three four] :issues.tag}
(format-result (add-label auth one two three four)))
-(deftask github.issues.untag
+(deftask issues.untag
"Remove a label from an issue or the system. Pass in the owner of the repo, name of the repo,
the label you want to remove, and the number of the issue or no number if you're removing
the label from the system rather than from an issue."
- {[one two three four] :github.issues.untag}
+ {[one two three four] :issues.untag}
(format-result (remove-label auth one two three four)))
-(deftask github.issues.tags
+(deftask issues.tags
"Show the tags on a repo. Pass in the owner and name of the repo."
- {[one two] :github.issues.tags}
+ {[one two] :issues.tags}
(format-result (show-labels auth one two)))
-(deftask github.issues.comments
+(deftask issues.comments
"List the comments on an issue. Pass in the owner of the repo, name of the repo,
and the number of the issue. You can limit results with --results. The default limit
is three."
- {[one two three] :github.issues.comments results :results}
+ {[one two three] :issues.comments results :results}
(format-result (issue-comments auth one two three) :map-type :comment :max results))
-(deftask github.issues.show
+(deftask issues.show
"Show info about a repo's issues. Pass in the owner and name of the repo, and either
'open' or 'closed'. Limit results with --results. The default limit is three."
- {[one two three] :github.issues.show results :results}
+ {[one two three] :issues.show results :results}
(format-result (show-issues auth one two three) :map-type :issue :max results))
-(deftask github.issues.reopen
+(deftask issues.reopen
"Reopen a previously closed issue. Pass in the owner and name of the repo, and the issue
number."
- {[one two three] :github.issues.reopen}
+ {[one two three] :issues.reopen}
(format-result (reopen-issue auth one two three) :map-type :issue))
-(deftask github.issues.search
+(deftask issues.search
"Search through issues. Pass in the owner and name of the repo, the state of the issues
you want to search (either 'open' or 'closed') and the search term. Limit results with
--results. Default limit is three."
- {[one two three four] :github.issues.search results :results}
+ {[one two three four] :issues.search results :results}
(format-result (search-issues auth one two three four) :map-type :issue :max results))
@@ -3,123 +3,123 @@
cake-github.core
clj-github.repos))
-(deftask github.repos.show
+(deftask 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 to limit
the number of results shown. The default limit is three. "
- (format-result (show-repos auth ((:github.repos.show *opts*) 0))
+ (format-result (show-repos auth ((:repos.show *opts*) 0))
:max (:results *opts*) :generate-clone-urls true))
-(deftask github.repos.search
+(deftask repos.search
"Search for repos on github. Pass in the query string. You can optionally pass
--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)
- (format-options *opts* :github.repos.search :results))
+ (apply search-repos auth ((:repos.search *opts*) 0)
+ (format-options *opts* :repos.search :results))
:max (:results *opts*) :generate-clone-urls true))
-(deftask github.repos.create
+(deftask repos.create
"Create a repo. Pass in the name of the repository. Optionally pass --description,
--homepage, and --public=[true|false]"
(format-result
- (apply create-repo auth ((:github.repos.create *opts*) 0)
- (format-options *opts* :github.repos.create))
+ (apply create-repo auth ((:repos.create *opts*) 0)
+ (format-options *opts* :repos.create))
:generate-clone-urls true))
-(deftask github.repos.delete
+(deftask repos.delete
"Delete a repo. This cannot be undone. Use wisely. Pass in the name of the repo."
- (format-result (delete-repo auth ((:github.repos.delete *opts*) 0))))
+ (format-result (delete-repo auth ((:repos.delete *opts*) 0))))
-(deftask github.repos.fork
+(deftask repos.fork
"Fork a repo. Pass in the owner of the repo you want to fork and the name of the repo."
- {[one two] :github.repos.fork}
+ {[one two] :repos.fork}
(format-result (fork-repo auth one two) :generate-clone-urls true))
-(deftask github.repos.set
+(deftask repos.set
"Set information about a repo. Pass in the owner of the repo, the name of the repo,
the key corresponding to the information you want to change, and the value you want
to set it to. Possible keys are description, homepage, has_wiki, has_downloads,
and has_issues."
- {[one two three four] :github.repos.set}
+ {[one two three four] :repos.set}
(format-result (set-repo-info auth one two three four)))
-(deftask github.repos.info
+(deftask repos.info
"Get infomation about a repository. Pass in the owner of the repo and the name of the repo."
- {[one two] :github.repos.info}
+ {[one two] :repos.info}
(format-result (show-repo-info auth one two)))
-(deftask github.repos.watch
+(deftask repos.watch
"Watch a repo. Pass in the owner of the repo and the name of the repo."
- {[one two] :github.repos.watch}
+ {[one two] :repos.watch}
(format-result (watch-repo auth one two)))
-(deftask github.repos.unwatch
+(deftask repos.unwatch
"Unwatch a repo. Pass in the owner of the repo and the name of the repo."
- {[one two] :github.repos.unwatch}
+ {[one two] :repos.unwatch}
(format-result (unwatch-repo auth one two)))
-(deftask github.repos.tags
+(deftask repos.tags
"List the tags on a repo. Pass in the owner of the repo and it's name."
- {[one two] :github.repos.tag}
+ {[one two] :repos.tag}
(format-result (show-tags auth one two) :map-type :generic))
-(deftask github.repos.pushable
+(deftask 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
+(deftask 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."
- {[one two] :github.repos.network results :results}
+ {[one two] :repos.network results :results}
(format-result (show-network auth one two) :max results))
-(deftask github.repos.languages
+(deftask repos.languages
"List the languages used in a project. Values are in bytes. Limit results with --results.
The default limit is three."
- {[one two] :github.repos.languages results :results}
+ {[one two] :repos.languages results :results}
(format-result (show-languages auth one two) :max results :map-type :generic))
-(deftask github.repos.contributors
+(deftask 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."
- {[one two] :github.repos.contributors results :results}
+ {[one two] :repos.contributors results :results}
(format-result (show-contributors auth one two) :map-type :user :max results))
-(deftask github.repos.collaborators
+(deftask repos.collaborators
"List collaborators on a repo. Pass the owner and name of the repo."
- {[one two] :github.repos.collaborators}
+ {[one two] :repos.collaborators}
(format-result (show-collaborators auth one two)))
-(deftask github.repos.add-collaborator
+(deftask repos.add-collaborator
"Add a collaborator to your Github repository. Pass in the username you want to add and the
name of the repo."
- {[one two] :github.repos.add-collaborator}
+ {[one two] :repos.add-collaborator}
(format-result (add-collaborator auth one two)))
-(deftask github.repos.rm-collaborator
+(deftask repos.rm-collaborator
"Remove a collaborator from your Github repository. Pass in the username you want to remove
and the name of the repo."
- {[one two] :github.repos.rm-collaborator}
+ {[one two] :repos.rm-collaborator}
(format-result (remove-collaborator auth one two)))
-(deftask github.repos.deploy
+(deftask 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))))
+ (format-result (show-deploy-keys auth ((:repos.deploy *opts*) 0))))
-(deftask github.repos.add-deploy
+(deftask 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."
- {[one two three] :github.repos.add-deploy}
+ {[one two three] :repos.add-deploy}
(format-result (add-deploy-key auth one two three)))
-(deftask github.repos.rm-deploy
+(deftask repos.rm-deploy
"Remove a deploy key from a repository. Pass in the name of the repo and the title of the key."
- {[one two] :github.repos.rm-deploy}
+ {[one two] :repos.rm-deploy}
(format-result (remove-deploy-key auth one two)))
-(deftask github.repos.visibility
+(deftask repos.visibility
"Set a repository's visibility. Pass in the name of the repo and either 'public' or 'private'."
- {[one two] :github.repos.visibility}
+ {[one two] :repos.visibility}
(format-result (set-repo-visibility one two)))
@@ -3,41 +3,41 @@
cake-github.core
clj-github.users))
-(deftask github.users.follow
+(deftask users.follow
"Follow a user. Pass in the name of the user you want to follow."
- (format-result (follow auth ((:github.users.follow *opts*) 0))))
+ (format-result (follow auth ((:users.follow *opts*) 0))))
-(deftask github.users.unfollow
+(deftask users.unfollow
"Unfollow a user. Pass in the name of the user you want to unfollow."
- (format-result (unfollow auth ((:github.users.unfollow *opts*) 0))))
+ (format-result (unfollow auth ((:users.unfollow *opts*) 0))))
-(deftask github.users.search
+(deftask users.search
"Search users. Pass in the query string. Optionally pass --results to limit results.
Default is three."
(format-result
- (search-users auth ((:github.users.search *opts*) 0)) :map-type :user :max (:results *opts*)))
+ (search-users auth ((:users.search *opts*) 0)) :map-type :user :max (:results *opts*)))
-(deftask github.users.followers
+(deftask users.followers
"Find out what users are following a user. Pass in the user."
- (format-result (show-followers auth ((:github.users.followers *opts*) 0))))
+ (format-result (show-followers auth ((:users.followers *opts*) 0))))
-(deftask github.users.following
+(deftask users.following
"Find out what users another user is following. Pass in the user."
- (format-result (show-following auth ((:github.users.following *opts*) 0))))
+ (format-result (show-following auth ((:users.following *opts*) 0))))
-(deftask github.users.info
+(deftask users.info
"View detailed information about a user. Pass in the name of the user."
- (format-result (show-user-info auth ((:github.users.info *opts*) 0)) :map-type :user))
+ (format-result (show-user-info auth ((:users.info *opts*) 0)) :map-type :user))
-(deftask github.users.watching
+(deftask users.watching
"Find out what repos a user is watching. Pass in the name of the user. Optionally
pass --results to limit results. Default is three."
(format-result
- (show-watching auth ((:github.users.watching *opts*) 0))
+ (show-watching auth ((:users.watching *opts*) 0))
:map-type :repo :max (:results *opts*)))
-(deftask github.users.set
+(deftask users.set
"Set information about a user. Pass in the username, a key, and a value to set that key
to. Possible keys are name, email, blog, company, and location."
- {[one two three] :github.users.set}
+ {[one two three] :users.set}
(format-result (user-set auth one two three) :map-type :user))

0 comments on commit 410d3d1

Please sign in to comment.