John Aspden posted an interesting question on Stack Overflow about adding
all of the latest versions of contrib libraries as dependencies in a REPL
session.  The question and my response can be found here:
http://stackoverflow.com/questions/13673094/how-do-i-depend-on-every-clojure-contrib-library/13676638

Since this solution might be generally useful, I have packaged it as a
library that can either be used as nREPL middleware or invoked manually in
an already-running REPL.  The code, usage instructions, and sample project
demonstrating the middleware usage can be found at
https://github.com/rplevy/contrib-repl

contrib-repl

nREPL middleware to look up the latest versions of all Clojure contrib
libraries and add them as dependencies. Can also be used manually in an
already-running REPL.
<https://github.com/rplevy/contrib-repl#usage>Usage<https://github.com/rplevy/contrib-repl#option-a-use-as-nrepl-middleware>Option
A. Use as nREPL middleware

Edit project.clj:

  :dependencies [[rplevy/contrib-repl "0.1.0"]]
  :repl-options {:nrepl-middleware [contrib-repl.middleware/add-contrib-deps]}

Then run lein repl to enter a repl with all contrib dependencies added.
<https://github.com/rplevy/contrib-repl#option-b-invoke-from-an-already-running-repl>Option
B. Invoke from an already running REPL

In a REPL session:

(require '[cemerick.pomegranate :as pom])(pom/add-dependencies
:coordinates '[[rplevy/contrib-repl "0.1.0"]]
                      :repositories {"clojars"
"http://clojars.org/repo"})(require '[contrib-repl.manually :refer
[add-contrib-deps]])(add-contrib-deps) ; add all of the contrib
libraries
You can also add just a subset of the contrib libraries:
(add-contrib-deps ["tools.nrepl" "core.match"]) ; only add these libraries

<https://github.com/rplevy/contrib-repl#license>License

Copyright © 2012 Robert P. Levy

Distributed under the Eclipse Public License, the same as Clojure.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to