Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a user map formatter.

  • Loading branch information...
commit 745d4a442c206d2a73df0e8dd9ab8866a3167f7e 1 parent 7afad4d
@Raynes authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/cake_github/core.clj
View
14 src/cake_github/core.clj
@@ -48,6 +48,14 @@
[:pushed_at :created_at]
[:clone_url :ssh_clone_url]])))
+(defn format-user-map [m]
+ (str
+ (:name m) " - " (:email m)
+ line
+ (format-keys
+ (line-template (max-width m))
+ (select-keys m [:location :login :company :contributions :type]))))
+
(defn format-generic-map [m]
(format-keys (line-template (max-width m)) m))
@@ -58,12 +66,12 @@
(map? result)
(cond
(= map-type :repo) (format-repo-map result)
- (= map-type :user) result ;; placeholder
+ (= map-type :user) (format-user-map result)
(= map-type :generic) (format-generic-map result))
(string? result) result
(nil? result) "wut"
- (not (seq result)) "Nothing interested happened."
- :else (apply str (interpose ", " result)))))
+ (not (seq result)) "Nothing interested happened.\n"
+ :else (str (apply str (interpose ", " result)) "\n"))))
(defn option-to-int [opt default]
(cond
Please sign in to comment.
Something went wrong with that request. Please try again.