Permalink
Browse files

make ns-form-for-file available to leiningen, close #16

Needed for test subcommand:
technomancy/leiningen@5cc3aa8#L0R113
  • Loading branch information...
1 parent 50a78a1 commit ef3b961e3b8a03e4f8b3932ef575f423e6efe708 @cldwalker cldwalker committed Feb 12, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/bultitude/core.clj
View
5 src/bultitude/core.clj
@@ -30,12 +30,15 @@
(when-not (= ::done form)
(recur rdr)))))
+(defn ns-form-for-file [file]
+ (with-open [r (PushbackReader. (io/reader file))] (read-ns-form r)))
+
(defn namespaces-in-dir
"Return a seq of all namespaces found in Clojure source files in dir."
[dir]
(for [f (file-seq (io/file dir))
:when (and (clj? f) (.canRead f))
- :let [ns-form (with-open [r (PushbackReader. (io/reader f))] (read-ns-form r))]
+ :let [ns-form (ns-form-for-file f)]
:when ns-form]
ns-form))

0 comments on commit ef3b961

Please sign in to comment.