Skip to content

Commit

Permalink
Added a better sequence formatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynes committed Sep 22, 2010
1 parent 519fd0a commit 939496f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cake_github/core.clj
Expand Up @@ -59,7 +59,10 @@
(defn format-generic-map [m]
(format-keys (line-template (max-width m)) m))

;; This will likely become a multimethod.
(defn format-sequence [s]
(apply str (apply concat (interpose ["\n"] (partition-all 10 (interpose ", " s))))))

;; This might become a multimethod.
(defn format-result-helper [result map-type]
(str "\n"
(cond
Expand All @@ -71,7 +74,7 @@
(string? result) result
(nil? result) "wut"
(not (seq result)) "Nothing interested happened.\n"
:else (str (apply str (interpose ", " result)) "\n"))))
:else (str (format-sequence result) "\n"))))

(defn option-to-int [opt default]
(cond
Expand Down

0 comments on commit 939496f

Please sign in to comment.