Skip to content

Commit

Permalink
complete repos-repo api
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Apr 29, 2012
1 parent 5cddda6 commit 275bd60
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions gh-repos.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,24 +66,33 @@
(git-url :initarg :git-url) (git-url :initarg :git-url)
(ssh-url :initarg :ssh-url) (ssh-url :initarg :ssh-url)
(svn-url :initarg :svn-url) (svn-url :initarg :svn-url)
(mirror-url :initarg :mirror-url)
(owner :initarg :owner :initform nil) (owner :initarg :owner :initform nil)
(language :initarg :language) (language :initarg :language)
(fork :initarg :fork) (fork :initarg :fork)
(forks :initarg :forks) (forks :initarg :forks)
(watchers :initarg :watchers) (watchers :initarg :watchers)
(size :initarg :size) (size :initarg :size)
(master-branch :initarg :master-branch)
(open-issues :initarg :open-issues) (open-issues :initarg :open-issues)
(pushed-at :initarg :pushed-at) (pushed-at :initarg :pushed-at)
(created-at :initarg :created-at) (created-at :initarg :created-at)

(updated-at :initarg :updated-at)
(owner-cls :allocation :class :initform gh-user)) (organisation :initarg :organisation :initform nil)
(parent :initarg :parent)
(source :initarg :source)

(owner-cls :allocation :class :initform gh-user)
(organisation-cls :allocation :class :initform gh-user)
(parent-cls :allocation :class :initform gh-repos-repo)
(source-cls :allocation :class :initform gh-repos-repo))
"Class for GitHub repositories") "Class for GitHub repositories")


(defmethod gh-object-read-into ((repo gh-repos-repo) data) (defmethod gh-object-read-into ((repo gh-repos-repo) data)
(call-next-method) (call-next-method)
(with-slots (url html-url clone-url git-url ssh-url svn-url (with-slots (url html-url clone-url git-url ssh-url svn-url
owner language fork forks watchers size open-issues owner language fork forks watchers size open-issues
pushed-at created-at) pushed-at created-at organisation parent source)
repo repo
(setq url (gh-read data 'url) (setq url (gh-read data 'url)
html-url (gh-read data 'html_url) html-url (gh-read data 'html_url)
Expand All @@ -101,7 +110,14 @@
size (gh-read data 'size) size (gh-read data 'size)
open-issues (gh-read data 'open_issues) open-issues (gh-read data 'open_issues)
pushed-at (gh-read data 'pushed_at) pushed-at (gh-read data 'pushed_at)
created-at (gh-read data 'created_at)))) created-at (gh-read data 'created_at)
organisation (gh-object-read (or (oref repo :organisation)
(oref repo organisation-cls))
(gh-read data 'organisation))
parent (gh-object-read (oref repo parent-cls)
(gh-read data 'parent))
source (gh-object-read (oref repo source-cls)
(gh-read data 'source)))))


(defclass gh-repos-ref (gh-object) (defclass gh-repos-ref (gh-object)
((label :initarg :label) ((label :initarg :label)
Expand Down

0 comments on commit 275bd60

Please sign in to comment.