Skip to content

Commit

Permalink
Merge pull request #42 from priyatam/master
Browse files Browse the repository at this point in the history
added support for environ to manage github auth locally
  • Loading branch information
Raynes committed Dec 4, 2013
2 parents 61e609d + cf6ae42 commit b312d56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
:url "https://github.com/Raynes/tentacles"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.4.0"]
:dependencies [[org.clojure/clojure "1.5.1"]
[clj-http "0.4.0"]
[cheshire "4.0.0"]
[com.cemerick/url "0.0.6"]
[org.clojure/data.codec "0.1.0"]])
[org.clojure/data.codec "0.1.0"]
[environ "0.4.0"]])
7 changes: 6 additions & 1 deletion src/tentacles/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@
req (make-request method end-point positional query)]
(http/request req))))

(defn rate-limit
(defn environ-auth
"Lookup :gh-username and :gh-password in environ (~/.lein/profiles.clj or .lein-env) and return a string auth.
Usage: (users/me {:auth (environ-auth)})"
(str (:gh-username env ) ":" (:gh-password env)))

(defn rate-limit
([] (api-call :get "rate_limit"))
([opts] (api-call :get "rate_limit" nil opts)))

Expand Down

0 comments on commit b312d56

Please sign in to comment.