Skip to content

Commit

Permalink
Update to the dynapath 0.2.0 api.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias committed Nov 22, 2012
1 parent a4cb170 commit 2353b1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion project.clj
Expand Up @@ -3,7 +3,7 @@
:description "A library for find Clojure namespaces on the classpath."
:url "https://github.com/Raynes/bultitude"
:dependencies [[org.clojure/clojure "1.4.0"]
[dynapath "0.1.0"]]
[dynapath "0.2.0"]]
:aliases {"test-all" ["with-profile" "dev,default:dev,1.3,default:dev,1.2,default" "test"]}
:profiles {:1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
:1.2 {:dependencies [[org.clojure/clojure "1.2.1"]]}})
15 changes: 4 additions & 11 deletions src/bultitude/core.clj
@@ -1,7 +1,7 @@
(ns bultitude.core
(:require [clojure.java.io :as io]
[clojure.string :as string]
[dynapath.core :as dp])
[dynapath.util :as dp])
(:import (java.util.jar JarFile)
(java.util.zip ZipException)
(java.io File BufferedReader PushbackReader InputStreamReader)
Expand Down Expand Up @@ -62,21 +62,14 @@
(.split classpath (System/getProperty "path.separator")))

(defn loader-classpath
"Returns a sequence of File paths from a classloader."
"Returns a sequence of File objects from a classloader."
[loader]
(when (dp/readable-classpath? loader)
(map io/as-file (dp/classpath-urls loader))))
(map io/as-file (dp/classpath-urls loader)))

(defn classpath-files
"Returns a sequence of File objects of the elements on the classpath."
([classloader]
(distinct
(mapcat
loader-classpath
(reverse
(take-while
identity
(iterate #(.getParent %) classloader))))))
(map io/as-file (dp/all-classpath-urls classloader)))
([] (classpath-files (clojure.lang.RT/baseLoader))))

(defn- classpath->collection [classpath]
Expand Down

0 comments on commit 2353b1f

Please sign in to comment.